chore: renderer crash fix, option-parsing refactor, CI, and docs - #7
Merged
Conversation
Replace the scattered per-field typeof/Number.isInteger option guards with one OptionsSchema in src/options.ts and a parseOptions() reader; task.ts, intake.ts, and validator.ts derive option values from it. Defaults and accept/reject behavior are unchanged. The complex commands/validatorModels readers are left as-is (they transform rather than validate). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add a cancel-in-progress concurrency guard to check.yml so a newer push supersedes an in-flight run, and add a path-filtered lint-workflows.yml that runs actionlint (SHA-pinned) on workflow changes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
A short, plain-language starting point: prerequisites, local setup and dev-install, the bun run check gate, conventional-commit/PR conventions, and pointers to AGENTS.md and .specs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The npm-installed plugin bundles its own @opentui/solid and @opentui/keymap/solid copies, whose Solid context the host never populates. useTerminalDimensions/useKeyboard/useBindings therefore threw "No renderer found" / "Keymap not found" on install (the Ubuntu crash). Route all renderer dimensions, keyboard input, and keymap registration through the host-provided TuiPluginApi instead — the one object identical across module copies. - board keys: api.keymap.registerLayer(mode "base"), matching tui.tsx - dialog keys: api.keymap.intercept via useKeyIntercept - dimensions: useRendererDimensions over api.renderer resize events - reactivity-guard test fails the build if a context hook reappears - create-task: let Enter reach the description textarea as a newline (ctrl+enter still submits) instead of consuming it Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Greptile SummaryThis PR updates TUI input/rendering paths and adds supporting cleanup. The main changes are:
Confidence Score: 4/5One contained board keymap bug needs to be fixed before merging. The refactor is mostly scoped and covered, but board commands remain active while dialogs are open, which can break input handling in the main TUI flow. src/board.tsx
What T-Rex did
|
| Filename | Overview |
|---|---|
| src/board.tsx | Moves dimensions/keymap registration through TuiPluginApi, but the board layer no longer disables while dialogs are open. |
| src/tui-renderer.tsx | Adds TuiPluginApi-backed renderer dimension and key intercept helpers. |
| src/options.ts | Adds centralized zod parsing for supported plugin options. |
| src/create-task.tsx | Routes create-task keyboard handling through api.keymap.intercept and preserves textarea Enter behavior. |
| src/settings.tsx | Routes settings keyboard and dimensions through TuiPluginApi-backed helpers. |
| test/reactivity-guard.test.ts | Adds a guard against OpenTUI/Solid context-hook imports in plugin source. |
| test/fixtures/api.ts | Extends the TUI API fixture with renderer and keymap intercept mocks. |
| .github/workflows/lint-workflows.yml | Adds actionlint coverage for workflow-file changes. |
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
src/board.tsx:179-188
**Restore dialog gating**
This layer is now always active after mount, so board hotkeys fire while a plugin dialog is open. The removed `useBindings` config explicitly disabled the board layer when `api.ui.dialog.open`; without the equivalent `enabled` guard here, typing `n`, `a`, `s`, etc. inside dialogs can trigger board commands instead of reaching the focused input.
Reviews (1): Last reviewed commit: "fix: route renderer, keyboard, and keyma..." | Re-trigger Greptile
|
🎉 This PR is included in version 0.1.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Batch of four unrelated changes that accumulated on this branch. Listed separately since a squash merge collapses them into one commit.
fix: route renderer, keyboard, and keymap through
TuiPluginApiThe npm-installed plugin bundles its own
@opentui/solidand@opentui/keymap/solidcopies, whose Solid context the host never populates.useTerminalDimensions/useKeyboard/useBindingstherefore threw "No renderer found" / "Keymap not found" on install (the Ubuntu crash). All renderer dimensions, keyboard input, and keymap registration now go through the host-providedapi— the one object identical across module copies.api.keymap.registerLayer({ mode: "base" }), matchingtui.tsxapi.keymap.interceptvia a smalluseKeyInterceptwrapperuseRendererDimensionsoverapi.rendererresize eventsreactivity-guardtest fails the build if a context hook reappearsrefactor: centralize plugin option parsing in a single schema
Plugin option parsing consolidated into one schema (
src/options.ts) with matching tests.ci: cancel superseded check runs and add workflow linting
Concurrency cancels in-flight check runs on new pushes; adds a workflow-lint job.
docs: add CONTRIBUTING guide
Test plan
bun run checkgreen: prettier, oxlint,tsc, 635 tests pass, package bundle check passes@opentui/solid/@opentui/keymap/solidcontext-hook imports remain insrc/🤖 Generated with Claude Code