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

Observability 6: a Grafana-like view bar on top - time range, compare, variables - and a grid that fills #16865

Merged opened this in answer to

Check · Review · Land · Live done — Landed and live in production.

Merged

A board now has a view bar at the top with a time range (1h, 6h, 24h, 7d, 30d, All) and Live / Paused. The issue also asks for compare, variables and a custom range; those are not built, so #3695 stays open for them.

Notes

opened this

A board now has a view bar at the top with a time range (1h, 6h, 24h, 7d, 30d, All) and Live / Paused. The issue also asks for compare, variables and a custom range; those are not built, so #3695 stays open for them. Tests covering the change pass (store, stream, grid style, schema, windows), tsc is clean and design-lint is clean. I did not run the full suite or try it on the preview.

What changed

  • View bar: each choice is a link to the same board with ?range= or ?live= in the address, so a view is shared by link and nothing is saved. "Back to the saved view" shows once either is set. The saved range and refresh stay in the "Board" fold at the bottom, and the board's file does not change; a test checks this. The bar is src/boards/view_bar.ts, drawn by viewBar in src/web/pages/boards-view.ts.
  • Range reaches the panels: a new range in the address re-reads every panel once over that range. Live (the stream) takes the same ?range=.
  • 6h: I added it to the saved ranges, so it is also a valid choice for a board's own range.
  • Row actions: Pin to home, Up and Down are always visible on a board page (.bd .row-actions in src/web/style/components.ts).
  • Reused: the existing seg() control, and the live hub's per-board sharing, which already keys on the board.

What I did not do

  • Compare to previous, custom range, and variables (repo/app/crew member): none are built. The docs say so.
  • 12-column grid: I left the grid alone. The board grid already fills its row (flex, panels grow into what is left), so the three-column gap in the issue is no longer there.
  • Terminal: no new terminal door. The terminal edits the saved range, which now lists 6h, so the commit says No door: with that reason.
  • Design doc and how-to: the new .vbar class is in docs/design/areas/boards.md, and the how-to is added to docs/features/boards-live.md.

