Skip to content

refactor(tui): drop the byte-virtual frame layer (stage 4 of #1529)#1537

Merged
esengine merged 1 commit into
mainfrom
feat/static-history-stage4
May 22, 2026
Merged

refactor(tui): drop the byte-virtual frame layer (stage 4 of #1529)#1537
esengine merged 1 commit into
mainfrom
feat/static-history-stage4

Conversation

@esengine

Copy link
Copy Markdown
Owner

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.tsx was 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.tssrc/cli/ui/text-width.ts. These are text-cell utilities (stringWidth passthrough to the string-width lib, grapheme-safe clipToCells / 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/basic
  • tests/incremental-wrap.test.ts, tests/markdown.test.ts

Net diff: 907 deletions, 9 insertions across 16 files. (The new text-width.ts is 60 lines lifted verbatim — counted as untracked, not in the diff stat.)

Cumulative across stages 1–4

Stage Net What went
1 +69 / -5 Add Static path behind flag (#1530)
2 -1497 Make Static default; delete CardStream + chat-scroll + copy-mode (#1534)
3 -294 Delete viewport-budget row allocator (#1536)
4 -898 Delete the byte-virtual Frame layer (this PR)
Total ≈ -2620 lines

Comfortably past the 2.5–3k lines estimate in the original issue.

Test plan

  • npm run typecheck
  • npm run lint (no errors; 1 pre-existing biome suggestion warning remains)
  • npm run build
  • npm run test — 3509 tests pass (385-line frame.test.ts deleted)
  • Manual smoke: long markdown output, code blocks, CJK / emoji wrapping all still render correctly (text-width.ts is byte-identical to frame/width.ts)

Closes #1529.

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.
@esengine esengine force-pushed the feat/static-history-stage4 branch from f56101c to 2208277 Compare May 22, 2026 09:06
@esengine esengine merged commit cd8def1 into main May 22, 2026
4 checks passed
@esengine esengine deleted the feat/static-history-stage4 branch May 22, 2026 09:10
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.
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.

Move the conversation stream to append-only; drop the self-managed virtual-view layer

1 participant