feat(tui): support external status line command#1493
Conversation
🦋 Changeset detectedLatest commit: 5191e1a The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5191e1a834
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| }, STATUS_LINE_REFRESH_INTERVAL_MS); | ||
| this.statusLineTimer.unref?.(); | ||
| } | ||
| void this.refreshStatusLine(); |
There was a problem hiding this comment.
Avoid spawning the status command on every state update
When [status_line].command is configured, every FooterComponent.setState() call reaches this unconditional refresh, so ordinary setAppState updates during streaming, mode changes, context updates, etc. can spawn the external shell command far more often than the 1s interval. If the command is fast, this bypasses STATUS_LINE_REFRESH_INTERVAL_MS and can hammer the shell/process table instead of running "about once per second"; only trigger the immediate refresh when the command changes or the timer is first created.
Useful? React with 👍 / 👎.
| this.gitCache = createGitStatusCache(state.workDir, { onChange: this.onRefresh }); | ||
| this.syncGoalClock(state.goal); | ||
| this.syncGoalTimer(state.goal); | ||
| this.syncStatusLineTimer(state.statusLine.command); |
There was a problem hiding this comment.
Default statusLine before dereferencing footer fixtures
Several existing footer panel tests still build AppState fixtures via as AppState without the new statusLine field, for example apps/kimi-code/test/tui/components/panels/footer-context.test.ts and footer-bg-agents.test.ts; this new constructor dereference throws before those tests can render. Either update those fixtures or fall back to DEFAULT_TUI_CONFIG.statusLine here so the broader footer test suite does not fail outside the narrowed test list.
Useful? React with 👍 / 👎.
Summary
[status_line]TUI config for rendering the footer status line with an external commandTests
./node_modules/.bin/tsc -p apps/kimi-code/tsconfig.json --noEmit./node_modules/.bin/vitest run apps/kimi-code/test/tui/config.test.ts apps/kimi-code/test/tui/components/chrome/footer.test.ts apps/kimi-code/test/tui/utils/status-line-command.test.ts./node_modules/.bin/vitest run apps/kimi-code/test/tui/commands/reload.test.ts apps/kimi-code/test/tui/kimi-tui-startup.test.ts apps/kimi-code/test/tui/create-tui-state.test.ts apps/kimi-code/test/tui/activity-pane.test.ts apps/kimi-code/test/tui/kimi-tui-message-flow.test.ts apps/kimi-code/test/tui/message-replay.test.ts apps/kimi-code/test/tui/signal-handlers.test.ts apps/kimi-code/test/cli/update/preflight.test.ts./node_modules/.bin/oxlint --type-aware apps/kimi-code/src/tui/components/chrome/footer.ts apps/kimi-code/src/tui/utils/status-line-command.ts apps/kimi-code/test/tui/components/chrome/footer.test.ts apps/kimi-code/test/tui/utils/status-line-command.test.tsgit diff --check