Skip to content

fix(ui/shell-confirm): clamp long command preview so options stay visible#691

Merged
esengine merged 1 commit into
mainfrom
fix/shell-confirm-long-preview
May 12, 2026
Merged

fix(ui/shell-confirm): clamp long command preview so options stay visible#691
esengine merged 1 commit into
mainfrom
fix/shell-confirm-long-preview

Conversation

@esengine

Copy link
Copy Markdown
Owner

Summary

When the model proposes a long multi-line shell command, the $ <command> block in the ShellConfirm modal grows tall enough to push the ▸ allow once / allow always / deny options — and the ↑↓ pick · ⏎ confirm · Tab add context · esc cancel footer — past the visible viewport. The reporter's screenshot shows a ~30-line python heredoc occupying the entire screen with no action footer in sight.

This fix clamps the command preview based on the actual terminal height:

  • useTotalRows() from the viewport budget reports terminal rows
  • preview is capped at max(3, totalRows - 18) lines (18 = empirical chrome: header, subtitle, info rows, 3-option select, separator, footer)
  • when clamped, a dim … N more lines hidden — press esc, ask the model to split it line replaces the rest, so the user knows there's more they're not seeing
  • new pure clampCommand helper is exported for tests

i18n: added previewMore / previewMorePlural to shellConfirm for EN and zh-CN.

Closes #680

Test plan

  • new tests/shell-confirm-render.test.tsx — 4 pure clampCommand cases + 2 render cases (50-line command shows options + hidden-lines hint; short command shows neither hint)
  • npx vitest run — 2653 passed / 2 skipped
  • npm run lint — clean (one unrelated pre-existing warning)
  • npm run typecheck — clean

…ible

A 30-line python heredoc pushed the SingleSelect and footer past the
viewport so users couldn't see (or pick) "allow once / always / deny".
Clamp the preview to (totalRows - 18) lines with a "… N more lines
hidden" hint, leaving the action footer on screen at every terminal
height.

Closes #680
@esengine esengine merged commit 19ec49b into main May 12, 2026
3 checks passed
@esengine esengine deleted the fix/shell-confirm-long-preview branch May 12, 2026 07:26
esengine added a commit that referenced this pull request May 12, 2026
…il, CardStream fix (#705)

npm-only release. The Tauri desktop source is in the repo and the CLI
subcommand works, but installer bundles for macOS / Windows / Linux
don't ship this round (separate release once signing's settled).

Highlights:
- Tauri desktop client with multi-tab concurrent runtimes (#689)
  plus a near-full polish pass: wallet balance, version chip, active-
  plan rail, abortable pause-gates, edit-gate pill, en + zh-CN i18n,
  shared pause-policy module dedup'd with the CLI TUI (#701)
- checkpoint API + git-changes panel in the embedded dashboard (#682)
- outside-sandbox file access approval modal (#696)
- MCP loading pill + readiness gate on tool dispatch (#687)
- escalate-after flag for flash → pro threshold (#699)

Fixes:
- CardStream Maximum-update-depth crash, quantize window so boundary
  cards stop oscillating (#700, #702)
- `reasonix code` bridges config key to env + lazy subagent client so
  fresh installs can reach the setup wizard (#703)
- pinned-mode scroll shrinks coalesced (#666), generic CSI key decode
  (#692), shell-confirm preview clamp (#691), frontmatter BOM/folded
  lines (#690), MCP error classification (#688), and more
ChasLui pushed a commit to ChasLui/DeepSeek-Reasonix that referenced this pull request May 23, 2026
…ible (esengine#691)

A 30-line python heredoc pushed the SingleSelect and footer past the
viewport so users couldn't see (or pick) "allow once / always / deny".
Clamp the preview to (totalRows - 18) lines with a "… N more lines
hidden" hint, leaving the action footer on screen at every terminal
height.

Closes esengine#680
ChasLui pushed a commit to ChasLui/DeepSeek-Reasonix that referenced this pull request May 23, 2026
…il, CardStream fix (esengine#705)

npm-only release. The Tauri desktop source is in the repo and the CLI
subcommand works, but installer bundles for macOS / Windows / Linux
don't ship this round (separate release once signing's settled).

Highlights:
- Tauri desktop client with multi-tab concurrent runtimes (esengine#689)
  plus a near-full polish pass: wallet balance, version chip, active-
  plan rail, abortable pause-gates, edit-gate pill, en + zh-CN i18n,
  shared pause-policy module dedup'd with the CLI TUI (esengine#701)
- checkpoint API + git-changes panel in the embedded dashboard (esengine#682)
- outside-sandbox file access approval modal (esengine#696)
- MCP loading pill + readiness gate on tool dispatch (esengine#687)
- escalate-after flag for flash → pro threshold (esengine#699)

Fixes:
- CardStream Maximum-update-depth crash, quantize window so boundary
  cards stop oscillating (esengine#700, esengine#702)
- `reasonix code` bridges config key to env + lazy subagent client so
  fresh installs can reach the setup wizard (esengine#703)
- pinned-mode scroll shrinks coalesced (esengine#666), generic CSI key decode
  (esengine#692), shell-confirm preview clamp (esengine#691), frontmatter BOM/folded
  lines (esengine#690), MCP error classification (esengine#688), and more
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

待执行指令过长时,会阻挡选项的显示

1 participant