Skip to content

Formatting toolbars for Slack, Telegram and Teams drafts, with a setting to hide them - #981

Open
skullvalanche wants to merge 4 commits into
TinyComms:mainfrom
skullvalanche:skull/composer-toolbars
Open

skullvalanche wants to merge 4 commits into
TinyComms:mainfrom
skullvalanche:skull/composer-toolbars

Conversation

@skullvalanche

Copy link
Copy Markdown

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

  • feature
  • fix
  • perf
  • refactor
  • docs
  • chore

Platforms

  • windows
  • macos
  • linux
  • android
  • ios

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.png against 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 --workspace on this branch passed except two timing-sensitive chatd tests, qr_pairing_over_http_fake_relay_registers_pairs_and_renews_with_signing_key and scheduled_events_list_interest_and_gateway_updates. Each passes when run alone, twice. This change touches no chatd code, so I take them for load flakiness. I did not run them on main.

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.
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