Add TUI status and Ctrl+Y fast toggle - #2
Open
MAakber wants to merge 5 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a TUI integration for the existing /fast server plugin by displaying a fast status indicator in the session prompt and introducing a Ctrl+Y toggle that updates the shared opencodex-fast.jsonc state file.
Changes:
- Introduces a new TUI entry point (
tui.tsx) that polls and renders the fast-mode status and registers a base-modeCtrl+Ykeybinding. - Adds shared JSONC state parsing + polling (
fast-status-state.ts) and persisted toggle logic (fast-toggle.ts), along with Node test coverage. - Updates packaging/configuration (exports, deps, TSX config) and documents TUI setup in the README.
Reviewed changes
Copilot reviewed 8 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tui.tsx | New TUI plugin entry that displays fast and binds Ctrl+Y via a keymap layer. |
| fast-status-state.ts | Adds JSONC-capable state parsing and a polling monitor abstraction. |
| fast-toggle.ts | Implements persisted on-disk toggle and exposes a keymap layer/command. |
| fast-status-state.test.ts | Adds tests for parsing and monitor polling/edge cases. |
| fast-toggle.test.ts | Adds tests for toggle behavior and keymap layer registration. |
| index.ts | Server plugin now uses shared JSONC state parsing and re-reads state before Codex matching and command handling. |
| tsconfig.json | Enables TSX compilation and includes new source/test files in the TS build. |
| package.json | Adds ./server and ./tui exports, dependencies, and updates scripts for build+test. |
| package-lock.json | Locks added dependencies and updated dev dependencies. |
| README.md | Documents TUI entry-point usage and the Ctrl+Y toggle behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
/fastcommand works as a server plugin in both OpenCode Desktop and the terminal client. This PR adds a separate terminal TUI entry point that displaysfastbeside both the home and session prompts and bindsCtrl+Yin base mode to toggle it. The status indicator and keybinding are terminal-only because Desktop does not host the TUI plugin runtime.The server and TUI use the same
opencodex-fast.jsoncstate file. The server rereads it before matching Codex requests, so changes made through/fastorCtrl+Ytake effect without restarting OpenCode. Non-Codex requests are unchanged.The existing root entry remains available for server installations. Explicit
./serverand./tuiexports support the separate OpenCode plugin loaders. The TUI integration requires OpenCode 1.18.1 or newer.The shared state reader accepts JSONC comments and trailing commas while ignoring transient read failures. Toggle writes use a unique temporary file followed by atomic rename, with failed-write cleanup. The README documents Desktop/server support and the optional terminal TUI setup.
Tested with:
npm run buildnpm pack --dry-run --json./server, and./tuientry-point imports