Skip to content

refactor(mecatui): prepare conversation cards functionally - #1744

Merged
jbeda merged 19 commits into
mainfrom
impl/mecatui-functional-conversation-card-rendering
Sep 23, 2026
Merged

jbeda merged 19 commits into
mainfrom
impl/mecatui-functional-conversation-card-rendering

Conversation

@jbeda

@jbeda jbeda commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Implements the approved functional conversation-block rendering contract from #1739, keeping cache ownership and document-local frame state in the mecatui renderer while moving stateless structured-block preparation to a pure boundary.

  • Replaces the old card-preparation boundary with cmd/mecatui/ui/internal/blocks, which prepares user, notice, hook, turn-stat, error, delivery, and styled tool blocks as final lines plus lockstep provenance rows.
  • Separates immutable content snapshots, shared block layout, and one resolved semantic blocks.Theme; UI owns stylesheet-role mapping and block-to-input adapters.
  • Encapsulates all cross-frame conversation rendering cache state in blockRenderCache, including whole-block output, Markdown, fallback provenance, and the incremental prefix. Cache validity now uses real production inputs: block revision, width, and expansion state.
  • Preserves assistant Markdown and input-rail rendering outside the pure blocks boundary.
  • Moves shared terminal plain-text helpers to cmd/mecatui/internal/terminaltext, with distinct layout-preserving and single-line sanitation paths used by UI and customization rendering.
  • Normalizes tabs before tool-card wrapping, preventing Go/Read/Shell output from being reflowed a second time by the card frame.
  • Moves pure permanent-error and scheduled-delivery display-transform tests to the blocks package; fixes permanent-provider-error replay parity.
  • Makes the Slack example's real-daemon test harness hermetic by isolating HOME/XDG state and disabling conventional permission discovery.

Follow-up

#1789 tracks the intentionally deferred typed runtime conversation-block model. This PR only adds explicit UI-to-block-preparation adapters as the migration seam.

Validation

  • task lint
  • go test ./cmd/mecatui/ui/...
  • go test ./cmd/mecatui/ui ./cmd/mecatui/customization
  • cd sdk/typescript && pnpm test (59 files / 332 tests)
  • cd sdk/typescript/examples/slack-bot && pnpm test (78 tests)
  • git diff --check

jbeda and others added 17 commits September 22, 2026 16:56
@jbeda
jbeda force-pushed the impl/mecatui-functional-conversation-card-rendering branch from c7118c4 to 8ee0c30 Compare September 22, 2026 23:57
@jbeda
jbeda marked this pull request as ready for review September 23, 2026 00:17
@jbeda
jbeda merged commit 3aebbb5 into main Sep 23, 2026
36 checks passed
@jbeda
jbeda deleted the impl/mecatui-functional-conversation-card-rendering branch September 23, 2026 00:39
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