Skip to content

Embed: hide the time readout everywhere and the overview in small frames - #422

Merged
neuromechanist merged 5 commits into
stagingfrom
feature/issue-421-embed-readout
Oct 5, 2026
Merged

neuromechanist merged 5 commits into
stagingfrom
feature/issue-421-embed-readout

Conversation

@neuromechanist

@neuromechanist neuromechanist commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #421. Part of #410: feedback on the 360 x 480 preview asked for the overview strip to go too.

Changes

  1. The time readout is hidden at every frame size (0df1bb7). Embed: two-row toolbar in narrow frames #420 hid it only at 560 px or less. Above that, the readout's width followed the data: "0.0–10.0 s" is 10 characters, "2330.0–2338.0 s" is 15, and clock mode is 17. A long readout could wrap the toolbar onto another row mid-session and shrink the fitted plot by about 44 px. The time axis already labels the window, and the readout stays in the accessibility tree. The rule moves out of the @media (max-width: 560px) block unchanged.
  2. The overview strip is hidden at 560 px or less (b0f1a40). This is the recording-wide event map under the scrubber. At that width its event ticks blur together, and the scrubber still moves through the whole recording. The rule needs !important because viewer.ts sets the strip's display inline once the overview loads. Every render redraws the strip, so a frame widened past 560 px gets it back at its new width.

The dataset page is unchanged; every rule is under .embed__viewer. The shared viewer only has a comment updated.

Measurements

on007753, ?view=sub-05_task-BCCWJreading, against bun run dev.

The toolbar height was measured three ways: with the readout's real text, with "2330.0–2338.0 s", and with "12:00:00–12:00:10" injected.

Width Chromium toolbar (real / long / clock) WebKit toolbar (real / long / clock)
360 67 / 67 / 67 65 / 65 / 65
560 67 / 67 / 67 66 / 66 / 66
640 44 / 44 / 44 43 / 43 / 43
700 44 / 44 / 44 43 / 43 / 43
760 44 / 44 / 44 43 / 43 / 43
800 44 / 44 / 44 43 / 43 / 43
1200 44 / 44 / 44 43 / 43 / 43

With the readout visible, the #421 review measured 760 px going from 44 to 88 px with the long text, and 700 px from 88 to 98. From 640 to 760 px the toolbar is now one row, where it was two before.

Overview strip and plot height:

Frame Overview strip Plot, Chromium Plot, WebKit Document scroll
360 x 480 hidden 273 px (223 after #420, 182 before) 280 px 0
480 x 480 hidden 273 px 280 px 0
560 x 480 hidden 299 px 305 px 0
561 x 480 shown, 545 px 192 px 199 px 0
800 x 560 shown, 784 px 352 px 358 px 0
360 resized to 800 shown, 784 px bitmap (redrawn) 352 px 358 px 0

Tests

  • bun run lint, bun run typecheck (0 errors), bun run test (2989 passed)
  • The width sweeps above, in Chromium and WebKit

Review (1 reviewer) and fixes, 64f4ac0 and 9229673

  • Important: the channel readout made a fitted plot flip between two heights. This predates the PR. With Hide bad on, render cleared the " · N hidden" count before the read and appended it after. In a fitted viewer each wrap of the toolbar moved the fit and started another render. The reviewer measured up to 20 renders per page step in Chromium, and 195 height flips with a 34 px scrollbar in both engines (Chromium on 18 to 37 frames, WebKit on 130). 64f4ac0 computes the count from the channels in view and writes the readout once, before the read. Re-running the reviewer's reproduction (5 bad channels, Hide bad, six page steps at 360 x 480): one render per step, 0 height flips and 0 px document scroll, in Chromium and WebKit. The readout reads "all 64 · 5 hidden". This is a shared-viewer change, so the dataset page gets it too; there it only stops the count from blinking.
  • "Overview incomplete" showed with no overview on screen. The note and the status suffix now say "Some zoom levels failed to load. Reload to try again." and " · zoom levels incomplete".
  • The strip also carries annotation ticks and the preload progress bar. Losing them at 560 px or less is now stated in the comment and the CHANGELOG. Annotations stay on the plot and in their panel.
  • The small-frame lead comment was untrue. It now lists the overview strip.
  • "Grows past 1000 s" was imprecise. The text grows from the second window: 10 characters at 0 s, 11 from 10 s, 15 past 1000 s, and 17 in clock mode. The comment and CHANGELOG now say so.
  • The !important was avoidable. viewer.ts now sets the strip's inline display to "", not "block", once it loads. The stylesheet's display: block applies, and the embed's rule (specificity 0,2,0) beats it with no !important. The dataset page's overview still shows (computed block, 1110 px wide).
  • Below threshold: "up from about 180" compared against a build that never shipped. Dropped.

The channel readout still changes width when the reader zooms the channels past channel 100 or hides bad channels. That is a reader action, and it settles in one refit. The comment says so, and the readout stays because nothing else shows which channels are in view.

Re-review of the fixes (same reviewer): clean

  • The oscillation is gone. At 360, 368, 600 and 660 px in Chromium, and at 360, 368 and 660 px in WebKit, every page step is one render, with 0 height flips and 0 px of document scroll.
  • Variants checked:
    • Channel zoom with Hide bad on: the hidden counts per page sum to exactly the 5 marked channels.
    • Hide bad toggled three times during a read delayed by 500 ms: one render, and the readout and checkbox agree.
    • Zooming back out: back to "all 64 · 5 hidden" in one step.
  • n < visible.length cannot occur. win.channels is sliced from the same channelsByRow rows as visible (store.ts readLevel0 and readViewLevel).
  • display: "":
    • The strip is hidden before data loads and on a failed or empty overview.
    • It shows on the dataset page and in the enlarge dialog: computed block, 1110 px.
    • In the embed resized 360, 560, 561, 800 px it is none, none, block, block, and it is redrawn when the frame widens.
  • Two wording nits, fixed in the last commit. The channel readout changes on any reader action on the channels, and the pre-fix scrollbar showed in both engines.

The readout's width follows the data ("0.0–10.0 s" is 10 characters,
"2330.0–2338.0 s" 15, clock mode 17), so above 560 px a long one could
wrap the toolbar onto another row mid-session and shrink the fitted plot
by about 44 px. The time axis already labels the window, so the embed
now hides the readout at every width (still read by screen readers).
Fixes the invariant that no line of a fit viewer's chrome changes height
between renders.

