Repository navigation
feat(site): warn when viewing another user's chat - #24941
Conversation
|
/coder-agents-review |
There was a problem hiding this comment.
Three P3s, three nits. Clean mechanical pass (Netero found nothing); all findings are from the panel.
The feature does what it says: detects owner mismatch, shows a warning banner, prevents false positives in existing stories with the baseChatFields fix. The baseChatFields.owner_id correction from "owner-id" to MockUserOwner.id is load-bearing and catches a class of bug (wrong test data in shared fixture) beyond just the new story. The getByRole vs findByRole split between the view and page stories is correct for their respective rendering lifecycles.
The three P3s are: (1) no test verifies the banner is absent for the owner, so a flipped operator passes all stories; (2) the banner renders with present-tense "will use" on archived chats where the input is disabled, producing contradictory signals; (3) the banner says "chat owner's identity" without naming who that is, which matters when an admin has multiple non-owned chat tabs open.
Note: three reviewers flagged that the new banner carries role="alert" while the adjacent archived banner has no ARIA role. The asymmetry is defensible: the identity warning is dynamically inserted after loading (so role="alert" fires correctly for screen readers) and carries higher urgency than the read-only notice. The archived banner's missing role is pre-existing. Not posting as a finding.
"An admin at 2 AM who clicked into this chat from a support ticket doesn't know whose identity that is." (Leorio)
🤖 This review was automatically generated with Coder Agents.
|
/coder-agents-review |
There was a problem hiding this comment.
All six R1 findings addressed cleanly in one commit. The username resolution via useQuery is well-structured: the query is enabled exactly when the banner is visible, disabled when it is not, and the fallback to owner <uuid> degrades gracefully. The isArchived guard, the baseChatFields fix, and the new ArchivedOtherUserChat story are all correct. Contract tracing confirms no orphaned queries or crash paths.
Two P3s and one nit remain from this round. The nit is a stray {" "} whitespace expression in the banner JSX (DEREM-8). The first P3 is a missing story for the chatOwnerUsername=undefined fallback branch (DEREM-9). The second P3 is a gap in the page-level test coverage: no page-level story asserts the banner is absent when the viewer owns the chat (DEREM-10), so the isViewerNotOwner derivation at line 803 is tested in only one direction.
"If this comparison is broken to always return true, AdminViewingOtherUserChat still passes, every other page story silently renders the banner, and the view-level Default story misses it entirely because it bypasses the page computation." (Bisky)
🤖 This review was automatically generated with Coder Agents.
|
/coder-agents-review |
There was a problem hiding this comment.
All R2 findings addressed. Ten findings across three rounds, all fixed. The author has been responsive and thorough.
Three P3s from the R3 panel. The first is an incremental story coverage gap: the archived-non-owned path is tested at the view layer but not end-to-end at the page layer (DEREM-11). The second is an accessibility issue: role="alert" fires twice in quick succession, once with the UUID fallback, then again when the username resolves (DEREM-12). The third is a type design observation: three props encode a single concept, leaving an impossible state expressible (DEREM-13).
DEREM-12 is worth calling out: the R1 panel analyzed role="alert" for the single-insertion case and found it defensible (which it is), but the double-announcement from the fallback-to-username text mutation is a different consequence that the earlier analysis did not cover.
"At three users this is an annoyance; for any admin who regularly audits chats via keyboard it interrupts every navigation." (Hisoka)
🤖 This review was automatically generated with Coder Agents.
|
/coder-agents-review |
There was a problem hiding this comment.
All 13 findings across four rounds addressed. Zero open findings. Clean Netero pass and clean panel review (4 reviewers, 0 new findings).
The feature is well-implemented: the identity warning banner renders when a non-owner views an active chat, resolves the owner's username via a conditional query with graceful UUID fallback, suppresses correctly for archived chats, and uses role="status" with polite semantics for screen readers. The chatOwner prop consolidation eliminates the impossible state from the interface. Storybook coverage is thorough at both the view and page layers, including positive, negative, fallback, and archived paths.
The baseChatFields.owner_id fix to MockUserOwner.id was a class-of-bug correction that prevented all existing stories from silently acquiring false-positive banners.
"The gem count is zero, but the setting is honest." (Bisky)
🤖 This review was automatically generated with Coder Agents.
Shows a persistent warning banner when a user is viewing an active chat they do not own, clarifying that prompts will use the chat owner's identity. The banner resolves the owner username when available and falls back to the owner ID.
Adds Storybook coverage for owned chats, non-owned chats, archived non-owned chats, and the owner ID fallback state.