You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(markdown): collapsible sections in messages (desktop + mobile) #8095
Problem: long, structured bot messages (status boards edited in place, digests, reports) have no way to fold individual sections. On desktop, spoilers (||...||) hide text but keep the full layout height, so a 100-line board stays 100 lines. Mobile has no spoiler or collapsible rendering at all, and raw <details> is not rendered as a disclosure on either client.
Proposal: support a bounded collapsible block in message markdown, preferably a directive:
:::details Waiting for someone else (9)
- item one
- item two
:::
Render it as an accessible disclosure on desktop and mobile, collapsed by default, with the body rendered through the normal message markdown pipeline. Clients without support still show the title and the content as plain text.
If the open/closed state is remembered, keep it local to the device and key it by message id plus a stable section identity (for example summary text plus occurrence index), so an in-place edit of the message does not reset it. Mobile MessageContent does not receive a message id today, so it would need one.
No general raw HTML: on desktop the block can become a synthetic node the same way remarkSpoilers does, so the trust boundary stays where it is.
Open questions for maintainers:
Directive syntax (:::details Title) or a narrowly parsed <details><summary> subset?
Should the open/closed state persist across app restarts, or only for the session?
Related:#5175 (clamp a whole long message behind "Show more"). That one folds a message as a whole; this one lets the author fold named sections inside it, and the two can coexist. No other matching issue or PR found (searched: collapsible, details, fold, expand, accordion, disclosure).
I am happy to open a PR for desktop and mobile once the syntax is agreed.
Activity
feat(markdown): formatted and heading :::details titles, bold-wrapped…
fix(markdown): bound mobile title sanitizing, sections in spoilers
fix(markdown): bound mobile titles by length, not by construct
fix(markdown): section titles never build links or media on mobile
fix(markdown): accept details markers a composer paste indented
fix(markdown): accept no-break spaces inside details markers
Merge origin/main into feat/collapsible-sections
Merge origin/main into feat/collapsible-sections
Merge origin/main into feat/collapsible-sections