feat(tui): mark dev runtime with a DEV badge in the dashboard header#108
Conversation
Make the dev lane visually obvious so it can't be confused with prod. The header shows a high-contrast DEV badge and a yellow rule only when the runtime is the dev lane. Harden lane detection: isDevelopmentRuntime now mirrors launcher-env's multi-signal logic (AIMUX_ENV, AIMUX_HOME, AIMUX_DAEMON_PORT, AIMUX_WEB_APP_URL) instead of relying on AIMUX_ENV alone, so the badge survives a single var being unset. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
More reviews will be available in 10 minutes and 54 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR expands development runtime detection beyond a single environment variable check to examine multiple signals (home directory path, daemon port, web app URL), threads the detection result through the dashboard data model, and renders a "DEV" badge in the TUI header when operating in development mode. ChangesDevelopment Runtime Detection and Dashboard Badge
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/tui/screens/dashboard-renderers.test.ts (1)
205-211: ⚡ Quick winConsider adding test coverage for the yellow divider.
The test correctly verifies the DEV badge, but the PR description also mentions adding "a yellow rule in the TUI dashboard header" as a feature. Adding an assertion for the yellow ANSI-colored divider would provide more complete coverage of the dev runtime visual indicators.
✅ Suggested additional assertion
it("shows a DEV badge in the header only for the dev runtime", () => { const prod = renderDashboardFrame(baseDashboardViewModel({ isDevRuntime: false }), 120, 40); expect(prod.frame).not.toContain(" DEV "); + expect(prod.frame).not.toContain("\x1b[33m───"); // No yellow divider in prod const dev = renderDashboardFrame(baseDashboardViewModel({ isDevRuntime: true }), 120, 40); expect(dev.frame).toContain("\x1b[1;30;43m DEV \x1b[0m"); + expect(dev.frame).toContain("\x1b[33m───"); // Yellow divider in dev });🤖 Prompt for 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. In `@src/tui/screens/dashboard-renderers.test.ts` around lines 205 - 211, Add an assertion to the existing test that checks for the yellow divider ANSI sequence when isDevRuntime is true: in the "shows a DEV badge..." test (which calls renderDashboardFrame and baseDashboardViewModel) assert that the rendered frame contains the expected yellow rule/divider escape sequence (the same style used for the header divider in the TUI) in addition to the existing DEV badge assertion so the dev runtime visual indicator is covered.
🤖 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/connection-targets.test.ts`:
- Around line 85-89: Add explicit tests that exercise tilde expansion by setting
process.env.AIMUX_HOME to the literal strings "~/.aimux-dev" and "~" (not the
expanded homedir path) before calling clearLaneEnv() and isDevelopmentRuntime();
assert that "~/.aimux-dev" normalizes to the user's homedir + "/.aimux-dev" and
therefore makes isDevelopmentRuntime() return true, and assert that "~"
normalizes to the homedir (and does not falsely detect the dev lane unless
homedir itself is ".aimux-dev"). Reference normalizeHome and
isDevelopmentRuntime when adding these cases in connection-targets.test.ts.
---
Nitpick comments:
In `@src/tui/screens/dashboard-renderers.test.ts`:
- Around line 205-211: Add an assertion to the existing test that checks for the
yellow divider ANSI sequence when isDevRuntime is true: in the "shows a DEV
badge..." test (which calls renderDashboardFrame and baseDashboardViewModel)
assert that the rendered frame contains the expected yellow rule/divider escape
sequence (the same style used for the header divider in the TUI) in addition to
the existing DEV badge assertion so the dev runtime visual indicator is covered.
🪄 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: 18c3e80a-4e5d-4513-b2a2-489ccaa19ba2
📒 Files selected for processing (6)
src/connection-targets.test.tssrc/connection-targets.tssrc/dashboard/index.tssrc/multiplexer/dashboard-view-methods.tssrc/tui/screens/dashboard-renderers.test.tssrc/tui/screens/dashboard-renderers.ts
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
@coderabbitai Addressed the yellow-divider nitpick in de14689 — the badge test now also asserts the |
|
Tip For best results, initiate chat on the files or code changes.
🧠 Learnings used |
Summary
Makes the dev lane visually obvious in the TUI dashboard so it can't be confused with prod.
DEVbadge (bold black-on-yellow) and a yellow rule, only in the dev lane. Prod is unchanged.isDevRuntimeflag through the dashboard view model, set fromisDevelopmentRuntime().Hardened lane detection
The previous check relied solely on
AIMUX_ENV === "development". Given the recent runtime env-targeting work (a1e8206),launcher-env.tsnormalizes four signals together and treats any one dev signal as the dev lane.isDevelopmentRuntime()now mirrors that multi-signal logic —AIMUX_ENV, resolvedAIMUX_HOME(~/.aimux-dev),AIMUX_DAEMON_PORT(43191), orAIMUX_WEB_APP_URL(http://localhost:8081) — so the badge survives a single var being unset.Tests
isDevRuntimeis true.tscclean; related vitest suites pass.🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
New Features
Tests