Skip to content

Fix TUI repair and navigation smoke regressions#262

Merged
TraderSamwise merged 3 commits into
masterfrom
chore/tui-smoke-next-6
Jun 28, 2026
Merged

Fix TUI repair and navigation smoke regressions#262
TraderSamwise merged 3 commits into
masterfrom
chore/tui-smoke-next-6

Conversation

@TraderSamwise

@TraderSamwise TraderSamwise commented Jun 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • preserve daemon project-service records so repair can rediscover projects after crashes
  • include tmux-backed projects with missing dashboards in global restart
  • make dashboard reload/repair launch source-aware so smoke repairs do not fall back to the stable shim
  • restore lowercase l navigation and move Library shortcuts to uppercase L

Verification

  • yarn vitest --run (154 files, 2024 tests)
  • yarn typecheck
  • yarn lint
  • yarn build
  • isolated forced build-stamp drift smoke: source-run daemon/service/dashboard repaired with source command, then doctor versions passed

Summary by CodeRabbit

  • New Features

    • Dashboard navigation now supports l as an alias for opening/entering sections, and the help/footer hints reflect the updated shortcuts.
    • Library access is now shown as L in shortcut guidance.
  • Bug Fixes

    • Improved dashboard restart and recovery behavior so projects with inactive services can be rediscovered and repaired.
    • Fixed runtime recovery to recreate missing dashboard sessions during global restarts.
    • Updated key handling so navigation shortcuts behave more consistently across screens.

@vercel

vercel Bot commented Jun 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
app Ready Ready Preview, Comment Jun 28, 2026 1:10pm

@coderabbitai

coderabbitai Bot commented Jun 28, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@TraderSamwise, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 21 minutes and 27 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c419ce48-a177-4294-bb6f-6f0e97da7f43

📥 Commits

Reviewing files that changed from the base of the PR and between f3b4b7a and fd6ba9b.

📒 Files selected for processing (8)
  • src/daemon.test.ts
  • src/daemon.ts
  • src/dashboard/command-spec.test.ts
  • src/dashboard/command-spec.ts
  • src/main.ts
  • src/multiplexer/dashboard-control.test.ts
  • src/multiplexer/dashboard-control.ts
  • src/multiplexer/runtime-guard.test.ts
📝 Walkthrough

Walkthrough

The PR remaps lowercase l from a library shortcut to a navigation step-in key (equivalent to Enter/→), with uppercase L (shifted) becoming the new library shortcut. Daemon state is changed to retain dead project entries instead of pruning them. Dashboard launch command construction switches to getAimuxCliLaunchCommand with stable-shim env scrubbing and stamp-specific env defaults. Runtime-guard repair now resolves a structured launch object, and runtime restart is extended to recreate missing dashboards for tmux-backed projects.

Changes

l/L Key Remapping: Navigation vs Library

Layer / File(s) Summary
isShiftedLetterCommand helper and dashboard navigation logic
src/key-parser.ts, src/multiplexer/dashboard-interaction.ts, src/multiplexer/navigation.ts
Adds isShiftedLetterCommand predicate. Updates isShiftedCommand to delegate to it, adds l as a plain navigation key, expands step-in switch cases to include l alongside enter/right in all navigation modes, removes lshowLibrary from the main handler, and requires shifted l in the help screen for library.
Subscreen navigation key event forwarding
src/multiplexer/dashboard-control.ts, src/multiplexer/dashboard-actions-methods.ts, src/multiplexer/archives.ts, src/multiplexer/coordination.ts, src/multiplexer/library.ts, src/multiplexer/project.ts, src/multiplexer/topology.ts
Extends handleDashboardSubscreenNavigationKey to accept an optional KeyEvent, uses shifted-letter detection for the l subscreen hotkey, and propagates the event argument through all subscreen key handlers and the dashboard actions mixin.
TUI footer hints and help overlay text
src/tui/screens/dashboard-renderers.ts, src/tui/screens/overlay-renderers.ts, src/tui/screens/subscreen-renderers.ts
Updates dashboard footer hint strings from Enter/→ to Enter/→/l, changes screens-cycle key hint from l to L in all subscreen footers, and revises help overlay to reflect new bindings.
Key remapping tests
src/multiplexer/dashboard-interaction.test.ts, src/multiplexer/dashboard-control.test.ts, src/multiplexer/runtime-guard.test.ts, src/tui/screens/dashboard-renderers.test.ts
Inverts l-key assertions (now step-in, not library), updates subscreen navigation tests to use Buffer+parseKeys() with parsed event, and updates footer hint string expectations to Enter/→/l.

