Inside the ThreadDrawer the user is already in thread context, so showing
the "Thread" badge in the reply chip is redundant and visually noisy.
The compose box always sets replyDraft.relation.rel_type = RelationType.Thread
when threadRootId is set (so the message goes to the right thread), but that
should not make the ThreadIndicator visible there.
Add !threadRootId guard to the ThreadIndicator render condition.
Adds 4 unit tests covering the four branches of the condition.
Covers the two bugs fixed in the previous commit:
- Verifies the first button gets data-selected="true" on initial render so the
CSS highlight rule fires immediately (regression for the dep-array fix).
- Verifies the first button is also stamped when async search results load new
buttons after the initial render (the original regression).
- Verifies keyboard navigation via the AUTOCOMPLETE_NAVIGATE_EVENT moves the
selected index and that it clamps at the list boundaries.
Also adds an eslint-disable comment in AutocompleteMenu.tsx explaining why
the no-dep-array useLayoutEffect is intentional (setSelectedIndex is a stable
React setter; the conditional call cannot cause an infinite loop).
Extract the replyEvents IIFE into a module-level function so the fix-first-
then-check-length logic can be exercised in isolated unit tests without
mounting the full component.
Tests cover:
- Returns thread.events (minus root) when the Thread object has replies.
- Excludes reactions (RelationType.Annotation) from the results.
- Classic-sync regression: thread.events = [rootEvent] => falls back to the
live room timeline (the bug was that length-1 thread blocked the fallback).
- Falls back to live timeline when getThread() returns null.
- Filters out events belonging to a different thread.
- Returns [] when neither source has relevant events.
With classic sync, RoomViewHeader creates Thread objects via
room.createThread(id, rootEvent, [], false) — passing no initialEvents.
This means thread.events starts as just [rootEvent] (or empty).
Two bugs resulted:
1. The gate `if (fromThread.length > 0)` blocked the live-timeline fallback.
Since thread.events = [rootEvent], length was 1 (truthy), but after
filtering the root out the array was empty — yielding zero replies even
though the events were present in the main room timeline.
Fix: compute the filtered array first, then gate on its length so the
fallback is reached when the thread object has no actual replies yet.
2. Even after #1, subsequent renders and read-receipt logic used thread.events
(empty) rather than the live timeline.
Fix: add a mount-time useEffect that backfills matching events from the
unfiltered live timeline into the Thread object via thread.addEvents() so
the authoritative source is populated for future interactions.
Two related bugs in the mention/room/emoji autocomplete:
1. Enter key always inserted the first suggestion instead of the highlighted one.
Cause: querySelector('[data-selected]') matched ALL buttons since every button
has the attribute set to either 'true' or 'false'. The first button in DOM
order was always returned.
Fix: use '[data-selected="true"]' to select only the active item.
2. The first item had no visual highlight on initial open (the CSS rule requires
data-selected='true', but the useLayoutEffect responsible for stamping that
attribute only re-ran when selectedIndex changed -- not when buttons first
appeared after async search results loaded).
Fix: remove the dep array so the effect runs after every render; newly-loaded
buttons are stamped immediately.
- Extract scrubMatrixIds/scrubDataObject/scrubMatrixUrl from instrument.ts
into src/app/utils/sentryScrubbers.ts so they can be tested independently
- Add 43 unit tests covering token redaction, Matrix entity ID scrubbing,
URL path scrubbing (API + app routes + percent-encoded deep-links),
and scrubDataObject recursive traversal
- Add 12 RTL integration tests for TelemetryConsentBanner: visibility
gating (no DSN, pre-existing pref), Got it, dismiss, and Opt out flows
Outgoing links embedded in Matrix events (mention HTML, reply quotes)
must use https://matrix.to so other clients (Element, FluffyChat, etc.)
can parse them as Matrix permalinks. Custom base applies only to UI
navigation links (copy-to-clipboard buttons).
- matrix-to.ts: replace static hardcoded regexes with a lazily-built
cached set that matches both https://matrix.to (cross-client compat)
and the configured custom base URL (if matrixToBaseUrl is set in
config.json)
- editor/output.ts: Mention block now calls getMatrixToRoom /
getMatrixToRoomEvent instead of hardcoding the matrix.to base
- room.ts: parseReplyFormattedBody uses getMatrixToRoomEvent /
getMatrixToRoom for the same reason