Repository navigation
fix(tui): say how much of a long permission request is hidden - #51821
kernel-oops wants to merge 1 commit into
Conversation
The collapsed permission prompt is capped at 15 rows, so a long shell command was clipped silently and the rest could only be seen by toggling fullscreen. The collapsed body now shows what fits, wrapping long lines and splitting embedded newlines, and ends with "… N more lines · <key> to view all". The fullscreen view is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RG8UhiogA1Ho2eZRx8tn2y
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
The following comment was made by an LLM, it may be inaccurate: |
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Issue for this PR
Fixes #51820
Type of change
What does this PR do?
The collapsed permission prompt is capped at 15 rows, so a long request body (usually a multi-line shell command) was clipped with no sign that anything was missing.
This adds
collapsePermissionLinesinutil/permission.ts, which splits embedded newlines, wraps lines at the available width, and, when the result needs more rows than fit, keeps what fits and reports how many rows are hidden. The collapsed body inroutes/session/permission.tsxuses it and ends with… N more lines · <fullscreen key> to view all. The fullscreen view is unchanged.How did you verify your code works?
test/util/permission.test.tsfor the helper covers: short bodies pass through unchanged; long and wrapped bodies are cut with the correct hidden count; embedded newlines are counted as rows.bun run typecheckand the permission-related tests inpackages/tui; Prettier check on the changed files.… 109 more lines · ctrl+f to view all, and the fullscreen toggle shows the whole command.Screenshots / recordings
Collapsed prompt ending in
… 109 more lines · ctrl+f to view allafter the visible part of the command.Checklist
🤖 Generated with Claude Code
https://claude.ai/code/session_01RG8UhiogA1Ho2eZRx8tn2y