Repository navigation
Conversation
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
9d4d1ad to
fe62e1b
Compare
There was a problem hiding this comment.
Looks sound. In fullscreen (ctrl+f), the new keybinds scroll the permission diff. When the prompt is collapsed, the session's own page keys are left alone because the scroll commands are only registered while expanded. I checked this with your render test, which passes here and fails when copied onto the base branch. tsc -b for packages/tui and the nearby permission and session tests also pass. I couldn't get a live permission prompt in the TUI test harness, so a short before/after screenshot or recording in the description would help reviewers.
Public API: adds two TUI config keybinds, permission.prompt.scroll.up (default pageup) and permission.prompt.scroll.down (default pagedown). Nothing existing changes, so it is backwards compatible.
Small requests: drop the hand edit to packages/console/app/public/tui.json (see the inline comment). The added keybind.test.ts case only repeats the two default values, so it can go too; the render test already covers the behaviour.
| ], | ||
| "description": "Toggle permission prompt fullscreen" | ||
| }, | ||
| "permission.prompt.scroll.up": { |
There was a problem hiding this comment.
This generated schema hasn't been updated since the v2 promotion: it's missing current keybinds such as session.page.up, diff.half_page.down and which-key.scroll.up. Adding only these two keys by hand makes up most of this PR's lines and leaves the file half-updated. I'd drop this file from the PR; refreshing it belongs in a separate regeneration.
There was a problem hiding this comment.
add dialog.plugins.error to the list
| }) | ||
|
|
||
| test("permission prompt scrolling defaults to pageup and pagedown", () => { | ||
| expect(TuiKeybind.Definitions["permission.prompt.scroll.up"].default).toBe("pageup") |
There was a problem hiding this comment.
This only repeats the two default values from keybind.ts, and permission-scroll.test.tsx already covers the behaviour. It can be dropped to keep the change small.
There was a problem hiding this comment.
This push only rebases the branch onto newer dev: the PR's own commit is unchanged. On the new head, the render test and tsc -b for packages/tui still pass. My two earlier points (the hand edit to packages/console/app/public/tui.json and the keybind.test.ts case that only repeats the defaults) still apply. Public API is the same as before: it adds the TUI keybinds permission.prompt.scroll.up (pageup) and permission.prompt.scroll.down (pagedown), which is backwards compatible.
fe62e1b to
f2b1f58
Compare
There was a problem hiding this comment.
Both earlier points are addressed: the hand edit to tui.json and the keybind.test.ts case are gone, and the rest of the change is the same. On the new head, the render test and tsc -b for packages/tui pass. Public API is unchanged from before: it adds the TUI keybinds permission.prompt.scroll.up (pageup) and permission.prompt.scroll.down (pagedown), which is backwards compatible. Nothing new to raise.
|
two things i've kept out of this:
other thing i'm not entirely happy about: passing-through the scroller is a little clunky. honestly, i don't see a better way that keeps this change to a reasonable size. probably, some more groundwork before this could help but that is a decision for a maintainer. |
f2b1f58 to
4aab5d5
Compare
There was a problem hiding this comment.
This push only moves the branch onto a different dev commit; the PR's own commit is unchanged. On the new head, the render test and tsc -b for packages/tui pass. Both earlier points (the tui.json edit and the extra keybind.test.ts case) stay addressed. Public API is the same as before: it adds the TUI keybinds permission.prompt.scroll.up (pageup) and permission.prompt.scroll.down (pagedown), which is backwards compatible. Nothing new to raise.
|
One measured gap: the two new defaults match only the plain page keys, so a numeric-keypad PageUp/PageDown scrolls nothing in the diff.
createKeyMatcher("pagedown")({ name: "kppagedown", ... }) // false
press("pagedown") // the bound command ran once
press("kppagedown") // the bound command never ranNothing normalizes them in between: the only key-name rewrite addon, Why it lands on this PR in particular: with the mouse disabled, the people who need these keys are on laptops, where PageUp/PageDown is often reachable only as NumLock-off keypad Page Up/Down (Fn+arrow or the keypad itself). Those presses arrive as The minimal change is one key per default: "permission.prompt.scroll.up": keybind("pageup,kppageup", "Scroll permission diff up"),
"permission.prompt.scroll.down": keybind("pagedown,kppagedown", "Scroll permission diff down"),That is the only place the key list lives — the commands are bound through the layer's |
4aab5d5 to
4b1b2cc
Compare
|
in the spirit of anticipatory obedience, i think adding the keybinds right now is the way to go - as this change might be missed while working on that other change. should be less work overall.
i took the liberty to also adjust |
There was a problem hiding this comment.
This push adds the keypad keys kppageup and kppagedown to the defaults. I checked them with a temporary copy of your render test that sends the keypad key codes: they scroll the diff in fullscreen, and do nothing while the prompt is collapsed. On the new head, the render test and tsc -b for packages/tui pass. Both earlier points stay addressed. Public API: adds the TUI keybinds permission.prompt.scroll.up (default pageup,kppageup) and permission.prompt.scroll.down (default pagedown,kppagedown), which is backwards compatible. Nothing new to raise.
|
rebased |
4b1b2cc to
60706d8
Compare
60706d8 to
0560194
Compare
|
rebased |
Issue for this PR
can't scroll diff view with mouse disabled.
side note:
using agents to installi git hooks to run code when it's not expected?
not cool.
also: my host doesn't have the tools to run the test. that's sandbox territory. just rely on the tests.
i can only hope that other parts of this software were written with slightly more awareness for security-issues.
Type of change
What does this PR do?
with the mouse disabled, there is currently no way to scroll proposed diffs.
this PR adds a keybind for scrolling the permission prompt.
in addition to that, use the fullscreen permissions prompt (
ctrl-fby default) to be able to divert the input to the diff viewHow did you verify your code works?
i started opencode from the local repo using bun (see the asciinema further down) and prompted the agent to propose a diff.
then, i opened the diff fullscreen using
ctrl-fand scrolled up and down using the page up/down keys. i closed the fullscreen view again and scrolled the transcript using the same keys.Screenshots / recordings
If this is a UI change, please include a screenshot or recording.
opencode.asciinema.txt
Checklist
If you do not follow this template your PR will be automatically rejected.
Added by the opencode bot (AI-generated).
Fixes #50903
Related: #55748
Public API: adds TUI keybinds permission.prompt.scroll.up (pageup,kppageup) and permission.prompt.scroll.down (pagedown,kppagedown) (backwards compatible)