refactor(tui): drop the byte-virtual frame layer (stage 4 of #1529)#1537
Merged
Conversation
Final stage. The Frame algebra (vstack, hstack, slice, overlay,
viewport, bottom, fitWidth, etc.) and its ANSI rasterizer existed so a
full-screen persistent frame could be composed cell-by-cell. With
Static-anchored history and Ink-native rendering, none of that is
exercised — `frame-render.tsx` was the only caller of the Frame layer
and itself had zero callers.
- Delete `src/frame/{frame,ansi,types,index}.ts` and `tests/frame.test.ts`.
- Delete `src/cli/ui/frame-render.tsx` (orphaned).
- Lift `src/frame/width.ts` into `src/cli/ui/text-width.ts` — these are
text-cell utilities (string-width passthrough, grapheme-safe
clipToCells / wrapToCells) that the card renderers and markdown
still need, but they're not "frame" anything.
- Update 6 src callers and 2 tests to import from the new path.
Closes #1529.
f56101c to
2208277
Compare
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
Final stage of #1529. The Frame algebra (
vstack,hstack,slice,overlay,viewport,bottom,fitWidth, etc.) and its ANSI rasterizer existed so a full-screen persistent frame could be composed cell-by-cell. With Static-anchored history and Ink-native rendering, none of that is exercised —frame-render.tsxwas the only caller of the Frame layer, and it itself had zero callers.Deleted
src/frame/frame.ts(195 lines: vstack/hstack/pad/borderLeft/slice/bottom/viewport/overlay/fitWidth/text/blank/empty)src/frame/ansi.ts(181 lines: Frame → ANSI rasterizer)src/frame/types.ts(43 lines: Frame / Cell / FrameRow / TextOpts)src/frame/index.ts(re-exports)src/cli/ui/frame-render.tsx(Frame → JSX adapter; no callers)tests/frame.test.ts(385 lines)Migrated
src/frame/width.ts→src/cli/ui/text-width.ts. These are text-cell utilities (stringWidthpassthrough to thestring-widthlib, grapheme-safeclipToCells/wrapToCells/graphemes/graphemeWidth) that the card renderers and markdown still need, but they're not "frame" anything — they're plain string math. The implementation is unchanged.Updated imports (6 src callers + 2 tests)
cards/ReasoningCard,cards/StreamingCard,cards/ToolCard,cards/useIncrementalWrap,markdown,slash/handlers/basictests/incremental-wrap.test.ts,tests/markdown.test.tsNet diff: 907 deletions, 9 insertions across 16 files. (The new
text-width.tsis 60 lines lifted verbatim — counted as untracked, not in the diff stat.)Cumulative across stages 1–4
Comfortably past the 2.5–3k lines estimate in the original issue.
Test plan
npm run typechecknpm run lint(no errors; 1 pre-existing biome suggestion warning remains)npm run buildnpm run test— 3509 tests pass (385-lineframe.test.tsdeleted)text-width.tsis byte-identical toframe/width.ts)Closes #1529.