Repository navigation
Conversation
|
The following comment was made by an LLM, it may be inaccurate: |
There was a problem hiding this comment.
Thanks for picking up #28191. The logic is sound: the always-allow confirmation stays collapsed, Ctrl+F does nothing when fullscreen isn't offered, and fullscreen resets when the request id changes. The tests pass and the type check is clean on the branch. The main problem is the base it's built on.
The branch starts from a commit from before v2 became dev (Oct 6). Against the current dev it conflicts in both packages/tui/src/config/index.tsx and packages/tui/src/routes/session/permission.tsx. On current dev, the flat tui.json schema this PR extends now lives in config/v1/. The new schema groups settings (scroll, leader, prompt, session with session.permissions, …), so a top-level permission_prompt doesn't fit. The current permission prompt has also changed (Keymap layers, Escape now leaves fullscreen first). Please rebase onto the latest dev and put the two options where they fit in the new schema, for example next to session.permissions. Because of the conflicts, I couldn't run the change against current dev. After the rebase, before/after screenshots of the prompt with and without the settings would help.
The new rendering test is fairly heavy: a full provider stack to check one panel height. A smaller version covering the configured height and default_expanded would be easier to maintain.
Public API: adds the optional TUI config keys permission_prompt.max_height (positive integer, default 15) and permission_prompt.default_expanded (boolean, default false). This is backwards compatible, but the key names and location should follow the v2 config schema after the rebase.
Related: #50903
| }), | ||
| }).annotate({ description: "Prompt size settings" }) | ||
|
|
||
| export const PermissionPrompt = Schema.Struct({ |
There was a problem hiding this comment.
On current dev, this flat schema has moved to config/v1/. The v2 Info in this file groups settings (scroll, leader, prompt, session with session.permissions, …). After rebasing, these two options should go into the v2 schema in that grouped style, not a new top-level permission_prompt key, so the v2 CLI actually reads them.
8b03d28 to
58459cd
Compare
|
Thanks for the review — addressed in f4dc8d9 (on top of the update-branch merge):
Screenshots not included yet; behavior is covered by the rendering tests. Verification: |
Issue for this PR
Closes #28191
Type of change
What does this PR do?
Adds two optional
tui.jsonsettings for permission prompts:permission_prompt.max_height: maximum height in rows when collapsed. Defaults to15.permission_prompt.default_expanded: opens approval prompts in fullscreen by default. Defaults tofalse.Each new permission request restores the configured expanded state. Updates to the same request preserve manual fullscreen changes, and
Ctrl+Fcontinues to toggle fullscreen. Always-allow confirmations stay collapsed.Includes configuration validation, rendering tests, and documentation.
How did you verify your code works?
From
packages/tui:bun test test/cli/tui/permission.test.tsx test/config.test.tsx— 17 passed.bun typecheck— passed.Rendering tests cover configured height, fullscreen defaults, toggling, request updates, consecutive approvals, and always-allow confirmation. Formatting and diff checks also pass.
Screenshots / recordings
Not included. Behavior is covered by rendering tests.
Checklist
Added by the opencode bot (AI-generated).
Related: #50903
Public API: adds optional TUI config keys permission_prompt.max_height and permission_prompt.default_expanded (backwards compatible)