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