Repository navigation
Run composer draft observers and assemble decorations outside the editor - #6091
Merged
ymichael merged 1 commit intoOct 21, 2026
Merged
Conversation
PromptBoxInternal now owns everything about rich-text effects that does not need the editor: it runs plugins' richText.onDraftChange observers off its own draft (100 ms debounce, per-observer error isolation, re-notified only when the text, mentions, observers or scope change) and hands the Tiptap decoration extension one ordered source list — bb's ultracode highlight, plugins' richText.effects, then setTextEffect effects. The decoration extension only paints ranges; the ultracode rule and the observer scheduling move to composer-decorations.ts. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ymichael
deleted the
bb/assemble-composer-decorations-on-the-host-thr_vtmuabsctc
branch
October 21, 2026 23:34
samantha-clanker Bot
pushed a commit
to samanthar0se/bb
that referenced
this pull request
Oct 30, 2026
Conflict resolutions: - plugin-sdk app-contract: keep local JsonObject alias; take upstream's hoisted rpc-contract import and PluginMentionTrigger import. - desktop main: keep main-instance env handoff; drop ensurePackagedUserShellPath, replaced upstream by hostToolchain (get-bb#6194). - NewThreadComposer: keep plugin metadata on submit and in the composer handle; adopt upstream's ComposerSubmitExtras and sendsOnEnter. - FollowUpPromptBox test: adopt upstream's ComposerBox mock, keep the MemoryRouter wrapper and selected-provider probe. - composer prompt-decoration test: take upstream; draft observers moved out of the editor extension (get-bb#6091). Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Human comments
What was wrong
The composer's Tiptap decoration extension mixed painting with work that doesn't need an editor: bb's built-in ultracode highlight and running plugins'
richText.onDraftChangeobservers (debounce, error isolation, draft conversion). Ahead of moving the composer into a replaceable plugin, anything left in the editor would have to be re-implemented by every composer, including bb's own product rule and the legacy observer API.What changed
apps/app/src/components/promptbox/composer-decorations.ts:composerDecorationSources()builds one ordered paint list: bb's ultracode highlight, then plugins'richText.effects, thensetTextEffecteffects.createDraftObserverRunner()runs plugins' draft observers off the host's draft: 100 ms debounce, per-observer error isolation, and re-notification only when the text, mentions, observers or scope change. Pending calls are dropped on dispose.PromptBoxInternalbuilds the decoration list and feeds the runner from its ownvalue/mentionRangesand composer view. The runner lives for as long as the component and is disposed on unmount.editor/prompt-decoration-extension.tsnow only paints the sources it's given. The ultracode rule, observer scheduling and thegetDraftObservers/draftObserverDebounceMsoptions are gone.richText.effects,richText.onDraftChangeandsetTextEffectis unchanged.How you verified
turbo run typecheck lint test --filter=@bb/app: typecheck and lint clean. The full suite passed before rebasing (648 files). After rebasing, the only failure was a timeout in the unrelatedmarkdown-incremental-piecesstreaming fixture under local load.composer-decorations.test.tscovers ultracode matching, paint order, the observer debounce and coalescing, re-notification rules, error isolation and dispose. The existingPromptBoxInternaltests driveonDraftChangethrough the real component.richText.effectsrule, asetTextEffectwhole-draft effect and anonDraftChangerecorder. Ultracode highlight (screenshots identical), plugin highlight, text effect on and off, and observer payloads and call counts were identical while typing and after pasting. Observer timing is about 3 ms later in production (paste→call 105–108 ms vs 102–105 ms on main) because the draft now arrives after React commits.🤖 Generated with Claude Code