Repository navigation
Conversation
Add a device setting, Settings → Appearance → Format messages with markup, that keeps typed Markdown delimiters as raw text instead of converting them to formatting as you type. Messages are still sent as the Markdown that was typed and render formatted. Off by default; when off, the composer converts exactly as before. Co-authored-by: Kamaji <076770de4ae8127da02d45adc3a2b673ef58f263632db16fdbfcc0c0db8c1a25@buzz.block.builderlab.xyz> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Damien Dormal <ddormal@squareup.com>
This branch has not been deployed
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.
Why
Since #455, the composer converts Markdown as you type:
**x**turns bold on the closing delimiter, three backticks open a code block, and-starts a list. Some people would rather see and edit the Markdown source, as Slack's Format messages with markup preference allows. This adds that as an opt-in device setting. Messages are still sent as the Markdown that was typed and still render formatted in the timeline.What
markup-preference.ts, which follows theautocorrect-preference.tspattern: thebuzz-message-markup.v1localStorage key, auseMessageMarkupPreferencehook, unsaved-choice recovery, and amarkupSettingDeviceSetting(conversations.markup) registered indevice-settings.ts, so agents can read and change it.EditableInputskips the typed-delimiter conversion block when the setting is on. New messages and edits to sent messages both go throughMessageComposer → RichComposerInput → EditableInput, so this one gate covers both. With the setting off, nothing changes.docs/buzz-help.mdgets an entry for the setting and adds it to the list of settings agents can change.Not changed: paste handling, the formatting toolbar and ⌘B, and the serializer. Toolbar formatting still applies when the setting is on.
Known limitation: with the setting on, if you bold
foowith ⌘B and then type raw**bar**directly after it, with no space, the message is sent as**foo****bar**and the stars show. With the setting off, the typed span converts and merges into the bold, so this only affects people who opt in.Tests
EditableInput.test.tsxadds 9 tests for the setting turned on. Typing**bold** and *it* _also_ ~~gone~~ `code`, a```fence, a~~~fence,-,*,1.and>leaves raw text with no formatting nodes, andcomposerMarkdownreturns exactly what was typed, so the serializer needs no change. Other tests cover typing into an existing draft (the edit case) and turning the setting off live, after which the next delimiter converts again.!current.current.markupgate removed, all 9 fail. With the setting off, the existing conversion tests still pass.AppearanceSettings.test.tsxchecks that the switch is shown without Mac WebKit, starts off, persists, followsstorageevents, and retries an unsaved choice.device-settings.test.tschecks that the setting is listed and that its setter, event and unsaved states work.vitest run src/features/messages src/app/AppearanceSettings.test.tsx src/app/device-settings.test.ts: 103 files and 3075 tests, all passing.tsc --noEmitand biome are clean, and the pre-commit and pre-push hooks passed.CIworkflow is waiting (action_required) for a maintainer to approve the run. Only DCO, Semgrep and zizmor have run so far. I'll post local results for what CI runs as a comment.Not yet exercised in the running app (
just desktop). Damien will try it before this is marked ready.🤖 Generated with Claude Code