Skip to content

fix(tui): show an honest empty state when /plan opens before attach - #37

Merged
jkyberneees merged 1 commit into
mainfrom
fix/plan-loading-before-attach
Aug 27, 2026
Merged

fix(tui): show an honest empty state when /plan opens before attach#37
jkyberneees merged 1 commit into
mainfrom
fix/plan-loading-before-attach

Conversation

@jkyberneees

Copy link
Copy Markdown
Contributor

Problem

Opening /plan (slash command or drawer tab) with no live session rendered loading plan… permanently. openPlan() rendered the placeholder, then fetchPlan() silently returned nil — no request, no error, no poll, no retry. The copy could never resolve.

Fix

syncPlanPanelMsg gains a leading not-attached case that states why the tab is empty:

no active session yet — the plan loads when a run starts

Once a run attaches, the existing reset + refetch-at-tail path resolves the tab to a real snapshot.

Testing

  • New regression test TestPlanTab_UnattachedOpenerNeverShowsEternalLoading — red first (reproduced the exact stuck copy), green after the fix.
  • make fmt / make vet / make lint (0 issues) / make test (race suite) all pass.

Opening the plan tab with no live session (no client / no session id)
rendered "loading plan…" forever: fetchPlan was a silent no-op, so no
reply ever resolved the placeholder and nothing retried it.

syncPlanPanelMsg now reports the not-attached state explicitly; the
existing reset + refetch-at-tail on attach resolves the tab to a real
snapshot.
@jkyberneees
jkyberneees merged commit aa60873 into main Aug 27, 2026
5 checks passed
@jkyberneees
jkyberneees deleted the fix/plan-loading-before-attach branch August 27, 2026 17:10
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