Repository navigation
fix(site/src/pages/AgentsPage/components): keep hidden attachment controls tabbable and click-through - #31366
Conversation
This comment has been minimized.
This comment has been minimized.
|
Chat: Review posted | View chat Review history
deep-review v0.13.0 | Round 5 | Last posted: Round 5, 16 findings (6 P3, 6 P4, 4 Nit), APPROVE. Review Finding inventoryFindings
Contested and acknowledgedCRF-30 (P4, AttachmentBlocks.tsx:192) - Expired or failed framed image keeps a Download link, now tabbable and announced
CRF-4 (P3, AttachmentBlocks.tsx:190) - Download link hidden with visibility, Shift+Tab skips it
Round logRound 1Netero first pass: 2 Nit, 1 Note, no P0. Panel proceeds. Round type: round 1, full panel. Focused (TSX only): ging-ts, ging-react, nami (specialists), pariston, mafuuu (core), bisky (tests changed), gon, leorio (once-per-PR floor). Wildcard: zoro (random draw). Workspace agent disconnected mid-round; nami, pariston, mafuuu, leorio and zoro were resumed (same agents) and wrote their files after reconnect. Gon's three P2 comment findings settled at P3 (rough edge: wrong or misleading story and component comments, no runtime effect). Totals: 5 P3, 3 P4, 3 Nit, 2 Note (body), 2 dropped, 7 out of scope. Reviewed against 8ac6897..b7828d0. Round 2Churn guard PROCEED: 10 addressed, CRF-4 contested. PR rebased onto 4fd76a9 (base #31365 updated). Netero: no findings; CRF-1 and CRF-2 fixes verified. Round type: fix round (no files added or moved, no signature change, same goal, +58 effective). Panel: zoro, nami (CRF-4 dispute check-in, previous agents via message_agent), gon, leorio (comments touched, raised CRF-7 to CRF-11), bisky (CRF-11 raiser, stories changed), ging-ts, ging-react (TSX specialists). Wildcard: mafuuu (random draw from distilled set). Round 3Churn guard PROCEED: CRF-23, CRF-24, CRF-25 addressed (eab0e50). Netero: no findings; all three fixes verified, tsc and biome clean, 5 focus stories pass. Round type: fix round (one test commit, story files only). Panel: bisky, leorio, gon (raised CRF-23 to CRF-25, code touched), ging-ts, ging-react, nami (specialists for the changed .tsx story files). Wildcard: meruem (random draw from distilled set). Round 4Churn guard PROCEED: no open findings. Inventory validation: 555e1c8 hides the transcript Download link with opacity plus Round 5Churn guard PROCEED: CRF-31 addressed (d597e00, About deep-reviewCRF = Coder Review Finding (P0-P4, Nit, Note)
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
This PR moves the attachment overlays' focus-within to the card and frame and passes the state to the buttons through custom properties. Compiled with the repo's Tailwind 4.3.3, the head CSS has no descendant :focus-within rule left in site/src. Findings: 5 P3, 3 P4, 3 Nit.
Out of scope (needs a ticket or explicit acceptance by a human):
site/src/pages/AgentsPage/components/ProjectPage/ProjectChatRow.tsx:184:group-has-focus-visible:*compiles to.group:has(:focus-visible) *, a descendant focus rule of the kind this PR removes.site/src/pages/AgentsPage/components/ChatsSidebar/chats/ChatsPanel.tsx:563:group-focus-visible:opacity-100compiles to.group:focus-visible *on the Agents sidebar.site/src/pages/AgentsPage/components/ChatElements/MermaidDiagram.tsx:182:group-focus-visible:opacity-100, the same kind of rule, in the transcript.site/src/modules/notifications/NotificationsInbox/InboxItem.tsx:61:group-focus:hiddenandgroup-focus:flexcompile to.group:focus *.site/src/pages/AgentsPage/components/ChatConversation/ConversationTimeline.tsx:341:group-hover/*rules compile to.group:hover *; their WebKit cost on pointer movement is not measured by the focus bench.site/src/pages/AgentsPage/components/ChatConversation/AttachmentBlocks.tsx:173: the hover path that shows Download has no story or test, because Storybook here cannot emulate:hover.site/src/pages/AgentsPage/components/ChatConversation/AttachmentBlocks.tsx:698: an expired or failed image frame has no focusable child, sofocus-withinnever matches and Download cannot be reached by keyboard (same onmain).
Notes:
- The new and changed stories also pass with the base versions of
AttachmentPreview.tsxandAttachmentBlocks.tsx(pnpm exec vitest run --project=storybook, 76 passed both ways), so only the Pixel captures check the opacity and visibility change. - Nothing in CI checks
pointer-events: noneon the hidden buttons or the composer's new@media (hover: none)path: Pixel screenshots do not showpointer-events, and Pixel's browser reportshover: hover. This gap needs a human to accept it.
🤖 This review was automatically generated with Coder Agents.
b7828d0 to
4f40017
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Re-review of the rebased PR at 4f40017f24. Findings: 1 P3, 1 P4, 1 Nit, all in the story files.
All 11 posted round-1 findings were fixed except the Shift+Tab one on the Download link, which you contested. The reviewers who raised it accepted your defense: main already hides Download with invisible, and the frame comment now says how keyboard users reach the link. The pre-existing gap is listed below.
Out of scope (needs a ticket or explicit acceptance by a human):
site/src/pages/AgentsPage/components/ChatConversation/AttachmentBlocks.tsx:173: onmainand in this PR, Shift+Tab into a transcript attachment frame skips thevisibility-hidden Download link, and screen reader users browsing with the virtual cursor do not find it unless focus is already inside the frame.site/src/pages/AgentsPage/components/ChatConversation/ConversationTimeline.stories.tsx:1324: theAssistantMessageWithImageplay keepsexpectcalls from before this PR (image count,src, Copy message absent,toHaveFocuson View), which FE1 forbids in play functions.
🤖 This review was automatically generated with Coder Agents.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Re-review at 1c64437d01. The transcript's Download link now hides with opacity and --download-pointer-events like the composer's buttons, and its backdrop blur applies only while it shows. Findings: 2 P4, both on the attachment frame.
The new hiding fixes two items listed as out of scope earlier: Shift+Tab now reaches the Download link, and a frame without a focusable preview can reach it too. Tailwind 4.3.3 compiles the blur variable to both -webkit-backdrop-filter and backdrop-filter and emits --blur-xs. At rest the link computes opacity 0, pointer-events none, backdrop-filter none; after Shift+Tab from the end of the page it is focused with blur(4px).
Out of scope (needs a ticket or explicit acceptance by a human):
site/src/pages/AgentsPage/components/ChatConversation/AttachmentBlocks.tsx:463:RemoteImageBlockowns the expired and failed state, while its parentAttachmentBlockdecides whether to render the frame, so the component that renders the Download link cannot see that the file is gone.
Notes:
- Nothing checks that a hidden Download link has
backdrop-filter: none. A hidden link hasopacity 0, so its screenshot is the same with or without the blur, and FE1 forbids asserting computed style in a play function. This is the same gap as the hidden buttons'pointer-eventsand needs a human to accept it.
🤖 This review was automatically generated with Coder Agents.
| // Not `group-focus-within`: WebKit restyles every ancestor's subtree for a | ||
| // descendant `:focus-within` rule. The hidden link takes no pointer input but | ||
| // stays tabbable, since focus shows it; `visibility` would make Shift+Tab skip it. | ||
| <div className="relative inline-flex flex-col items-start [--download-opacity:0] [--download-pointer-events:none] [--download-backdrop-filter:none] hover:[--download-opacity:1] hover:[--download-pointer-events:auto] hover:[--download-backdrop-filter:blur(var(--blur-xs))] focus-within:[--download-opacity:1] focus-within:[--download-pointer-events:auto] focus-within:[--download-backdrop-filter:blur(var(--blur-xs))] [@media(hover:none)]:[--download-opacity:1] [@media(hover:none)]:[--download-pointer-events:auto] [@media(hover:none)]:[--download-backdrop-filter:blur(var(--blur-xs))]"> |
There was a problem hiding this comment.
P4 [CRF-30] An expired or failed framed image still renders the Download link, and 555e1c8 makes that link tabbable and announced by screen readers at rest. (Nami)
AttachmentBlock wraps RemoteImageBlock in AttachmentPreviewFrame whenever framePreview is set, and RemoteImageBlock renders AttachmentFallbackTile ("Image expired" or "Image failed to load") when the file is gone. A screen reader now reads "Image expired" followed by a Download link for that file, and Tab lands on it. On main the link was invisible at rest and reachable only by hover. RemoteTextAttachmentButton already returns the tile before building the frame; the image path needs the same ordering, so the frame or its caller has to know the image's failure state.
🤖
There was a problem hiding this comment.
On main this link already shows for an expired or failed image on hover and on devices without hover; this PR adds the keyboard and screen reader stop at rest, as for every hidden Download link. Hiding it for a failed image needs RemoteImageBlock's failure state in the frame, the ownership change this review lists as out of scope.
🤖 Posted using
/amend-reviewskill via Coder Agents.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
d597e00 to
2abe793
Compare
86dc608 to
23da067
Compare
…29596) Base: `main`. First of a stack; #31365, #31366, #31367 and #31572 follow. `useChatDropdownPosition`, which both chat composers use, sets five `--mobile-dropdown-*` properties on `<html>` from an effect that re-reads the composer's position on focus, input, selection, scroll and resize, at every width. Only below-`md` utilities read them, and a changed custom property on the root restyles every element. Browsers skip a write of an equal value, so on `main` the root restyles each time a value changes, for example when the composer grows by a line. This PR runs the effect only below `md`, where dropdown positioning is unchanged. #31278 bench (a tool, not for merging) on production builds of `f348cd66d7` (this PR's base on `main` then) and the pre-rebase version of `af7b2c7b4a` (this PR; later commits change only tests), one chat with 72k nodes at 1800 px, 3 alternating runs per side: | keystroke that wraps the composer | `main` | this PR | |---|---|---| | Chromium | 467 to 649 ms | 17 to 32 ms | | WebKit | 3,381 to 3,892 ms | 99 to 118 ms | Other keystrokes and focusing the composer did not change beyond noise. <details> <summary>Run details</summary> Each run types 560 characters after 340 prefilled ones, so the composer grows by a line 6 times in Chromium and 5 in WebKit. Each wrap cell gives min to max over the wrapping keystrokes of all 3 runs. | p50, min to max | `main` | this PR | |---|---|---| | Chromium, other keystrokes | 23 to 24 ms | 23 to 24 ms | | WebKit, other keystrokes | 97 to 99 ms | 97 to 98 ms | | Chromium focus, pointer | 11 to 13 ms | 11 to 15 ms | | WebKit focus, pointer | 271 to 332 ms | 303 to 324 ms | </details> > 🤖 This PR was created with the help of Coder Agents, and has been reviewed by a human. 🏂🏻
23da067 to
43afcdb
Compare
While a stylesheet has any `A:focus-within B` rule, WebKit restyles the whole subtree of every ancestor of the focused element on each focus change. The attachment overlays used Tailwind's group-focus-within for that. The composer's Paste inline and Remove buttons now share one wrapper that shows on hover, on focus of the preview button before it (peer-focus), and on its own subject-position focus-within. The transcript's Download link shows on peer-focus-within of the preview and is hidden with opacity only, so Tab from View still reaches it.
…ver Paste inline again Moving both overlay buttons into one wrapper after the upload overlay painted Paste inline above the overlay, where main paints it below. The wrapper now stays at opacity 1 and sets a custom property that both buttons read as their opacity, so it is no stacking context. It sits before the overlays, and Remove keeps painting above them with z-10 inside an isolated attachment root.
…to the screenshot Story play functions set up the captured state and do not assert what the DOM renders. Keep the Tab order checks, which need a browser and have no Vitest browser project, and wait for the opacity transitions so the capture shows the settled overlay.
…download link with visibility again Hidden with opacity only, the link stayed in the tab order and the accessibility tree and took clicks over the View button's corner. A peer-based `visible` did not survive the focus move from View, so Tab landed on the body. The attachment frame now sets custom properties on its own hover and focus-within, as main's group-focus-within did without a descendant selector, and the link reads them for its visibility and opacity.
…d View-focus states Add stories that end with the attachment card focused and with View focused, and drop the visibility assertion from AssistantMessageWithImage.
…om the card's focus-within The composer card now sets the buttons' opacity and visibility through custom properties on its own hover and focus-within, as the transcript's attachment frame does, and the buttons sit where they are on main. The wrapper, peer classes, pointer-events, isolate and z-10 are gone; with main's DOM order the upload overlay again paints over Paste inline and under Remove. Hidden with visibility, the buttons leave the tab order and the accessibility tree. A card whose preview is not a button (a PDF, for example) has nothing else to focus, so it shows them at rest, and devices without hover show them as the transcript does. The stories end with the card, Paste inline and Remove focused; ThumbnailFocused ended on Remove and is now RemoveFocused.
…lainly The shared play helper and args constant only saved a few lines across three stories; each story now tabs to its control and the later ones reuse CardFocused.args, as ConversationTimeline does. The waits for animations are gone: the Pixel preview disables transitions.
…sibility comments
… synchronous render
…tons in the tab order With visibility, Shift+Tab from the composer skipped Paste inline and Remove, and a card without a focusable preview showed Remove at rest, which flipped as an upload finished. The buttons hide with opacity only again, as on main; focus shows them through the card's focus-within, and a pointer-events variable keeps them from taking taps while hidden. PasteFocused and RemoveFocused now reach their buttons with Shift+Tab.
…screenshots FE1 keeps assertions out of play functions, and the Pixel capture of each focus story shows whether Tab reached its control. CardFocused focuses View, so it is now ViewFocused, and the comments say what the stories do.
…ent variables replace
…age frame at rest AssistantMessageWithImage now ends without focus, so its screenshot shows Download hidden; the Tab to Download moves to AssistantMessageWithImageDownloadFocused. The attachment card comment names the two buttons focus shows.
…ink in the tab order The transcript's Download link was hidden with visibility, so Shift+Tab from below the attachment frame skipped it and the screen reader's virtual cursor did not find it. It now hides like the composer's buttons: opacity plus a pointer-events variable from the frame's own hover, focus-within and hover:none, so it stays in the tab order and does not take clicks over View's corner while hidden.
…ly while it shows With opacity hiding, the link's backdrop-blur-xs stayed applied at rest, and Chromium composited one layer per transcript attachment: 40 images took 45 layers instead of 5. The frame now sets the backdrop filter with the link's other variables, so a hidden link has none. The frame comments now say why hidden controls stay tabbable.
The frame drops the blur variable in the same style change that starts the opacity fade, so the link showed an unblurred chip until the fade ended. Transitioning backdrop-filter with opacity fades both together and still ends at none, so a hidden link keeps no compositing layer.
43afcdb to
ef413a3
Compare
…o one line Each comment now keeps only the reason a reader cannot get from the class list: why the controls avoid group-focus-within and visibility, and why the blur is set only while the link shows.
…lur layer Chromium also composites a hidden link that keeps its backdrop filter, so naming only WebKit invited dropping the blur variable. The composer comment now words the group-focus-within reason like the frame's.
On
main, the attachment controls that show on hover or focus mishandle keyboard and pointer input:visibility, so Shift+Tab skips it. Tab from View reaches it only because focus on View shows it first.The composer's attachment card and the transcript's attachment frame now set custom properties from their own hover and
focus-within, and their controls read them for opacity, pointer events and, on the Download link, the blur. Hidden controls stay in the tab order in both directions and take no pointer input. The blur applies only while the link shows and fades with it, so hidden links add no compositing layers: with four hidden links in view, WebKit composites 5 layers onmainand 1 here. Devices without hover now show the composer's buttons at rest, as the transcript already did for the Download link.The new stories capture each focus state, including Shift+Tab onto the hidden Download link, Remove and Paste inline.