Team Chat message formatting (spoilers, code line numbers, and times that fit each reader)
Three ways to dress up a Team Chat message: hide words behind a spoiler that blurs until each reader clicks it, show line numbers down the side of a code block without ever copying them, and write a time that every reader sees in their own time zone.
On this page
Three small pieces of message formatting that behave the way people expect from Slack, plus what each one looks like on a surface that can only show plain text (a notification, a search result, a sidebar preview).
Spoilers — ||hidden words||
Put two bars on each side of the words you want to hide:
The surprise is ||we're shipping on Friday|| — don't tell anyone.
Everyone who reads the message sees a blurred patch of text in place of those words. Each reader unblurs their own copy by clicking it (or by tabbing to it and pressing Space); it stays hidden for everyone else, and it does not unblur on hover.
- It works in a channel, in a thread, in a direct message, and in the composer preview.
- A spoiler is one run of ordinary text inside a single line. It does not contain other formatting,
and a
||that has no matching||on the same line is left as plain text. - A spoiler is a politeness, not a lock — the words are in the message and a determined person can read them. Do not use it for secrets; use a private channel, or edit/delete the message.
On a plain-text surface (the notification body, the inbox alert, the sidebar and topic previews, a
search snippet, a "create task from message" title), the hidden words are replaced with the literal
word [spoiler], so a notification never gives the surprise away.
Code line numbers
A fenced code block with a language tag gets a quiet grey number down the left of every line:
```ts
const total = items.reduce((sum, item) => sum + item.price, 0)
return total / items.length
```
- The numbers live in a separate layer from the code, so the block's own copy control copies the code and nothing else — no numbers, no leading spaces, no missing final newline.
- A line that wraps onto a second visual line keeps its one number, and the wrapped part lines up under the code, not under the number.
- A block with no language tag shows no numbers, because the app may show such a block as paragraphs or as a drawn tree instead of as code. A one-line block shows no numbers either.
- Diagram blocks (mermaid, math) never show numbers.
Times — <t:1795230000>
Write a time as the number of seconds since 1 January 1970 inside angle brackets, and each reader sees it in their own clock and calendar:
Standup moved to <t:1795230000>.
<t:1795230000>and<t:1795230000:f>— date and time, e.g. "Nov 20, 2026, 10:56 PM".:t— the time only.:T— the time with seconds.:d— the short date.:D— the long date.:F— weekday, long date and time.- Hovering shows the full date and time, so an ambiguous "10:56 PM" is never the only thing a reader can see.
- A number that is not a real instant is left exactly as written.
On a plain-text surface the same token becomes a UTC date and time with the zone spelled out, e.g. "Nov 21, 2026, 3:56 AM UTC" — a notification is read on a page that has no idea which clock the person is on, so it names one.
Where these come from in the code
All three are rendering only: nothing is stored differently, no server function runs, and no Firestore rule changes.
src/renderer/src/features/team-chat/team-chat-inline-format.ts— one rehype pass over the message's markdown tree that writes the spoiler markup (a hidden checkbox the reader flips, a span that is blurred until then) and the time spans. It skips code, links and preformatted blocks, and is only attached when the message actually contains||or<t:.src/renderer/src/features/team-chat/team-chat-code-line-numbers.ts— the pass that gives each source line of a language-tagged block its own row, keeping the newlines so the block's text is unchanged.src/shared/team-chat/time-token.ts— parses the token and formats it, in the reader's zone or in UTC, through the app's one date-formatting seam.src/shared/team-chat/markdown-plain.ts—stripChatMarkdown, the helper every plain-text surface already uses, which now turns a spoiler into[spoiler]and a time token into UTC text.src/renderer/src/styles/team-chat-inline-format.css— the blur/reveal, the number gutter and the no-wrap rule for a shown time.src/renderer/src/components/ui/ChatProseBlock.tsx— attaches the two passes, so every chat surface (message list, thread, connection view, composer preview) gets them.
There is no keyboard shortcut and no toolbar button for any of these; you type the characters. The composer's formatting strip is unchanged.
Last verified 2026-11-20