Skip to content

fix(timeline): keep short segments and read their length to one sample - #67

Merged
HalfSweet merged 3 commits into
mainfrom
fix/short-segments
Oct 26, 2026
Merged

HalfSweet merged 3 commits into
mainfrom
fix/short-segments

Conversation

@HalfSweet

Copy link
Copy Markdown
Owner

A drag along the ruler was taken for a click, and its segment dropped, whenever it covered less than 2 µs. Zoomed in to a few hundred nanoseconds per division the whole view is shorter than that, so no segment could be marked at all; short spans such as a fast SPI transfer, or a rise on an analog channel (where the edge measurement does not apply), could not be measured, listed in the data stream or exported.

  • Tell a click from a drag on the ruler by how far the pointer moves, 3 px as on the tracks, and keep any segment that covers at least one sample. The segment changes only once the pointer has moved past those 3 px, so a click no longer flashes empty A and B flags.
  • Read the segment's length on the ruler and in the status bar the way the edge measurement's Δt reads, exact to one sample with at most three decimals: one sample at 400 MHz now reads 2.5 ns rather than 3 ns, and 2.61 µs at 100 MHz no longer rounds to 2.6 µs. Lengths of a millisecond or more now show three decimals instead of four, as Δt does.
  • Update DESIGN.md §6.6 and the user guide.

Not changed: the segment's start and end times in the status bar's edge table (four decimals of ms) and in the data stream's segment summary (three) keep their fixed precision, so the two ends of a very short segment can read the same there.

Validation:

  • pnpm exec eslint src
  • pnpm typecheck
  • pnpm test: 573 tests passed, including the new TimelineRuler.test.ts and SegmentMeasure.test.ts, which fail on the previous code (a 500 ns drag at 100 MHz is dropped; one sample at 400 MHz reads 3 ns)
  • Not checked by hand in the running app

A drag along the ruler was taken for a click, and its segment
dropped, whenever it covered less than 2 µs. Zoomed in to a few
hundred nanoseconds per division the whole view is shorter than that,
so no segment could be marked at all, and short spans such as a fast
SPI transfer or an analog rise could never be measured or listed.

Tell a click from a drag by how far the pointer moves, 3 px as on the
tracks, and keep any segment that covers at least one sample. The
segment now changes only once the pointer has left the press, so a
click no longer flashes empty A and B flags.
The segment's length on the ruler and in the status bar was rounded to
whole nanoseconds below a microsecond and to 0.1 µs below a
millisecond, so short segments read wrong: one sample at 400 MHz
showed as 3 ns rather than 2.5 ns, and 2.61 µs at 100 MHz as 2.6 µs.

Format it as the edge measurement's Δt is formatted, with the digits
one sample needs (at most three), so both readouts agree. Event
lengths in the data stream keep their own format.
DESIGN.md §6.6 now tells a click from a drag on the ruler by 3 px, as
on the tracks, instead of by 2 µs, and reads the segment's duration
like the edge measurement, exact to one sample. The user guide says a
segment can be as short as one sample.
@HalfSweet
HalfSweet merged commit 6112411 into main Oct 26, 2026
3 checks passed
@github-actions github-actions Bot mentioned this pull request Oct 26, 2026
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