Daemon Dead-Service State Retention

Layer / File(s) Summary
Daemon state load, refresh, and exit handler
src/daemon.ts, src/daemon.test.ts
Removes isPidAlive filter from loadDaemonState, updates refreshState to retain all project entries (only conditionally refreshing updatedAt for live ones), and changes the exit handler to update updatedAt rather than delete the entry. Test now asserts both live and dead project keys are present.

Dashboard Launch Env and Build Stamp

Layer / File(s) Summary
dashboardEnvForLaunch, stamp defaults, and stamp command derivation
src/dashboard/command-spec.ts, src/dashboard/command-spec.test.ts
Replaces buildAimuxCliShellCommand with getAimuxCliLaunchCommand, adds DASHBOARD_ENV_STAMP_DEFAULTS, introduces dashboardEnvForLaunch to strip AIMUX_CLI_BIN/AIMUX_INSTALL_ROOT, computes a separate dashboardStampEntrypoint, derives stampCommand for build stamp calculation, and adds tests for env exclusion and stamp stability/change behavior.

Runtime Guard Repair Launch and Runtime Restart Tmux Projects

Layer / File(s) Summary
DashboardReloadLaunch, scrubStableShimEnv, and repair spawn
src/multiplexer/dashboard-control.ts
Adds scrubStableShimEnv, exports DashboardReloadLaunch interface and resolveDashboardReloadLaunch, updates startRuntimeGuardRepair to resolve the structured launch object and pass command/args/env to spawn.
Runtime restart includes tmux projects with no dashboards
src/runtime-restart.ts, src/runtime-restart.test.ts
Extends project-root filter to include projects with empty dashboards and "tmux" in sources. Adds test asserting missing tmux-backed dashboards are recreated with forceReload: true.
Guard repair and resolveDashboardReloadLaunch tests
src/multiplexer/dashboard-control.test.ts
Updates guarded-repair spawn test to assert process.execPath-based invocation with env filtering. Adds two resolveDashboardReloadLaunch tests for source-checkout vs installed-shim env handling. Updates refreshRuntimeGuard stale-manifest restart expectation.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • TraderSamwise/aimux#253: Modifies the same src/multiplexer/dashboard-interaction.ts code to change how l/Shift+l drive navigation vs showLibrary() behavior, directly overlapping with this PR's key remap.
  • TraderSamwise/aimux#255: Modifies src/dashboard/command-spec.ts's getDashboardCommandSpec env-prefix and allowlist handling, overlapping with this PR's dashboardEnvForLaunch and stamp default changes.
  • TraderSamwise/aimux#234: Modifies src/multiplexer/dashboard-control.ts's startRuntimeGuardRepair/handleRuntimeGuardKey behavior and related spawn/UI expectations, directly connected to this PR's structured launch refactor.

Poem

🐇 The l key moved, no longer a door
To library shelves as it once was before.
Now shift it to L and the books appear—
Dead daemons remembered, no pruning to fear!
The stamp knows its defaults, the env is scrubbed clean,
The tidiest rabbit this codebase has seen! 🌿

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 5.41% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately captures the main focus of the PR: fixing TUI repair flows and navigation regressions.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/tui-smoke-next-6

