Repository navigation
Description
Summary
Add a diagram display mode where the diagram floats as a non-rectangular widget anchored to the middle-right of the screen, and chat text reflows around it (filling empty space on the left side).
Motivation
When a diagram is too wide for the side panel but the user does not want a top panel stealing vertical space, neither existing pane position works well. A floating widget that text wraps around (like CSS float: right) would use screen real estate more efficiently, especially for oddly-shaped diagrams.
Proposed behavior
- Diagram anchored to the right side, vertically centered in the visible area
- Text lines adjacent to the diagram wrap to a narrower width
- Text lines above/below the diagram use the full width
- Only reflow on the left side of the diagram (text fills in to the left)
- Should work alongside the existing pinned Side/Top modes as a third option
Implementation notes
The rendering pipeline is fundamentally line-based, so this requires changes at multiple layers:
- Per-line variable wrap width -
wrap_linescurrently wraps to a single fixed width. Needs to accept per-line widths based on which rows overlap the diagram. - Per-line rendering -
Paragraph::new()renders all lines at the same width. Would need to render each line individually or in groups with matching widths. - Scroll-dependent layout - which lines are adjacent to the diagram depends on scroll position, which affects line count, which affects scroll. This feedback loop needs careful handling to avoid visual glitches.
- Body cache invalidation - cache key needs to include diagram position relative to scroll, not just terminal width.
Resource cost: Near-zero per frame. Same number of characters and one image render.
Engineering cost: Moderate (2-3 days). The complexity is in scroll/reflow interaction correctness, not performance.
Alternatives considered
- Side pane (exists, but wastes space for wide diagrams)
- Top pane (exists, but steals vertical space)
- Pop-out viewer (exists via
okey, but leaves the TUI) - Full-screen overlay (simpler, but hides chat context)
Activity
1jehuang commentedon Mar 27, 2026
Closing this umbrella issue in favor of smaller implementation tickets with explicit success criteria:
The original issue is well-defined, but splitting it makes it much easier to implement and validate incrementally.
docs(m22): reproduce confirmed 2026-05-12, raise priority + MEMORY
fix(providers): roll back partial output on mid-stream retry instead …
fix(providers): roll back partial output on mid-stream retry instead …
fix(providers): roll back partial output on mid-stream retry instead …
feat(session): add invariant + projection registry for the event log (1…
feat(session): persist the event-sourced log end-to-end via snapshot …
docs(research)+test: verify event-sourced log via public API lifecycle
test(session): pre-persistence snapshots migrate via public load (1je…
fix(session): close three trade-offs + document Send constraint
refactor(review-loop): resolve four trade-offs and drop unneeded back…
docs(research): record deepseek-harness plan implementation status
feat(review): harden the headless review path (1jehuang#2-1jehuang#5)
fix(review): bounded-retry a headless lens that fails server-side (#r…
refactor(server): drop dead event_tx from session service handle
perf(compass): dedupe source reads, cap snippet blocks, add usage tel…
feat(handoff): resolve remaining manual-selection trade-offs
feat(handoff): resolve remaining manual-selection trade-offs
fix(prune): run image pass every step; gate tool-result pass on growth
feat(handoff): typed wire fields and atomic HandoffApply
fix(swarm): make parallel worker worktrees branch-unique
feat: v0.1.6 — permission rules on the approval gate (per tool, per p…