Skip to content

feat(tui): live-refreshing kanban and dashboard - #8

Merged
mrn-dk merged 2 commits into
mainfrom
feat/live-kanban
Aug 2, 2026
Merged

mrn-dk merged 2 commits into
mainfrom
feat/live-kanban

Conversation

@mrn-dk

@mrn-dk mrn-dk commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Implements OpenSpec change add-live-kanban.

What

The kanban and dashboard now reflect external changes (an agent editing tasks.md in another window, or any editor) within ~1s, with no keypress. The TUI stays a pure viewer — it observes work happening elsewhere, it doesn't orchestrate it.

How

  • Cheap mtime-gated polling (OpenSpecClient.has_changed()): a 1s set_interval tick stats the changes/specs dirs + each tasks.md/spec.md. Only when an mtime actually moved does it shell out to openspec list. Idle ticks cost a handful of stat calls — no subprocess.
  • Live/paused state on the app (ephemeral, not persisted — thin-client invariant preserved): p toggles; the title shows ● live / ○ paused.
  • Race safety: polling skips when the screen isn't top, when a modal is open, or during a suspended $EDITOR session (_in_editor flag in try/finally around app.suspend()). Manual r always forces a reload and re-baselines the cache.

Verification

All interactive paths exercised via Textual's run_test() harness (in tasks.md):

  • external tasks.md edit → _tick reloads (kanban + dashboard)
  • p flips live/paused + glyph; ticks stop when paused
  • r forced reload works in both states
  • command-palette modal open → dashboard tick skips probing (the self is not self.app.screen guard)
  • foreground_busy() True during editor, False after

openspec validate add-live-kanban passes. Task 6.7 is this PR.

Non-goals (deliberate, per design)

  • No agent spawning/orchestration — the TUI only observes. (Explored and deferred.)
  • No live-refresh on the detail/artifact view (re-reads on entry/r; racing the in-app editor isn't worth it yet).
  • No inotify/watchman — polling is portable and sufficient.

OpenSpec change: add-live-kanban

Morten R. N. added 2 commits August 2, 2026 21:11
The kanban and dashboard now poll for external changes on a 1s timer gated
by a cheap mtime probe, so an agent (or an editor in another window) editing
tasks.md is reflected in the TUI within ~1s with no keypress.

- client: OpenSpecClient.has_changed() (stat-only mtime snapshot of the
  changes/specs dirs + each tasks.md/spec.md) gates the expensive
  openspec list shell-out; reset_change_cache() re-baselines after a
  forced refresh; root() is now cached so the probe never shells out
- app: ephemeral live_refresh flag + _in_editor foreground-busy flag +
  toggle_live_refresh() + live_label glyph (● live / ○ paused); not
  persisted (thin-client invariant preserved)
- kanban/dashboard: set_interval(1.0, _tick) on mount; _tick skips when
  paused, not the top screen, or foreground-busy; title shows the glyph;
  'p' toggles live, 'r' forces reload (always works)
- detail: _in_editor flag wrapped in try/finally around app.suspend() so
  polling never races a half-saved file during

Verified via Textual run_test(): external edit -> reload; p toggles
live/paused + glyph; r forces reload; modal open -> tick skips; editor
flag suppresses polling. openspec validate add-live-kanban passes.

Implements tasks 1.1-6.6 of the add-live-kanban change.
@mrn-dk
mrn-dk merged commit 3cc071c into main Aug 2, 2026
1 check passed
@mrn-dk
mrn-dk deleted the feat/live-kanban branch August 3, 2026 10:17
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