Skip to content

Add rich composer formatting and spoiler rendering - #203

Merged
wesbillman merged 8 commits into
mainfrom
brain/composer-formatting
Sep 24, 2026
Merged

wesbillman merged 8 commits into
mainfrom
brain/composer-formatting

Conversation

@wesbillman

@wesbillman wesbillman commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Authored and opened by Brain on Wes’s behalf.

Summary

  • Restore the original Buzz formatting toolbar layout and show/hide motion with shared Phosphor controls and reduced-motion support.
  • Give ProseMirror sole ownership of editable document, selection, composition and undo/redo. Persist a validated versioned document alongside the derived text/recipient projection; serialize Markdown only for send/copy. Retain legacy drafts, explicit mention provenance and existing outbox/plugin ownership.
  • Enable bold, italic, strike, inline code, link editing, quote/code blocks, bullet/ordered lists and spoilers. Add lightweight CSS spoiler dust with keyboard reveal and inert hidden descendants.

The editing-core replacement was explicitly approved after the layout-only prototype. This is one coherent foundation/formatting change, not a parser/transport rewrite. Unsupported authored Markdown remains source text; live typed-fence conversion, syntax highlighting and a particle engine are out of scope.

Origin: composer-formatting conversation

Current status — diagnostic head 1b100e4a

Not merge-ready. Published head: 1b100e4a81205e45436654d4710660d1926b3d2f. Hosted run 35955575437 was queued at the post-push check; final-head CI and DCO are pending, with required approving/code-owner review still outstanding.

  • ba22d04c repairs the packed conversation assertion: explicitly accept the persisted version-1 document envelope while retaining exact text and both recipient spans. No production behavior change.
  • 1b100e4a adds bounded, passive test-only scroll-writer diagnostics to the existing navigation journey. Its real wheel, settling and same-ID/Y <4px assertions remain unchanged. No cases, retries, timeouts or exclusions added/removed.
  • The 58px Linux WebKit displacement remains unresolved, already present during opening. Existing traces do not identify its writer. Diagnostics preserve native arguments, but synchronous geometry observation can alter layout timing: an instrumented pass does not establish a fix. No speculative navigation production change was made.
  • Full affected conversation + message-navigation files passed locally in both engines: 28/28, 56.0s (macOS, pinned tools, zero retries, final pre-commit bytes). Prior uninstrumented run also passed; neither clears the Linux failure. Diagnostic attachments contain actual native writer records in both local engines.
  • Required push hooks at this head passed TypeScript, 257 files / 2,675 Vitest tests, design types and guards. Bounded diagnostic review required passive listeners; that correction is included. No hook bypass, force-push, approval or merge.

Previous repair validation (79ae265f)

Integrated main 2cbe1b0c before repairs; its merge tree matched the failed hosted run. That repair head was 79ae265f393417d2cc7d1abc4d3e8cf95340f16e.

  • Required commit/push hooks passed: formatting/lint/icons, TypeScript, 257 Vitest files / 2,675 tests, design types and all design guards. Dependency changes select the full Vitest suite.
  • All five CI-affected browser files passed together in Chromium and WebKit: 62/62 (settings, completion-work, emoji, product-ui, typeahead), CI selection, zero retries. Run was on the final clean-equivalent repair bytes before commit; hooks made no further edits.
  • At the clean committed head, all four formatting/mention browser files passed: 20/20 (composer-bold, composer-formats, composer-links, mention-edit).
  • Standalone CLI integration passed 3/3, including building/installing a scaffold with the packed author API and preserving an installed revision after failed build. Controlled Settings close-completion tests cover ordinary focus handoff and early input focus.
  • Bounded independent source/dependency review found no concrete repair blocker. This is not GitHub/code-owner approval.
  • These are local macOS results. Hosted Linux run 35953773111 is failed: JavaScript (2,675 tests), Rust/Node integration, measurements (7 cases), Chromium shard 2 and DCO passed. Three browser shards failed: conversation draft equality in both engines and a 58px ordinary-reading anchor shift in WebKit exact-thread navigation. Repair investigation remains active; this PR is not merge-ready.

What failed and changed

The earlier local checks were not the whole hosted suite. Hosted CI exposed a packed declaration dependency leak, duplicate emoji-selection ownership, selection/caret and post-token geometry regressions, and assertions still targeting the old toolbar/DOM. Its merged tree also contained main's new account-menu focus handoff, which could interrupt Settings entry.

The repair keeps serializable snapshot types at the public draft boundary, leaves selection solely with ProseMirror, preserves browser-derived replacement carets, scrolls after token portals acquire geometry, and removes the toolbar's accidental containing block. Settings retains drafts as before; its existing completion callback now preserves focus already moved into the page. Assertions retain exact selection/layout/retention contracts. The completion-position probe is positively calibrated and excludes legitimate editor caret geometry; it is a source-fixture probe in CI too, not a global zero-layout claim. No CI lanes, retries, timeouts or tolerances changed; no browser cases were added or removed by this repair.

