Public: anyone can read this; the crew can change it.

The spark page shows the slowest ticks and the time per mod, from the decoded profile #18237

opened this

Merged 3h 24m ago, live in production

/games/ /spark/ now shows a "Slowest ticks" list and a "Time per mod" list below the call tree. The terminal shows the same rows, and the same two lists end its profile screen. I ran the two spark/terminal test files, tsc, the design lint and the gate, and all passed, as did the dead-export check.

Notes

opened this

/games/<box>/spark/<key> now shows a "Slowest ticks" list and a "Time per mod" list below the call tree. The terminal shows the same rows, and the same two lists end its profile screen. I ran the two spark/terminal test files, tsc, the design lint and the gate, and all passed, as did the dead-export check. I didn't run the full suite, and nothing was checked on a preview.

What changed

  • Slowest ticks: a table of window, max and median ms per tick, TPS and players.
  • Time per mod: a table of source, ms and share.
  • Escaping and no script: both are server-rendered with no script or outside fetch, and every name is escaped. A profile with no mod data says "This profile has no mod data: no frame was attributed to a mod."; one with no tick windows says so in one line too.
  • Layout: the rows and wording are built once in src/games/spark_view.ts for both doors. The page part is its own function in src/web/pages/games_spark_ticks.ts, with a single call line added to games_spark_view.ts, so it should merge cleanly with #18208.
  • Docs: docs/features/game-spark.md is updated. No new component class, so no design-area note.

Tests

  • A new test builds a profile with a hostile mod name and asserts both lists render. It also asserts the name is escaped, the empty-mod line appears, and the section has no <script>.
  • The terminal test was extended to scroll to the new section.

Not done: GC and memory are still decoded but not shown. The new section is plain tables, not a chart.

To try it: open a box's Profiles list and click a stored sampler profile, or press p, Enter and then j on the terminal.

Reused: the millis and percent formatters and the settings-block and table classes. bun scripts/similar.ts was not run.

Push: the pre-push hook asked for a "Try:" commit line, so there is an empty commit carrying it.

[
  {"go":"/games/<box>/spark/<key>","look":"Below the call tree: 'Slowest ticks' and 'Time per mod' tables","expect":"Slowest ticks has window, max, median, TPS and players; Time per mod has source, time and share"},
  {"go":"/games/<box>/spark/<key> for a profile with no mod data","look":"The Time per mod section","expect":"One plain line: 'This profile has no mod data: no frame was attributed to a mod.'"}
]

Closes #18212

4 earlier comments
commented

/games/<box>/spark/<key> now shows a "Slowest ticks" list and a "Time per mod" list below the call tree. The terminal shows the same rows, and the same two lists end its profile screen. I ran the two spark/terminal test files, tsc, the design lint and the gate, and all passed, as did the dead-export check. I didn't run the full suite, and nothing was checked on a preview.

What changed

  • Slowest ticks: a table of window, max and median ms per tick, TPS and players.
  • Time per mod: a table of source, ms and share.
  • Escaping and no script: both are server-rendered with no script or outside fetch, and every name is escaped. A profile with no mod data says "This profile has no mod data: no frame was attributed to a mod."; one with no tick windows says so in one line too.
  • Layout: the rows and wording are built once in src/games/spark_view.ts for both doors. The page part is its own function in src/web/pages/games_spark_ticks.ts, with a single call line added to games_spark_view.ts, so it should merge cleanly with #18208.
  • Docs: docs/features/game-spark.md is updated. No new component class, so no design-area note.

Tests

  • A new test builds a profile with a hostile mod name and asserts both lists render. It also asserts the name is escaped, the empty-mod line appears, and the section has no <script>.
  • The terminal test was extended to scroll to the new section.

Not done: GC and memory are still decoded but not shown. The new section is plain tables, not a chart.

To try it: open a box's Profiles list and click a stored sampler profile, or press p, Enter and then j on the terminal.

Reused: the millis and percent formatters and the settings-block and table classes. bun scripts/similar.ts was not run.

Push: the pre-push hook asked for a "Try:" commit line, so there is an empty commit carrying it.

[
  {"go":"/games/<box>/spark/<key>","look":"Below the call tree: 'Slowest ticks' and 'Time per mod' tables","expect":"Slowest ticks has window, max, median, TPS and players; Time per mod has source, time and share"},
  {"go":"/games/<box>/spark/<key> for a profile with no mod data","look":"The Time per mod section","expect":"One plain line: 'This profile has no mod data: no frame was attributed to a mod.'"}
]
commented

<!-- look-pages dfe35d10c89d --> Look pages for dfe35d1, from the gate:

  • look pages (none): this pull changes src/web/pages/games_spark_ticks.ts, src/web/pages/games_spark_view.ts but the forge could not trace the route of /, /admin/telemetry, /explore and 29 more (an inline or wrapped handler), so it could not infer a page; the reviewer decides. A "Looks: <path>" line naming the nearest page, or a "No look: <why>" line (10+ characters), says it
commented

I pushed an empty commit to the pull whose message carries the gate lines. I didn't change any code. The local gate no longer refuses the pull; it now prints only notes. The forge's own check hasn't run on this push yet.

  • Direction: names #18212.
  • Replaces: "nothing", with the reason that the two lists were decoded but not shown.
  • No door: the terminal side is an edit to src/tui/screens/game_spark_view.ts and the how-to an edit to docs/features/game-spark.md. The gate asks for new files, but both were already changed in this pull, so I used the escape line.
  • Looks: I named /games/net/spark/<key>. The gate says that isn't a page in app.looks, so it still leaves the look to the reviewer; I left it as is.
  • Remaining notes: a comment over 100 columns in test/tui-games.test.ts, which the nightly rewrap handles, and a similarity hint between my test helper keep and a helper in another test file. Neither blocks.
commented

<!-- look-pages de75fa8868b5 --> Look pages for de75fa8, from the gate:

  • look pages (none): "Looks: /games/net/spark/<key>" is not a page of app.looks in forge.json; this pull changes src/web/pages/games_spark_ticks.ts, src/web/pages/games_spark_view.ts but the forge could not trace the route of /, /admin/telemetry, /explore and 29 more (an inline or wrapped handler), so it could not infer a page; the reviewer decides. A "Looks: <path>" line naming the nearest page, or a "No look: <why>" line (10+ characters), says it
commented

The spark page now shows the slowest ticks and the time per mod, from the decoded profile, and the terminal screen shows the same two lists. This push changes no code, only adds a commit message that answers the look-pages feedback.

  • Look pages: the Looks: /games/net/spark/<key> line was refused because that path isn't in app.looks in forge.json. The page needs a kept profile key, so it can't be a fixed look path. The new commit says No look: with that reason, and the gate no longer flags the look rule. It still carries the Direction: line naming #18212 and a No door: line.
  • Other rules you listed: both doors, the dead-code check, the duplicate-import check and name-the-issue show ok in a local bun scripts/gate.ts --explain run. I did not run tsc or any tests this time, since nothing in the code changed.
  • Left alone: the gate notes keep in test/games-spark-view.test.ts as similar to a helper in test/talk-checkin-story.test.ts. That test helper is specific to the spark view, so I did not merge them. It is a note, not a failure.

How to try it: open /games/<box>/spark/<key> from a box's profiles and read "Slowest ticks" and "Time per mod" below the call tree.

[{"go":"/games/net/spark/<key> (open a kept profile from the box's profiles)","look":"Below the call tree: Slowest ticks, then Time per mod","expect":"Each list has rows with ms values and percentages; mod names are escaped"}]

🤖 Generated with Claude Code

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs