Skip to content

feat(pulse): add a value cursor and history scrolling - #40

Merged
ingvarch merged 1 commit into
mainfrom
feat/cursor-scroll
Nov 9, 2026
Merged

ingvarch merged 1 commit into
mainfrom
feat/cursor-scroll

Conversation

@ingvarch

@ingvarch ingvarch commented Nov 9, 2026

Copy link
Copy Markdown
Owner

Description

Adds a value cursor and history scrolling, so you can step back through a live chart and read exact values.

  • SetCursor(age) / Cursor() show a vertical cursor at a point age steps before the newest one; -1 hides it.
  • SetOffset(n) / Offset() scroll the view n points back into the history. The offset is clamped so the oldest point can reach the left edge and no further. While the view is scrolled, each new sample moves the offset and the cursor by one, so the view stays on the same points.
  • CursorValues() returns the value of each series at the cursor; CursorBox() renders them as a card in the style of LegendBox, with the X axis label at the cursor.
  • Events, event guidelines and X axis labels follow the offset. One age-to-column mapping is shared by the cursor, events and the X axis.
  • The cursor is drawn like event guidelines, inside both renderers, in front of the fill in lines mode.
  • The live demo binds Left/Right to the cursor and [/] to scrolling; Esc resets both and no longer quits (q and Ctrl+C quit).
  • New guide docs/cursor-and-scrolling.md and screenshot assets/cursor.png; the Bubble Tea, getting started, axes, thresholds and timeline guides link to it.

Behavior change users can see: the time step now advances once per sample, on a push to the default series, or to the first named series while the default has none. Before, a chart that pushed both the default and a named series moved its events two columns per sample. An app that pushes the default series once and then only named series no longer advances the step.

Left for later: custom renderers get no documented way to draw the cursor (RenderContext.CursorCol is there, but no helper).

Issues

Closes #11

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement / Refactoring

Checklist

  • I have read the CONTRIBUTING.md guide.
  • My code adheres to the project's code style and conventions (gofmt, go vet).
  • I have added tests that prove my fix is effective or that my feature works.
  • All existing and new tests pass (go test -race ./...) and everything builds (go build ./... and go -C examples build ./...).
  • I have updated any relevant documentation.

SetCursor and SetOffset move a vertical cursor and scroll the view back
through the history. CursorValues and CursorBox show the values under the
cursor. Events and X axis labels follow the offset.

The time step now advances once per sample: on a push to the default
series, or to the first named series while the default has none. Before,
a chart that pushed both moved its events two columns per sample.

Closes #11
@ingvarch ingvarch added the enhancement New feature or request label Nov 9, 2026
@ingvarch
ingvarch merged commit e15f184 into main Nov 9, 2026
2 checks passed
@ingvarch
ingvarch deleted the feat/cursor-scroll branch November 9, 2026 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: value inspector cursor and history scrolling

1 participant