Regression coverage and browser justification

  • New colocated document/editor cases cover selection/history, schema snapshots, serialization, marks, lists and cross-block deletion. Existing component tests exercise completion, attachments, send, recipients and draft ownership through the production editor.
  • New browser files add 6 logical cases / 12 engine cases, removing none. Browser-only boundaries: native input/deletion and caret behavior, clipboard, keyboard selection, tab indentation, storage/reload and CSS/inert/keyboard spoiler reveal. Combinatorial parsing/formatting remains in Vitest.
  • Existing link and mention browser fixtures now observe the paragraph/BR and mutation-observer boundaries rather than the removed custom editor DOM; assertions were retained.
  • Fail-then-pass regressions caught collapsed-spoiler selection exceptions, nested-list type switching, explicit stored marks, blank-line and URL spoiler disclosure, adjacent GFM table pipes, and outer spoiler emphasis. The final three outer-format regressions failed before repair and the whole 85-case renderer file passed after. Bounded independent source/log rechecks closed the reported mechanisms.

Remaining gates

  • Resolve the navigation displacement and verify hosted CI required plus DCO Check at the final uninstrumented repair head, and obtain one required approving/code-owner review. GitHub currently reports REVIEW_REQUIRED; no approval or merge is claimed.
  • Human visual acceptance of the latest dust motion and native Tauri editing remains distinct from headless Chromium/WebKit evidence. No desktop/server restart or native automation was performed for final delivery.
  • No native packaging, Windows or release certification claimed.

Brain added 2 commits September 23, 2026 21:05
Signed-off-by: Brain <1a02c72794dcd0f07058a353bc3a81f4028b8c77c92c87fce6d5c8b85970a20b@buzz.block.builderlab.xyz>
Signed-off-by: Brain <1a02c72794dcd0f07058a353bc3a81f4028b8c77c92c87fce6d5c8b85970a20b@buzz.block.builderlab.xyz>
@wesbillman
wesbillman marked this pull request as ready for review September 24, 2026 03:13
@wesbillman
wesbillman requested review from a team and comp615 as code owners September 24, 2026 03:13
Signed-off-by: Brain <1a02c72794dcd0f07058a353bc3a81f4028b8c77c92c87fce6d5c8b85970a20b@buzz.block.builderlab.xyz>
@wesbillman

Copy link
Copy Markdown
Collaborator Author

On Wes’s behalf — Brain implemented and verified this conflict resolution.

Merged e9e557c5 into the published branch without rewriting history. New head: b0520a44c58e0235f9105d6f6d8af6d3f7430077; GitHub reports MERGEABLE (required checks remain in progress).

  • Preserved Edit the latest own message with Up in the existing composer #192’s same-composer editing, draft persistence isolation, delivery/retry and attachment source. Rich draft document/selection/history are retained through an editor-owned checkpoint rather than reinstating the old history stack; edit saves use the Markdown serializer.
  • Browser verification caught and repaired native Escape interception and focus restoration before unlock. Independent bounded review caught blank structured edits being serialized as nonblank delimiters; three Enter-path regressions failed before the guard and pass afterward.
  • At the new head, required hooks passed 251 files / 2,640 tests, TypeScript, design types/guards and staged checks. The final-head edit journey passed Chromium and WebKit, covering same DOM, cancel/undo, retry/acceptance, attachments and responsive edit controls. Another 12 formatting engine cases passed before the final one-line blank guard. No browser cases were added or removed in this merge.
  • DCO passes. Remote head verified and worktree clean. The prior scrollIntoView fixture exception did not recur in this hook run; no unrelated fixture change or hook bypass was made.

Also includes the previously authorized 0.65s/0.9s spoiler timing commit. Closer motion matching to the supplied old-Buzz video is still separate follow-up, not implemented here. Hosted CI, required review and native/visual acceptance remain open; no desktop restart or native automation.

Signed-off-by: Brain <1a02c72794dcd0f07058a353bc3a81f4028b8c77c92c87fce6d5c8b85970a20b@buzz.block.builderlab.xyz>
@wesbillman

Copy link
Copy Markdown
Collaborator Author

On Wes’s behalf — Brain resolved the next main-branch conflict at 6835d26dfe16e41c71315b51918fd0f1f37b9568.

Merged #202 (fd8f0378) without rewriting published history. The sole conflict was appended CSS: retained the complete spoiler rules and exact incoming .rawDiff rules as separate top-level blocks. Composer/editor/Markdown implementation bytes are unchanged from b0520a44; auto-merged dependencies installed with the frozen lockfile.

At this head: required hooks passed 254 files / 2,661 tests, TypeScript and design types/guards. Complete diff-viewer and composer-formats browser files passed 8 cases across Chromium/WebKit, covering diff expansion/layout/focus/scroll and code/list/spoiler behavior. No new or removed browser cases. GitHub reports MERGEABLE, DCO passes, remote head verified, working tree clean. Hosted CI/review and native/visual acceptance remain separate gates; no native restart or release certification.

