refactor(tui): drop viewport-budget row allocator (stage 3 of #1529)#1536
Merged
Conversation
The vertical row allocator existed so a full-screen persistent frame could parcel its rows between zones (modal, status, input, stream, safety). With Static-anchored history, the persistent frame sizes to content and the zones don't compete — there's nothing to allocate. - Delete `src/cli/ui/layout/viewport-budget.tsx` and its tests. - Remove `<ViewportBudgetProvider>` from `App.tsx` (and the indentation it imposed on the rest of the tree). - Remove side-effect-only `useReserveRows` calls in `StreamingCard`, `PromptInput`, `ChoiceConfirm`, `PathConfirm`, `ShellConfirm`, and `PlanCheckpointConfirm`. - `EditConfirm` and `PlanConfirm` actually used the return value; both swap `useTotalRows()` for `useStdout().stdout?.rows` and inline the allocator's max into a direct expression. - Update `plan-confirm.test.tsx` to render without the provider wrapper. `prompt-viewport.ts` stays — it powers the composer's own input-cell math (CJK width, paste sentinels, single-row slicing), which is composer-internal and unaffected by the chat-history refactor.
5 tasks
esengine
pushed a commit
that referenced
this pull request
May 22, 2026
…, theme) (#1524) Localizes the remaining hardcoded CLI output strings — `reasonix mcp list / search / install` flow, `sessions` listing, `prune-sessions`, and the `/theme` slash handler — so zh-CN users see translated text instead of mixed EN/CN output. 31 new keys across `sessions` / `mcpCli` / `app` namespaces with full EN ↔ zh-CN parity. Mechanical migration — `t()` calls replace each string with the same parameters; no behavior change. Verified clean rebase on top of the stage-1-through-4 refactor (#1530 / #1534 / #1536 / #1537) plus the path-approval bridge (#1540): typecheck + lint + 3528 tests all pass.
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.
Summary
Stage 3 of #1529. The vertical row allocator (
viewport-budget) existed so a full-screen persistent frame could parcel rows between zones — modal, status, input, stream, safety. With Static-anchored history the persistent frame sizes to content and the zones don't compete; there's nothing left to allocate.Deleted
src/cli/ui/layout/viewport-budget.tsx(160 lines: reducer, allocator,ViewportBudgetProvider,useReserveRows,useTotalRows)tests/viewport-budget.test.tsTrimmed
App.tsx— drop<ViewportBudgetProvider>(and the indentation it imposed on the rest of the tree)StreamingCard,PromptInput,ChoiceConfirm,PathConfirm,ShellConfirm,PlanCheckpointConfirm— side-effect-onlyuseReserveRowscalls deletedEditConfirm,PlanConfirm— swapuseTotalRows()foruseStdout().stdout?.rowsand inline the max into a direct expression (these were the only consumers that read the allocator's return value)tests/plan-confirm.test.tsx— render without the provider wrapperKept
src/cli/ui/prompt-viewport.ts— this powers the composer's own input-cell math (CJK width, paste-sentinel rendering, single-row slicing). It's composer-internal and unaffected by the chat-history refactor. The Stage 3 line in Move the conversation stream to append-only; drop the self-managed virtual-view layer #1529 said "drop viewport-budget / prompt-viewport, after confirming the composer no longer depends on them"; the composer still depends on prompt-viewport, so it stays.Net diff: 727 deletions, 433 insertions across 12 files. (Most of the App.tsx insertion count is biome re-indenting the subtree that lost its 4-space wrapper.)
Test plan
npm run typechecknpm run lint(no new errors; 2 pre-existing biome suggestions remain)npm run buildnpm run test— all 3557 tests pass (90-lineviewport-budget.test.tsdeleted;plan-confirm.test.tsxupdated to drop the provider wrapper)Part of #1529. Stage 4 (drop
src/frame/*) is next.