Repository navigation
perf(site/src/pages/AgentsPage/components): avoid descendant :focus-within selectors #31366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c2ecaf2
413356e
82a60dd
3f6c8fc
7297b96
9627b9a
92cf177
02fb818
5389e59
de4b302
20210dc
c5a2590
ee9ed7e
446c78e
30d26d3
23da067
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -170,7 +170,9 @@ export const getAttachmentDownload = ( | |
| const DownloadOverlay: React.FC<AttachmentDownload> = (download) => ( | ||
| <AttachmentDownloadLink | ||
| {...download} | ||
| className="invisible absolute right-1 top-1 flex size-6 items-center justify-center rounded bg-surface-primary/80 text-content-secondary opacity-0 shadow-xs backdrop-blur-xs transition-opacity hover:text-content-primary group-hover/attachment:visible group-hover/attachment:opacity-100 group-focus-within/attachment:visible group-focus-within/attachment:opacity-100 [@media(hover:none)]:visible [@media(hover:none)]:opacity-100 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-content-link" | ||
| // The frame sets the blur only while the link shows, so a hidden link adds | ||
| // no compositing layer. The blur transitions with the opacity so both fade. | ||
|
Comment on lines
+173
to
+174
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. comment slop : ( |
||
| className="absolute right-1 top-1 flex size-6 items-center justify-center rounded bg-surface-primary/80 text-content-secondary opacity-(--download-opacity) shadow-xs [backdrop-filter:var(--download-backdrop-filter)] transition-[opacity,backdrop-filter] [pointer-events:var(--download-pointer-events)] hover:text-content-primary focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-content-link" | ||
| > | ||
| <DownloadIcon aria-hidden="true" className="size-3.5" /> | ||
| </AttachmentDownloadLink> | ||
|
|
@@ -184,7 +186,10 @@ const AttachmentPreviewFrame: React.FC<{ | |
| children: React.ReactNode; | ||
| }> = ({ href, displayName, downloadName, mediaType, children }) => { | ||
| return ( | ||
| <div className="group/attachment relative inline-flex flex-col items-start"> | ||
| // 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))]"> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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)
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On
mafredri marked this conversation as resolved.
Resolved
|
||
| {children} | ||
| <DownloadOverlay | ||
| href={href} | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.