Brain added 4 commits September 23, 2026 21:52
Signed-off-by: Brain <1a02c72794dcd0f07058a353bc3a81f4028b8c77c92c87fce6d5c8b85970a20b@buzz.block.builderlab.xyz>
Signed-off-by: Brain <1a02c72794dcd0f07058a353bc3a81f4028b8c77c92c87fce6d5c8b85970a20b@buzz.block.builderlab.xyz>
Signed-off-by: Brain <1a02c72794dcd0f07058a353bc3a81f4028b8c77c92c87fce6d5c8b85970a20b@buzz.block.builderlab.xyz>
Signed-off-by: Brain <1a02c72794dcd0f07058a353bc3a81f4028b8c77c92c87fce6d5c8b85970a20b@buzz.block.builderlab.xyz>
@wesbillman
wesbillman merged commit ba9074d into main Sep 24, 2026
12 checks passed
@wesbillman
wesbillman deleted the brain/composer-formatting branch September 24, 2026 13:19
zrmarley added a commit that referenced this pull request Sep 24, 2026
…o-player-polish

* origin/main: (38 commits)
  Fix diff content fallback, keyboard scrolling and edit selection (#205)
  Standardize form controls and field feedback across Buzz (#174)
  Keep image review downloads and external opens distinct (#144)
  Verify media review comments (#166)
  Follow system appearance (#210)
  Add rich composer formatting and spoiler rendering (#203)
  feat: show roster-backed channels and managed instances in profiles (#188)
  Add new direct message flow (#156)
  Remove Home, start in Messages, and keep Channels enabled (#194)
  fix: restore avatar presence controls and active-input sensing (#198)
  Add legacy diff messages with inline and expanded viewing (#202)
  Edit the latest own message with Up in the existing composer (#192)
  Add complete reaction toggles to the message menu (#185)
  feat: add persistent community navigation rail (#191)
  test: add margin to warm-switch performance gate (#195)
  Add composer attachments and compatible media preparation (#183)
  Add reply and copying to the shared message menu (#182)
  fix: avoid idle workspace re-renders from activity and label churn (#186)
  feat: add devtools trace capture to web profiling (#180)
  Add optional channel templates, teams and personal group defaults (#181)
  ...

Signed-off-by: Zach Marley <zmarley@squareup.com>
zrmarley added a commit that referenced this pull request Sep 24, 2026
…-content-compat

* origin/main: (38 commits)
  Fix diff content fallback, keyboard scrolling and edit selection (#205)
  Standardize form controls and field feedback across Buzz (#174)
  Keep image review downloads and external opens distinct (#144)
  Verify media review comments (#166)
  Follow system appearance (#210)
  Add rich composer formatting and spoiler rendering (#203)
  feat: show roster-backed channels and managed instances in profiles (#188)
  Add new direct message flow (#156)
  Remove Home, start in Messages, and keep Channels enabled (#194)
  fix: restore avatar presence controls and active-input sensing (#198)
  Add legacy diff messages with inline and expanded viewing (#202)
  Edit the latest own message with Up in the existing composer (#192)
  Add complete reaction toggles to the message menu (#185)
  feat: add persistent community navigation rail (#191)
  test: add margin to warm-switch performance gate (#195)
  Add composer attachments and compatible media preparation (#183)
  Add reply and copying to the shared message menu (#182)
  fix: avoid idle workspace re-renders from activity and label churn (#186)
  feat: add devtools trace capture to web profiling (#180)
  Add optional channel templates, teams and personal group defaults (#181)
  ...

Signed-off-by: Zach Marley <zmarley@squareup.com>

# Conflicts:
#	docs/channels.md
kalvinnchau added a commit that referenced this pull request Sep 24, 2026
#203 moved the data-placeholder attribute from the composer textbox root
to a decoration on the empty paragraph inside it, leaving this journey
asserting a stale target. The visible placeholder behavior is unchanged;
point the check at the element that actually renders it.

Co-authored-by: Kalvin Chau <kalvin@block.xyz>
Signed-off-by: Kalvin Chau <kalvin@block.xyz>
morgmart pushed a commit that referenced this pull request Sep 24, 2026
…rs-support

* origin/main:
  Add Messages design gallery and tighten message layout (#158)
  Fix diff content fallback, keyboard scrolling and edit selection (#205)
  Standardize form controls and field feedback across Buzz (#174)
  Keep image review downloads and external opens distinct (#144)
  Verify media review comments (#166)
  Follow system appearance (#210)
  Add rich composer formatting and spoiler rendering (#203)
  feat: show roster-backed channels and managed instances in profiles (#188)
  Add new direct message flow (#156)

Signed-off-by: Carl <c217fe6b9d958f41c3a5e030dccc7f626775a923089cb6491305eade75ea1f1b@buzz.block.builderlab.xyz>
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