How to try it: on the preview, open /boards/maintenance?range=1h&live=0 (the commit's Try: line). The range follows the address, the stream is off, and "Back to the saved view" returns to the board as saved.

[
  {"go": "/boards/maintenance?range=1h&live=0", "look": "the bar above the grid: 1h is current, Paused is current, a 'Back to the saved view' link", "expect": "panels read over the last hour; no live stream"},
  {"go": "/boards/maintenance", "look": "the Board fold at the bottom", "expect": "the saved range and refresh are unchanged"},
  {"go": "/boards/maintenance", "look": "Pin to home, Up, Down under 'Panels'", "expect": "visible without hovering"}
]

🤖 Generated with Claude Code

Closes #3695

7 earlier comments
commented

A board now has a view bar at the top with a time range (1h, 6h, 24h, 7d, 30d, All) and Live / Paused. The issue also asks for compare, variables and a custom range; those are not built, so #3695 stays open for them. Tests covering the change pass (store, stream, grid style, schema, windows), tsc is clean and design-lint is clean. I did not run the full suite or try it on the preview.

What changed

  • View bar: each choice is a link to the same board with ?range= or ?live= in the address, so a view is shared by link and nothing is saved. "Back to the saved view" shows once either is set. The saved range and refresh stay in the "Board" fold at the bottom, and the board's file does not change; a test checks this. The bar is src/boards/view_bar.ts, drawn by viewBar in src/web/pages/boards-view.ts.
  • Range reaches the panels: a new range in the address re-reads every panel once over that range. Live (the stream) takes the same ?range=.
  • 6h: I added it to the saved ranges, so it is also a valid choice for a board's own range.
  • Row actions: Pin to home, Up and Down are always visible on a board page (.bd .row-actions in src/web/style/components.ts).
  • Reused: the existing seg() control, and the live hub's per-board sharing, which already keys on the board.

What I did not do

  • Compare to previous, custom range, and variables (repo/app/crew member): none are built. The docs say so.
  • 12-column grid: I left the grid alone. The board grid already fills its row (flex, panels grow into what is left), so the three-column gap in the issue is no longer there.
  • Terminal: no new terminal door. The terminal edits the saved range, which now lists 6h, so the commit says No door: with that reason.
  • Design doc and how-to: the new .vbar class is in docs/design/areas/boards.md, and the how-to is added to docs/features/boards-live.md.

How to try it: on the preview, open /boards/maintenance?range=1h&live=0 (the commit's Try: line). The range follows the address, the stream is off, and "Back to the saved view" returns to the board as saved.

[
  {"go": "/boards/maintenance?range=1h&live=0", "look": "the bar above the grid: 1h is current, Paused is current, a 'Back to the saved view' link", "expect": "panels read over the last hour; no live stream"},
  {"go": "/boards/maintenance", "look": "the Board fold at the bottom", "expect": "the saved range and refresh are unchanged"},
  {"go": "/boards/maintenance", "look": "Pin to home, Up, Down under 'Panels'", "expect": "visible without hovering"}
]

🤖 Generated with Claude Code

commented

<!-- look-pages f2f3902d851a --> Look pages for f2f3902, from the gate:

  • look pages (named): this pull changes src/web/pages/boards-stream.ts, src/web/pages/boards-view.ts, src/web/style/components.ts; a commit names /boards?help
commented

Nothing to change on this pull. The "look pages" comment is the gate's note that it will take before/after looks of /boards?help. It is not a failure.

The gate rule needs a commit line Looks: <path> naming a page in app.looks. The commit f2f3902d8 already has Looks: /boards?help. /boards?help is listed in both looks and looksAsOwner in forge.json. bun scripts/gate.ts --explain reports the rule as NOTE, and the rest of the gate's rules it printed are ok. I made no changes and pushed nothing.

/boards?help is the page that shows the view bar, so it is the right one to look at. The look also covers the same pull's changes to src/web/pages/boards-stream.ts, src/web/pages/boards-view.ts and src/web/style/components.ts.

I did not run bun test, tsc or the design lint, because no code changed.

commented

This pull is a partial slice of #3695: a view bar on the board page and a matching view in the terminal. Compare to previous, variables, custom ranges and the fill-the-grid layout are not built, so the issue stays open.

What it does

  • Web bar: the board page has a bar for time range (1h, 6h, 24h, 7d, 30d, All) and Live/Paused. Each choice is a link carrying ?range= or ?live=. Nothing is saved, and "Back to the saved view" drops it.
  • 6h: this pull adds 6h to the ranges the board's file accepts, so g on the terminal's board list and the board's saved settings take it too.

What changed after the review

  • Terminal door: the board screen in src/tui/screens/boards.ts has two keys. v steps the range and l flips live and paused. The panels are read over the view, and the live watch restarts to follow it. The header says "a view, not saved", and the board's file is untouched. g still edits the saved range. The No door: line is gone. docs/features/boards-live.md now describes these keys instead of claiming the terminal "offers 6h".
  • Live on a board saved as off: the stream address now carries live along with range, so the stream gets the same view as the page. A test opens ?live=1 on a board saved with refresh off. It checks that the page names /stream?live=1, then that the stream sends hello and a panels frame after an event. viewed still turns refresh off into 10s for ?live=1.
  • Cleanup: viewHref takes extra query pairs. The "Reading…" address in boardShow is built once with viewHref(…, view, { wait: "1" }). A new nextRange lives in view_bar.ts. The second import type from ../boards/store.ts in src/flow/pages.ts is merged into the Stored import.
  • Tests: test/boards-view-bar.test.ts covers four things.
    • A run three hours old is outside 1h and inside 6h, so RANGE_MS has 6h.
    • boardPicture keeps 1h and 6h as separate cache entries.
    • The wait address is one query.
    • The terminal's v and l leave the saved file at 7d and off.
  • Existing test: test/boards-store.test.ts expected stream?range=7d. It now expects stream?range=7d&live=1, because the stream address carries live too.

What I did not do

  • 360px phone wrap: I did not change the CSS and have not seen the bar render. .seg already wraps and scrolls inside its own width, and its padding shrinks under 420px. The 44px height on .seg items is set by the existing coarse-pointer rule in components.ts. /boards?help answers 303 to a sign-in for non-admin tokens, so I could not look at it myself.
  • Checks: tsc is clean, the design lint is clean, and the board, stream and terminal tests pass. I ran only the tests that cover this change, not the whole suite.

Try it:

  • Open /boards/<slug>?range=6h&live=1 on the preview.
  • Open the board in the terminal and press v and l.
commented

<!-- look-pages 43e20ed5afce --> Look pages for 43e20ed, from the gate:

  • look pages (named): this pull changes src/web/pages/boards-stream.ts, src/web/pages/boards-view.ts, src/web/style/components.ts; a commit names /boards?help
commented

This pull adds a Grafana-like view bar to boards. The view is a link, never a saved setting. The check's one failure caused by this pull is fixed; the other three I could not trace to it.

What changed

  • The view bar sits at the top of a board, with a time range and a live switch. The range and live state live in the address, so a view can be shared and nothing is saved.
  • A live view of a board saved as off feeds its own stream.
  • In the terminal, v cycles the range and l toggles live. Neither changes the board's file.
  • The wait address is one query, with the view first.

The fix in this push test/flake.test.ts refused test/boards-view-bar.test.ts because its stream-reading loop ran out of time and carried on to stop.abort(). The verdict, expect(text).toContain("event: panels"), now comes straight after the loop, as the flake rule requires. test/boards-view-bar.test.ts and test/flake.test.ts pass together locally, and tsc is clean.

Not fixed

  • test/page-budget.test.ts (first pages under their median warm): it still fails locally, on the pull page's median. That page is not one this pull touches, and the check log says the test is flaky on main (green, then red on the second run). I did not change it.
  • test/fork-follow-history.test.ts and test/spawn-reach-door.test.ts (the last-ten-follows and the 25 s wait): these passed locally when run alone. I take them to be load flakes, not this pull's.
  • Long comment lines: bun scripts/gate.ts --fix reported five files with comment lines over 100 columns and said the nightly rewrap handles them on main, so I left them.

Try it Open /boards/<slug>?range=6h&live=1. The bar shows the view, and a live view streams even when the board is saved as off.

commented

<!-- look-pages 5f67918aa59d --> Look pages for 5f67918, from the gate:

  • look pages (named): this pull changes src/web/pages/boards-stream.ts, src/web/pages/boards-view.ts, src/web/style/components.ts; a commit names /boards?help
commented

I changed nothing for this feedback, and nothing is pushed. The comment is the gate's own note, not a request.

bun scripts/gate.ts --explain lists the look-pages rule as a NOTE, not a failure. The rule asks for a commit line Looks: <path> naming a page of app.looks in forge.json, or No look: <why>. My earlier commits already carry Looks: /boards?help, and the gate's output says "a commit names /boards?help".

Sign in to join this conversation.

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

Keyboard shortcuts

Docs