Skip to content

Playbook editor: render fenced code as coherent blocks - #1290

Merged
edwin-zvs merged 2 commits into
mainfrom
playbook-fenced-code-block
Aug 19, 2026
Merged

Playbook editor: render fenced code as coherent blocks#1290
edwin-zvs merged 2 commits into
mainfrom
playbook-fenced-code-block

Conversation

@edwin-zvs

Copy link
Copy Markdown
Contributor

Summary

  • render completed multiline fences as one continuous full-width code surface in the TUI, including wrapped rows and hidden delimiter rows
  • join web fence rows into one seamless block with rounded outer corners only
  • preserve exact Markdown source, hidden delimiter offsets, CJK/collaboration geometry, incomplete-fence inertness, Backspace/retype behavior, and the PR fix(tui): honor dismissed Playbook selection menu #1286 selection-menu dismissal guard
  • update accepted spec 0204 and Playbook docs with the block-level UX decision

Rendering model

The TUI paints the block background directly into otherwise-empty frame cells before rendering text. It adds no glyphs or padding, so wrapping, cursor positions, selections, remote offsets, and hit testing stay on the source-stable model from PR #1287. The web keeps one DOM row per source line and uses contiguous full-content-width backgrounds with top corners only on the opener and bottom corners only on the closer.

Regression coverage

  • Ratatui frame test proves opener, wrapped CJK body, and hidden closer fill one continuous full-width block while adjacent Markdown stays outside it
  • Chromium contenteditable test proves full editor-width geometry, zero seams, outer-corner grouping, exact offsets, inert extensions, and Backspace/retype restoration
  • the Playbook browser artifact now includes the fenced block treatment

Verification

  • cargo build
  • cargo test -p construct-cli --bin construct playbook -- --nocapture (356 passed)
  • cargo test -p construct-e2e --test playbook_view -- --nocapture (8 passed)
  • cargo test -p construct-e2e --test playbook_view web_playbook_view_full_parity -- --nocapture (focused final rerun passed)
  • cargo test -p construct-e2e --test web_smoke -- --nocapture --test-threads=1 (2 passed)
  • git diff --check

Binary

This change ships in construct. Worktree debug binary: /Users/moon/agentd/.claude/worktrees/playbook-fenced-code-block/target/debug/construct

@edwin-zvs

Copy link
Copy Markdown
Contributor Author

Browser parity artifact showing the coherent multiline fenced-code block:

@edwin-zvs
edwin-zvs merged commit 78750ea into main Aug 19, 2026
1 check passed
@edwin-zvs edwin-zvs mentioned this pull request Aug 19, 2026
@edwin-zvs
edwin-zvs deleted the playbook-fenced-code-block branch August 19, 2026 06:13
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