Comment @coderabbitai help to get the list of available commands.

@TraderSamwise

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 28, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/daemon.ts`:
- Around line 417-420: The retained project entries in the daemon state are
being treated as proof of liveness by existing readers, which is causing crashed
services to still look alive. Update the handling around state.projects in
src/daemon.ts so retained/dead records are stored separately from the
live-service map, or change the consumers in routeRequest("/projects") and the
daemon status logic in src/main.ts to determine liveness from an actual runtime
check instead of mere map presence. Ensure the symbols projects, liveById, and
routeRequest("/projects") no longer imply “alive” just because an entry exists.

In `@src/dashboard/command-spec.test.ts`:
- Around line 35-40: The dashboard command test only checks that env names are
absent from the command string, which can miss inherited variables; update the
assertions in command-spec.test around spec.dashboardCommand to verify the
command explicitly unsets AIMUX_CLI_BIN and AIMUX_INSTALL_ROOT, while still
asserting the hardcoded path values are not embedded. Keep the existing checks
for AIMUX_HOME and spec.scriptPath so the test validates both the unset flags
and the absence of baked-in values.

In `@src/dashboard/command-spec.ts`:
- Around line 37-49: The current-entry dashboard flow only removes AIMUX_CLI_BIN
and AIMUX_INSTALL_ROOT from the generated env prefix, but those variables still
inherit from the parent shell and can leak stable-shim state. Update
buildDashboardEnvCommandPrefix and dashboardEnvForLaunch so the current-entry
path explicitly unsets these variables in both the launch command and the stamp
command, while keeping stable-shim behavior unchanged. Use the existing
buildDashboardEnvCommandPrefix, dashboardEnvForLaunch, and
DASHBOARD_ENV_KEYS/DASHBOARD_ENV_STAMP_DEFAULTS logic to locate and apply the
fix.

In `@src/multiplexer/dashboard-control.ts`:
- Line 496: Move the resolveDashboardReloadLaunch(projectRoot) call back inside
the existing repair try/catch in dashboard control so any exception is handled
by the repair flow. Keep the lock acquisition and the launch resolution within
the same guarded block used by the repair logic, and ensure fail() is still
invoked on errors from resolveDashboardReloadLaunch. Refer to the repair path in
dashboard-control and the resolveDashboardReloadLaunch helper when making the
change.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 920656ec-f66e-43a9-9607-6fbf314d05fe

📥 Commits

Reviewing files that changed from the base of the PR and between 26e628e and f3b4b7a.

📒 Files selected for processing (23)
  • src/daemon.test.ts
  • src/daemon.ts
  • src/dashboard/command-spec.test.ts
  • src/dashboard/command-spec.ts
  • src/key-parser.ts
  • src/multiplexer/archives.ts
  • src/multiplexer/coordination.ts
  • src/multiplexer/dashboard-actions-methods.ts
  • src/multiplexer/dashboard-control.test.ts
  • src/multiplexer/dashboard-control.ts
  • src/multiplexer/dashboard-interaction.test.ts
  • src/multiplexer/dashboard-interaction.ts
  • src/multiplexer/library.ts
  • src/multiplexer/navigation.ts
  • src/multiplexer/project.ts
  • src/multiplexer/runtime-guard.test.ts
  • src/multiplexer/topology.ts
  • src/runtime-restart.test.ts
  • src/runtime-restart.ts
  • src/tui/screens/dashboard-renderers.test.ts
  • src/tui/screens/dashboard-renderers.ts
  • src/tui/screens/overlay-renderers.ts
  • src/tui/screens/subscreen-renderers.ts

Comment thread src/daemon.ts
Comment thread src/dashboard/command-spec.test.ts
Comment thread src/dashboard/command-spec.ts Outdated
Comment thread src/multiplexer/dashboard-control.ts Outdated
@TraderSamwise
TraderSamwise merged commit 789868f into master Jun 28, 2026
3 checks passed
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