Skip to content

fix(editor): populate char-cell ghost blocks from temporary blocks - #75

Merged
jwp2987 merged 1 commit into
mainfrom
fix/issue4-charcell-ghosts
Aug 5, 2026
Merged

fix(editor): populate char-cell ghost blocks from temporary blocks#75
jwp2987 merged 1 commit into
mainfrom
fix/issue4-charcell-ghosts

Conversation

@jwp2987

@jwp2987 jwp2987 commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Part of #4. Fixes the last "diff pipeline" serial failure.

Problem

In char-cell (TUI) rendering, removed/replaced diff lines render as ghost rows that DisplayLattice reads from CharCellState::temporary_blocks. But RenderState::layout_temporary_blocks only laid incoming TemporaryBlocks into the GUI block tree (reset_temporary_block) — nothing populated the char-cell ghost list outside tests. So a TUI diff body rendered zero removed/ghost lines (display_lattice().ghosts() was always empty).

Fix

When the render state is in char-cell mode, translate the temporary blocks via the existing CharCellTemporaryBlock::from_temporary_block and store them with set_temporary_blocks, instead of the GUI block-tree path (char-cell rendering doesn't consult that tree).

Result

  • diff_pipeline_computes_added_lines_and_ghost_blocks passes (1 ghost, content "old\n", insert_before line 1).
  • warp_editor render/char-cell suite 74/0; tui_file_edits_view 7/0.

🤖 Generated with Claude Code

In char-cell (TUI) rendering, removed/replaced diff lines are shown as ghost
rows interleaved by `DisplayLattice`, which reads them from
`CharCellState::temporary_blocks`. But `RenderState::layout_temporary_blocks`
only ever laid the incoming `TemporaryBlock`s into the GUI block tree
(`reset_temporary_block`) — nothing populated the char-cell ghost list outside
of tests, so a TUI diff body rendered zero ghost (removed) lines.

Wire it up: when the render state is in char-cell mode, translate the
temporary blocks via the existing `CharCellTemporaryBlock::from_temporary_block`
and store them with `set_temporary_blocks`, instead of the GUI block-tree path
(char-cell rendering does not consult that tree).

Fixes `diff_pipeline_computes_added_lines_and_ghost_blocks`. warp_editor
render/char-cell suite 74/0; tui_file_edits_view 7/0.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012gDYSHa4oDvQbfungWwG1h
@jwp2987
jwp2987 merged commit 1641ca5 into main Aug 5, 2026
1 check failed
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