Fix review: H-L3-10 (a block folds a member's words only in the message list)

From mnema-talk v3.3.13, rendered on this site.

Fix: branch msch128/fix-h-l3-10, commit 2bc7f96b0 "fix: fold a blocked member's words on every surface, not only in the message list". Reviewed that commit only, in a clean temporary worktree (npm ci; removed afterwards). Nothing changed in the repository, nothing pushed.

Verdict: MERGE

The cause the finding and the refuter describe (the fold was a property of two list components) is removed: one placeholder component, web/src/shared/components/BlockedFold.vue, wraps every surface the finding and the refuter executed, and the decision stays in one place (useBlocksStore().hides). The recorded test is a normal test and fails when the fix is reverted. No gate is weakened, the public API change is additive, and no defect was found that has a concrete failing scenario against the fix's own scope. The SHOULD-FIX items below are follow-ups, not merge blockers.

Coverage of the finding's variants

Variant (finding / refuter)Fixed?Evidence
"replied to" line (ReplyPreview, used by MessageRow and ThreadReply)yesblockedElsewhere.test.ts; own probe P1
reply line live update on the blocked member's edit (markPreviewEdited)yesown probe P1: props changed to new text while blocked, still folded
search hityestest
search thread-root snippetyes, with a new user_id on chat.SearchRoottest, integration test
forwarded quoteyestest
pin listyes (also hides the author line)test
saved itemsyes (note and remove button stay)test
forum post card (title, excerpt, thumbnail, aria-label)yestest
title above an open forum post (ForumPostHeader)yestest
reminders list and due-reminder in-app notice / OS notificationyes, with a new author_id on later.MessageReftest; laterNotices.ts uses the same text for the toast and platform.notify
PinNoticesnot needed: shows the actor's name onlyread
typing indicatornot changed: name only, no wordsread
event comments (refuter: read only, "not messages")noown probe P6, see SHOULD-FIX 1

What I ran

  • npx vitest run src/chat/components/blockedElsewhere.test.ts plus the tests of every touched component (SearchResultItem, SearchResults, forum/components, PinnedMessages, SavedLaterPanel*, Forward, ChatAreaDm, ThreadSidebar, LaterDialog, MessageRow*): 24 files, 260 tests, all pass.
  • Revert check: restored the nine production files (ReplyPreview, ForwardedQuote, SearchResultItem, PinnedMessages, SavedEntry, LaterList, ForumPostCard, ForumPostHeader, laterNotices.ts) to the parent commit and ran blockedElsewhere.test.ts: 10 of 12 cases fail (the control and the not-blocked case pass), as the commit message says.
  • Own probes (temporary test file, deleted), all inputs not in the tests:
    • P1: reply line, original edited by the blocked member after mount (setProps with new text): stays folded.
    • P2: Show on a reply line, then an edit by the blocked member: stays revealed (keyed by message id). Unblock then re-block in the same session: folded again (unblock clears the revealed set).
    • P3: Show inside a selected search hit does not emit select; Show inside a forum card (Enter keydown and click) does not open the post; after Show the words appear. Focus after Show in the card: document.activeElement is <body>.
    • P4: a search root without user_id (older server): the root text is shown (no fold possible; graceful degradation, no error).
    • P5: server feature blocks off: nothing folds.
    • P6: an event comment by the blocked member: the words are rendered.
  • Full vitest, 3 workers: 653 files passed, 2 skipped; 11874 tests passed, 18 expected fail, 96 skipped; no failure.
  • src/compat (response and request compatibility baselines): 1506 passed, 3 skipped.
  • Go: go vet (with and without -tags=integration) on internal/chat/search, internal/later, internal/server: clean. Integration (real Postgres, -v, not skipped): TestSearchReplyHitsCarryRootSnippets PASS, TestListingRemindersReadsTheirMessagesInOneQuery PASS.
  • make openapi-check (document not stale): OK. make openapi-diff: "no breaking changes since v3.0.8". npm run contracts:check: OK.
  • ESLint on all touched web files (includes the import-zones rule and max-lines): clean. vue-tsc app and tests configs: clean. scripts/check-english-only.mjs: clean. make complexity-check: exit 0.

Findings

SHOULD-FIX

  1. Event comments are not folded. web/src/events/components/EventComments.vue:127 renders c.content with no block check. Probe P6: a comment whose user.id is the blocked member shows its words in full. The finding did not claim this surface and the refuter excluded it ("comments, not messages"), so it is not a gap in this fix. My view: a member reading "You don't see messages from members you block" would count a comment under an event as a message of that member; the new doc list in doc/moderation.md enumerates the surfaces and does not name event comments, so the doc is accurate but the promise in settings is broader. Wrap the comment body in BlockedFold (the comment has an id and user.id) in a follow-up, or name the exception in doc/moderation.md.

  2. Focus is lost after Show. BlockedFold.vue:30-37: the Show button is replaced by the slot (v-if/v-else), so the focused element leaves the DOM and focus falls to <body> (probe P3). A keyboard or screen-reader user loses their place in the pin popover, saved list, forum list or the message list. This was already true for the old BlockedMessageRow in the list (the row was swapped for a MessageRow), so it is not a regression there, but the fix spreads it to six more surfaces. Suggest: after reveal, move focus to the revealed content (for example the first focusable element of the slot or a wrapper with tabindex="-1") on nextTick.

  3. Nested interactive content in two places. In SearchResultItem.vue the Show button sits inside role="option" (the root div, listbox driven by the search input through active-descendant), and in ForumPostCard.vue inside an article with role="button". Children of an option are presentational to assistive technology, and an interactive element inside a role="button" is an axe "nested-interactive" violation; in search the button is reachable only by Tab or pointer, not by the arrow keys that drive the list. The fold itself works (the accessible name of the option or card no longer contains the words; the card's aria-label is replaced by "Blocked message"). Functional click and Enter isolation is correct (click.stop, keydown.enter.stop; probe P3). Suggest a follow-up that lets Enter on a folded option reveal it, or moves the Show control outside the option/card role.

NOTE

  1. Forum title filter. The forum search box (useForumPosts.ts:130-132) is a server query. Typing a word lists a folded card whose title matches. This shows no words; it lets the blocker confirm, by their own query, that a folded post's title contains a word they typed. Same class as the global search hit count that doc/moderation.md now names ("a hit still counts in the number of results"). Not covered by the promise in my reading (the blocker searches, nothing is shown). Adding "and the forum filter" to that doc sentence would make it complete.

  2. Reminder push unfiltered. The server-side push of a due reminder carries the snippet (documented in doc/moderation.md by the fix). It is the blocker's own reminder on a message they could read when they set it. It does show words without a Show, and it is inconsistent with the decision to fold saved items, but it is a pushed copy of the blocker's own bookmark and the doc says so. Acceptable as documented; a later server change could send the generic text when the author is blocked.

  3. Reveal state. One reveal path: Show adds the message id to the session's revealed set (stores/blocks.ts); every surface keys by the original message id (reply preview id, quote message_id, search root id, saved message_id, reminder message.id, forum post id), so Show on one surface reveals that message everywhere and nothing else (test, probe P2). Reset: on reload (in-memory), on reset(), and on an unblock made in this tab (revealed.clear()). An unblock or re-block made on another device arrives as block_updated, which only reloads the list and keeps the revealed set; pre-existing, minor. A later edit of a revealed message stays revealed (probe P2); consistent with "showing one message shows it everywhere until the page is reloaded" and with the previous list behaviour; I consider it intended.

  4. ForwardedQuote.vue:49 keys the fold by quote.message_id ?? msg.id. message_id is optional in ChatForwardQuote; if a server ever sent an available quote without it, Show would add the forwarding message's id to the revealed set. Harmless (that message is not by the blocked member unless it is folded anyway), noted only.

  5. Reminder row hides its due marker. When a reminder's message is folded, LaterList.vue folds the whole open button, including the channel name and the "Due" badge, so the blocker does not see that the reminder is due until Show. Design choice; the mark-done and snooze controls stay.

  6. omitempty on a uuid.UUID. internal/chat/search/search_roots.go and internal/later/visibility.go: uuid.UUID is a 16-byte array, so omitempty never omits it. The fields are always sent. Harmless (both come from messages.user_id through an inner join on users, never nil) and the OpenAPI marks them optional, which is what clients need.

  7. Surfaces outside the promise that keep a blocked member's name, not words: search hit header (name, avatar), forum card footer (name, avatar), poll voter names (PollCard.vue:86), typing indicator, mention autocomplete, PinNotices. The promise is about messages; names are not folded in the list either (the folded row is placeholder-only, but the member list still shows them). Not covered in my reading.

Own sweep of web/src

Searched for every component rendering message content, snippets or titles (previewText, .content, snippet) and for every platform.notify caller, and compared with the fix's list.

SurfaceState after the fixCovered by the promise?
Notification centrenone exists beyond the mentions inboxn/a
Mentions inbox (MentionsInbox.vue:90)not wrapped; server leaves blocked authors out (core.AuthorHiddenFrom)yes, already met
Unread jump bar / dividerno textn/a
Channel list preview linesonly DMs have previews; filtered client and server (stores/chat/dms.ts:242)yes, already met
Thread listno such surface; thread panel folds root and repliesyes, met
Member profile recent activityUserProfileModal.vue renders no messagesn/a
Embeds and link previewsMessageEmbeds renders inside the message row or thread root (folded with it); forwarded content is text in ForwardedQuote (folded)yes, met
Poll results voter namesnames onlyno (names)
Reactions tooltipemoji and count only (ReactionBar.vue:69), no namesn/a
Mention autocompletemember names onlyno (names)
Mobile layoutssame components with responsive classes; no separate mobile surfacemet
Print or export viewsnone in web/srcn/a
Desktop bridge / OS notificationsplatform.notify has three callers: message notifications (blocked authors return early, stores/chat/events.ts:148), DM calls (blocked caller returns, stores/chat/dmCalls.ts:91), due reminders (folded text)yes, met
Edit history dialogreached from a message's menu, which a folded message does not offermet
Admin report detailmoderator tool, shows reported content by designno (moderation)
Event commentsnot folded (SHOULD-FIX 1)arguably yes
Wiki pages and historynot messagesno

Other checks

  • New response fields: chat.SearchRoot.user_id and later.MessageRef.author_id are added as optional properties in api/openapi.json (not in required); openapi-diff reports no breaking change; generated decoders accept their absence (!hasOwn(...) || isIdentifier(...)), so answers of an older server still decode (compat baselines pass); old clients decode with hasOwn on known keys only, so they ignore the new field. Privacy: the search root lives in the same channel as the hit the caller may read and already carries the author's username and display name; the reminder ref is rechecked for access on every read and already carries the author's name; message objects elsewhere already carry user_id. No new information.
  • Server filtering: unchanged; the server still filters nothing for search and lists, as core.BlockExists says; doc/moderation.md now states that the client folds them and that hits still count.
  • Import zones: shared/components/BlockedFold.vue imports only stores/blocks and an icon; no feature module. ESLint import-zones rule passes.
  • Performance: hides() is two Set lookups (ids is a computed Set; revealed a reactive Set, read only when the author is blocked). The fix adds one small component instance per wrapped surface (in the message list only for rows with a reply line or a forward). No concern for long lists.
  • Gates: no allowlist entry, no raised limit, no skipped test; the three it.fails are flipped to normal tests. Touched files are well under 400 lines. English only. Commit type fix, no !. doc/moderation.md matches the new behaviour.

Not checked

  • Real browser rendering and screen-reader output (jsdom only); the nested-interactive and focus findings are from the DOM structure and document.activeElement, not from an assistive technology run.
  • The desktop client repository (no change needed there by this commit; not opened).
  • Server-side push payload contents (read from the doc, not run).

Second round: commit 85d0bb746

Reviewed only 85d0bb746 ("fix: fold event comments, keep focus after Show, and no Show nested in a search option or card"), on top of 2bc7f96b0, in a fresh temporary worktree (npm ci; removed afterwards). Nothing changed in the repository, nothing pushed.

Verdict: MERGE. All three SHOULD-FIX items are closed. One new SHOULD-FIX (a focus target in the wrong pane) and a few notes remain; none of them blocks the merge.

The three items

  1. Event comments: closed. EventComments.vue wraps the comment body in BlockedFold, keyed by the comment id and c.user.id. The delete dialog's excerpt says "Blocked message" while the comment is folded. Own probe: a comment by the blocked member containing a Markdown link is folded, and after Show focus lands on the link inside it. doc/moderation.md now names event comments.

  2. Focus after Show: closed, with one gap (SHOULD-FIX R2-1 below). BlockedFold renders two hidden marker spans only in the instance where Show was pressed (shownHere). shared/lib/revealFocus.ts then focuses, in this order:

    • the first focusable element between the markers;
    • else a control around them;
    • else the first revealed element, given tabindex=-1.

    When the whole row is replaced, it looks the row up by data-msg-id / data-reply-id. Own probes:

    • Show in a reply line moves focus into that line (to its jump button).
    • Show on a folded forum card moves focus to the card, which is a role=button again.
    • Show on an event comment moves focus to the first link of the comment.
  3. Nested interactive roles: closed.

    • Search: in passive mode a hit has no button. "· Show" is visible text with aria-hidden, and the screen-reader-only sentence "Press Enter to show it." is read out. SearchModal.handleSelect (reached by Enter on the input or the list, and by a click) reveals a folded hit, or its folded thread root, instead of opening it.
    • Forum card: while folded it has no role, tabindex, aria-label or open handler (own probe: all three attributes absent; click and Enter on the card emit nothing). After Show it is the button again, and Enter opens the post (probe: one select).

"First Enter reveals, second opens": no trap

  • Keyboard. Each Enter adds exactly one message id to the revealed set, so hides() turns false for it and the next Enter makes progress. Selection does not move. Old servers send no root user_id, so a root is never "folded" there and needs no extra press.
  • Hit and root both folded. Own probe: 3 presses (reveal the hit, reveal the root, open). This is sensible, because each press shows something new, and it ends.
  • Hit not folded, root folded. The author's test plus my reading: 2 presses (reveal the root, then open).
  • Mouse and touch. Both go through the same click handler on the option, with the same progression. Touch has no separate path; @mousedown.prevent keeps focus in the input.
  • Escape. Still closes the dialog at any point.
  • Forum card. While folded, Show is the only control, a real button that Tab and touch reach, so nothing traps there either. NOTE: the folded card keeps cursor-pointer and its hover style, so a mouse user who clicks the card body gets no response and has to hit "Show". This is cosmetic.

Focus is not stolen

  • Revealed elsewhere. Own probe: an input has focus and two mounted reply lines show message m1. reveal('m1') is called from elsewhere and both reply lines unfold. Focus stays on the input, because focusRevealed runs only inside show() of the instance whose button was pressed.
  • Re-render after Show. After Show in instance c, I focused another element and changed c's props (an edit). Focus stayed where it was, because the markers remain but no focus call is repeated.
  • Mounting already-revealed messages. Lists that re-render with revealed messages get no markers and no focus call: shownHere is per instance and starts false.

New findings

SHOULD-FIX R2-1: the row lookup can focus the wrong pane.

  • Where: revealFocus.ts:29-33. When the marker is gone because BlockedMessageRow unmounted, focus goes to document.querySelector('[data-msg-id=X], [data-reply-id=X]'), which is the first match in document order.

  • When it happens: the thread root of a channel thread is shown twice, folded:

    • in the channel list (MessageRow/BlockedMessageRow, data-msg-id);
    • in the thread panel (BlockedMessageRow compact, data-msg-id; after Show, ThreadRootCard with data-reply-id).

    When Show is pressed in the thread panel, both unfold, and focus goes to the channel list's row, which comes first in the DOM, not to the thread root card the user was in.

  • Evidence: a synthetic probe with a list element and a thread element carrying the same id; focusRevealed(null, null, id) focused the list element. The full two-pane mount was not run; the scenario follows from both components carrying the root's id.

  • Impact: a keyboard user is moved to the other pane, possibly to a row scrolled out of view (preventScroll).

  • Suggested fix: remember the placeholder's closest scroll container, or the BlockedMessageRow root's parent, before revealing, and search only inside it.

NOTE R2-2. revealFocus.ts:20-21 adds a focus:outline-hidden class and tabindex=-1 directly to an element Vue manages. The next class patch of that element drops the class, while tabindex stays. The only effect is a possible outline on a later script focus. Cosmetic.

NOTE R2-3. In search, revealing by Enter changes the active option's text, but nothing is announced. The option is referenced by aria-activedescendant, and screen readers do not always re-read it when its content changes. The sr-only sentence "Press Enter to show it." is also keyboard-worded for mobile screen-reader users, who double-tap. A polite live region saying "Shown" would close this. Minor.

i18n

  • The new key blocks.showWithEnter is added to en.json and de.json. These are the only two locale files in web/src/i18n.
  • npm run i18n:check (strict): 0 findings.
  • The German text of the hint uses the right pronoun for its noun.

What I ran (second round)

  • Revert check. I put BlockedFold, SearchModal, SearchResultItem, ForumPostCard and EventComments back to 2bc7f96b0 and ran blockedElsewhere.test.ts and SearchModal.test.ts: 8 failed, 39 passed. That matches the commit message.
    • The 8 failures: search option, forum card ×2, forum title focus, event comment, focus in the pin list, row focus in the list, and the SearchModal reveal-then-open test.
  • Own probes: S1, F1, F2, K1 and C1 above, in a temporary test file that I deleted afterwards.
  • Full vitest, 3 workers: 653 files passed and 2 skipped; 11880 tests passed, 18 expected fail, 96 skipped; no failures.
  • Checks on the touched files: vue-tsc --noEmit for tsconfig.app.json and tsconfig.tests.json both clean; ESLint clean; scripts/check-english-only.mjs clean.
  • Not run: a real browser or assistive technology. The focus and announcement findings come from jsdom and the DOM structure.

Something wrong on this page? Tell us.