Tested: Chromium and WebKit, 360 to 1200 px: toolbar height identical
with the real, a 15-character and a clock-mode readout; the toolbar is
one row from 640 px (two before).
At 560 px wide or less the recording-wide event map under the scrubber
is hidden; its ticks blur together at that width and the scrubber still
moves through the recording. It needs !important because viewer.ts sets
its display inline once the overview loads. Each render redraws it, so a
frame widened past 560 px gets it back at full width.

Tested: Chromium and WebKit; 360 x 480 plot 223 -> 273 px (WebKit 230 ->
280), no document scroll at 360 to 800 px, and resizing 360 -> 800 shows
the strip again with a 784 px bitmap.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

The Hide bad count (" · N hidden") was cleared when each render began
and appended after the window read landed. In a fitHeight viewer that
flip could wrap and unwrap the toolbar every render, and each wrap moved
the fit and started another render: at 360 x 480 the review of #422
measured up to 20 renders per page step in Chromium, and 195 height
flips with a 34 px scrollbar on 130 of 1105 frames in WebKit. The count
now comes from the montage rows in view and is written once, before the
read, with the same all-bad guard as reject mode.

Tested: the review's reproduction (5 bad channels, Hide bad, six page
steps at 360 x 480): one render per step, no height flips, no document
scroll, in Chromium and WebKit; the readout reads "all 64 · 5 hidden".
From the review of #422:
- viewer.ts sets the overview strip's inline display to "" rather than
  "block" once it loads, handing display back to the stylesheet, so the
  embed hides it in small frames with an ordinary rule.
- The degraded-pyramid note and status suffix name the zoom levels
  ("Some zoom levels failed to load"), not an overview that small
  frames no longer show.
- Comments: the readout grows with the window's start, not only past
  1000 s; the channel readout stays and why; the small-frame lead now
  lists the overview strip; the strip's annotation ticks and preload bar
  go with it. CHANGELOG lines match.

Tested: lint, typecheck, 2989 unit tests; overview hidden at 560 px or
less and back at its new width on resize, in Chromium and WebKit; the
dataset page's overview still shows (display block, 1110 px).
The channel readout changes on any reader action on the channels, not
only zoom and Hide bad; the pre-fix scrollbar showed in both engines.
@neuromechanist
neuromechanist merged commit d49e827 into staging Oct 5, 2026
5 checks passed
@neuromechanist
neuromechanist deleted the feature/issue-421-embed-readout branch October 5, 2026 15:59
neuromechanist added a commit that referenced this pull request Oct 5, 2026
Cuts [Unreleased] into 0.2.28 (2026-10-05). Adds the missing entries
for #407 (queue lists nothing), #408 (web approval by dispatch) and #409
(50-row pages), and moves #422's Fixed entry, which had landed under
0.2.27, into 0.2.28.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant