Repository navigation
Formatting toolbars for Slack, Telegram and Teams drafts, with a setting to hide them - #981
Open
skullvalanche wants to merge 4 commits into
Open
skullvalanche wants to merge 4 commits into
skullvalanche wants to merge 4 commits into
Conversation
Showing it only while text was selected resized the composer and shifted the message list on every selection.
Slack drafts now show the formatting toolbar (bold, italic, strike, code, quote), paint *bold*, _italic_, ~strike~ and `code` markers in the field, and fold the markers into style spans on send and edit so formatting survives alongside mentions. Underline and spoiler are hidden for Slack.
Telegram drafts use the Discord markers and fold them into message entities on send, keeping a code fence's language and leaving masked links literal. Teams drafts reuse the markers its adapter already turns into HTML, with underline and spoiler hidden. Settings > Messages gains Show formatting bar (on by default). Off hides the bar only; shortcuts and marker painting are unchanged.
…aid there is none
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.
What changed and why
Slack, Telegram and Teams drafts now get the same formatting bar Discord has (bold, italic, strike, code, quote, plus underline and spoiler where the network can write them). Slack drafts show Slack's own markers and send them as rich text; Telegram folds its markers into message entities; Teams reuses the markers its adapter already reads. The Discord bar is always shown instead of appearing only while text is selected, which resized the composer and shifted the message list. Settings > Messages gets Show formatting bar (on by default) to hide it.
Type
Platforms
Proof
Scenario: e2e/scenarios/composer-toolbars
Lab run: (the lab posts this under
e2e-proof)To see the bar:
cargo run -p tinyclient --features gui-shot -- --shot out.pngagainst the demo directory (TINYCLIENT_DIR=<scratch> chatd --seed-demo=live), with a Slack, Telegram or Teams conversation open. Screenshots are not pasted here, as the gate asks.Compatibility
No protocol change. Only draft text and the existing Span styles are sent. Older servers and clients are unaffected. Prefs gain one line, format_bar, written only when off; an older build ignores it.
Risk and rollback
If the Slack or Telegram fold is wrong, a message goes out with literal markers or lost styling. Rollback is a revert; a user can hide the bar with Show formatting bar, which leaves shortcuts and marker painting unchanged.
Release note
Slack, Telegram and Teams drafts get a formatting bar, and Settings has a switch to hide it.
Test notes
cargo test --workspaceon this branch passed except two timing-sensitivechatdtests,qr_pairing_over_http_fake_relay_registers_pairs_and_renews_with_signing_keyandscheduled_events_list_interest_and_gateway_updates. Each passes when run alone, twice. This change touches nochatdcode, so I take them for load flakiness. I did not run them onmain.