Skip to content

Playbook editor: format multiline fenced code - #1287

Merged
edwin-zvs merged 1 commit into
mainfrom
playbook-multiline-fences
Aug 19, 2026
Merged

Playbook editor: format multiline fenced code#1287
edwin-zvs merged 1 commit into
mainfrom
playbook-multiline-fences

Conversation

@edwin-zvs

Copy link
Copy Markdown
Contributor

Summary

  • format completed multiline backtick fences in Playbook TUI and web while preserving exact Markdown source
  • retain one editor line per source line, hide only delimiter glyphs, and highlight inert fence content
  • make Backspace at the hidden closing boundary remove the full closing run; retyping restores formatting
  • preserve Unicode collaboration offsets, CJK cursor geometry, inverse hit testing, and inert smart clips/attachments/action links
  • supersede the literal-multiline constraint in spec 0204 and update Playbook docs

Row-stable editing model

Opening and closing delimiter lines keep their source rows. Indentation, info strings, and trailing spaces remain visible; delimiter-only lines render as highlighted blank rows. Source offsets still include every hidden backtick and newline.

The unavoidable UX tradeoff is that distinct source positions within a zero-width hidden delimiter share the same visual caret boundary. Their persisted and collaboration offsets remain distinct and exact.

Incomplete fences remain literal and inert. Backspace at a completed closing boundary reveals that literal incomplete form; retyping the matching closer restores the formatted block without rewriting surrounding source.

Latest-main integration

  • based on origin/main at 003fa4b after PR fix(tui): honor dismissed Playbook selection menu #1286
  • preserved the selection-menu renderer guard: selection_menu == None returns without painting or retaining hit targets
  • the full Playbook TUI suite includes and passes the live selection-menu dismissal/no-repaint regression

Verification

  • cargo build
  • cargo test -p construct-cli --bin construct playbook -- --nocapture (355 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 rerun passed)
  • cargo test -p construct-e2e --test web_smoke -- --nocapture --test-threads=1 (2 passed)
  • rustfmt --edition 2021 --check crates/cli/src/playbook_markdown.rs
  • git diff --check

Binary

Relevant binary: /Users/moon/agentd/.claude/worktrees/playbook-multiline-fences/target/debug/construct

This PR changes crates/cli and embedded web assets, both shipped through construct.

@edwin-zvs
edwin-zvs merged commit 123b1ce into main Aug 19, 2026
1 check passed
@edwin-zvs
edwin-zvs deleted the playbook-multiline-fences branch August 19, 2026 05:19
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