Skip to content

feat(pulse): add timeline annotations and event markers with sliding cards - #1

Merged
ingvarch merged 1 commit into
mainfrom
feat/timeline-events
Oct 1, 2026
Merged

ingvarch merged 1 commit into
mainfrom
feat/timeline-events

Conversation

@ingvarch

@ingvarch ingvarch commented Oct 1, 2026

Copy link
Copy Markdown
Owner

Description

Brings Timeline Annotations & Event Markers to Pulse, introducing a core capability inspired by cloud observability platforms (Grafana, Datadog) to terminal charts.

When monitoring metrics (CPU, latency, memory), raw spikes don't explain why something happened. This feature allows operators and developers to pin discrete engineering events (deployments, alerts, pod restarts, config changes) onto the time-series grid.

Key Changes

  • Core Types & APIs:
    • Added Event struct (ID, Label, Glyph, Style, NoLine) and VisibleEvent (Col, Age, Event).
    • Added chart.AddEvent(ev) (pins at now), chart.AddEventAt(offset, ev) (pins at historical step), chart.VisibleEvents(), and chart. ClearEvents().
    • Added constructor option pulse.WithEvent(offset, ev).
    • Sliding Window Lifecycle & Memory Safety:
    • Tracks discrete steps synchronized with Push / PushSeries.
    • Dynamically calculates event age: age = current_step - event_step. Events scroll smoothly to the left as new data points arrive.
    • Automatically prunes events that scroll off the left edge (col < 0) to prevent memory leaks during long-running streaming sessions.
  • Rendering Engine Integration:
    • Anchors marker glyphs (▼, 🚀, ⚡, ⚠️) at row 0.
    • Draws vertical dashed guidelines (┆) through empty space and shaded/tinted area fills without corrupting box-drawing line turns (╭, ╯, ─).
    • Handles multi-width Unicode runes and emojis (lipgloss.Width(glyph) > 1) in the terminal grid to prevent column drift.
    • Seamlessly supported across both ModeLines and ModeBraille.
  • Companion UI:
    • Added chart.EventsBox() helper that returns a Lip Gloss bordered card listing active events with relative age tags ((now), (-14)).
  • Interactive Demo & Documentation:
    • Updated examples/livedemo with interactive key e to drop live deployment markers in real time.
    • Created comprehensive guide in docs/timeline-events.md covering best practices, glyph selection, and code snippets.
    • Updated README.md features and documentation index.

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 ./...).
  • I have updated any relevant documentation.

…cards

    - Add Event and VisibleEvent types with WithEvent, AddEvent, and AddEventAt APIs
    - Render marker glyphs (▼, 🚀, ⚡) and vertical guidelines (┆) across Lines and Braille modes
    - Implement dynamic age tracking and automatic garbage collection for off-screen events
    - Add EventsBox() helper for Lip Gloss cards with relative age tags (now, -12)
    - Handle multi-width runes and emojis in grid without column drift
    - Add interactive event injection hotkey ('e') to livedemo
    - Add comprehensive documentation in docs/timeline-events.md
    - Add unit tests covering sliding window aging, memory pruning, and rendering
@ingvarch
ingvarch merged commit d10cf0e into main Oct 1, 2026
2 checks passed
@ingvarch
ingvarch deleted the feat/timeline-events branch October 1, 2026 11:32
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