Skip to content

RichLog widget for append-only log panes#86

Merged
meszmate merged 1 commit intomainfrom
feature/rich-log
Apr 23, 2026
Merged

RichLog widget for append-only log panes#86
meszmate merged 1 commit intomainfrom
feature/rich-log

Conversation

@meszmate
Copy link
Copy Markdown
Owner

Summary

Adds RichLog, a virtualized log widget for long-running apps that need a persistent log/audit pane (think k9s events, build output, server logs).

Features

  • Bounded ring buffer — oldest entries drop on overflow
  • Per-entry severity (trace/debug/info/warn/err) with default color theme
  • Timestamps (HH:MM:SS) — opt-in via `show_timestamps`
  • Renders only the visible window — O(rows) regardless of buffer size
  • Follow-mode (auto-scroll to tail) toggled off when user scrolls back
  • `setMinLevel` filters out entries below a threshold
  • `setSearch` filters and highlights matching substrings
  • Standard scroll keybindings: arrow keys, page up/down, home/end, j/k/g/G

Why a new widget

Distinct from existing components:

  • Viewport — raw text, no structure or filtering
  • Toast — transient notifications, not persistent
  • Markdown / CodeView — content viewers, not append targets

Test plan

  • `zig build test` — added 6 tests covering capacity ring, level filter, search filter, follow-mode auto-scroll, scrollUp disabling follow, and view height bound

Bounded ring buffer with per-entry severity (trace/debug/info/warn/err)
and timestamps. Renders only the visible window (O(rows) regardless of
buffer size) with per-level color, follow-mode auto-scroll, level
filtering, and substring search highlighting. Distinct from Viewport
(raw text) and Toast (transient notifications): the right widget for a
long-running app's persistent log/audit pane.
@meszmate meszmate merged commit 0fe1247 into main Apr 23, 2026
9 checks passed
@meszmate meszmate deleted the feature/rich-log branch April 24, 2026 13:38
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