-
Notifications
You must be signed in to change notification settings - Fork 650
Fix and refactor UnderlineNav to resolve CLS issues and improve performance/code quality
#7506
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
Draft
iansan5653
wants to merge
46
commits into
descendant-registry-pattern
Choose a base branch
from
underline-nav-full-css-spike
base: descendant-registry-pattern
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+339
−662
Draft
Changes from all commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
7b8e794
Add overflow: hidden logic
TylerJDev a0e4f42
Add changeset
TylerJDev 604c035
Run format
TylerJDev 7fc6739
Update packages/react/src/internal/components/UnderlineTabbedInterfac…
TylerJDev 6921a86
Update packages/react/src/internal/components/UnderlineTabbedInterfac…
TylerJDev 1bc03b6
Update packages/react/src/UnderlineNav/UnderlineNav.tsx
TylerJDev cc8b23b
WIP: wrap items out of the way during initial render, using scroll-st…
iansan5653 be8b640
Migrate as much logic as possible to CSS, allowing elements to regist…
iansan5653 f5b4a72
Add comments about registry width
iansan5653 ff30931
Remove opacity from item
iansan5653 dfda985
Disable menu item anchor when empty and hidden
iansan5653 ab2806c
Remove unecessary memo
iansan5653 588223e
Add todo comment
iansan5653 68f2ef1
Add `overflow: hidden` to parent list
iansan5653 184ea86
Disable stylelint error for scroll-state rule
iansan5653 591b5ec
Fix failing unit tests
iansan5653 b65d397
Truncate last menu item
iansan5653 86d6897
perf(Announce): skip getComputedStyle when there is no text content t…
hectahertz 0c2358a
perf(ActionList): add content-visibility: auto to reduce style recalc…
hectahertz f25bb1c
chore(deps-dev): bump ajv from 8.16.0 to 8.18.0 (#7561)
dependabot[bot] 551ec63
perf(Button): fix CounterLabel remount, remove DEV hook, enable React…
hectahertz e0773f5
Replace overflow menu with `ActionMenu`
iansan5653 8824b2d
Clean up menu-only edge case (unreachable with truncation)
iansan5653 399300c
Migrate styles to CSS
iansan5653 500e706
Merge branch 'main' of https://github.com/primer/react into underline…
iansan5653 35735d2
Improve CSS comments
iansan5653 3deb5f9
chore: auto-fix lint and formatting issues
iansan5653 de7ff00
Replace `ResizeObserver` at container level with `IntersectionObserve…
iansan5653 e01b457
Merge branch 'underline-nav-full-css-spike' of https://github.com/pri…
iansan5653 690943a
Fix overflow: hidden
iansan5653 b06222b
Fix underline tabbed panels and swap scroll-state for animation
iansan5653 ead0546
Update assertion per updated label text
iansan5653 82d821e
Add margins to stop overflow clipping underline boundary
iansan5653 cc1e347
Fix registration ordering
iansan5653 9d3ba17
Simplify underline positioning per TODO comment
iansan5653 ec9462f
Update menu item role
iansan5653 b34a523
Update snapshots
iansan5653 c1dd8f1
Simplify calculation for underline positioning (per TODO)
iansan5653 d98c04b
Remove unecessary nbsp
iansan5653 ec2c47c
Remove spec for preserving current item in top-level menu
iansan5653 df15a1e
Add decoration to current item in overflow menu
iansan5653 eef80ba
chore: auto-fix lint and formatting issues
iansan5653 0f8782b
Merge branch 'descendant-registry-pattern' of https://github.com/prim…
iansan5653 c7abf30
Update to use descendant registry pattern
iansan5653 eacda5b
Merge branch 'descendant-registry-pattern' into underline-nav-full-cs…
iansan5653 4a90231
Revert focused test
iansan5653 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@primer/react': patch | ||
| --- | ||
|
|
||
| perf(Announce): skip getComputedStyle when there is no text content to announce |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@primer/react': patch | ||
| --- | ||
|
|
||
| perf(Button): fix CounterLabel remount and remove conditional DEV hook |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@primer/react': patch | ||
| --- | ||
|
|
||
| Add `content-visibility: auto` to ActionList items to improve rendering performance for large lists by allowing the browser to skip layout and paint for off-screen items. |
Binary file modified
BIN
-90 Bytes
(100%)
...anel.test.ts-snapshots/SelectPanel-Above-Tall-Body-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-89 Bytes
(100%)
...nel.test.ts-snapshots/SelectPanel-Above-Tall-Body-light-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-16 Bytes
(100%)
...SelectPanel-Height-Initial-with-Underflowing-Items-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-15 Bytes
(100%)
...electPanel-Height-Initial-with-Underflowing-Items-light-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-109 Bytes
(100%)
...snapshots/SelectPanel-Height-Variations-and-Scroll-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-113 Bytes
(100%)
...napshots/SelectPanel-Height-Variations-and-Scroll-light-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-83 Bytes
(100%)
...l.test.ts-snapshots/SelectPanel-With-Item-Dividers-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-86 Bytes
(100%)
....test.ts-snapshots/SelectPanel-With-Item-Dividers-light-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-3.76 KB
(76%)
...ractions-dark-Hi-43cdc-t-enough-space-to-display-all-list-items-vrt-2-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-3.78 KB
(76%)
...ractions-dark-Hi-a8f67-t-enough-space-to-display-all-list-items-vrt-1-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-3.78 KB
(76%)
...nderlineNav-UnderlineNav-Interactions-dark-Overflow-interaction-vrt-1-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-2.38 KB
(81%)
...nderlineNav-UnderlineNav-Interactions-dark-Overflow-interaction-vrt-2-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+152 Bytes
(100%)
...nderlineNav-UnderlineNav-Interactions-dark-Overflow-interaction-vrt-3-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-3.14 KB
(76%)
...nderlineNav-UnderlineNav-Interactions-dark-Overflow-interaction-vrt-4-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-4.03 KB
(75%)
...ractions-dark-co-09dc1-t-enough-space-to-display-all-list-items-vrt-2-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-4.03 KB
(75%)
...ractions-dark-co-4ae94-t-enough-space-to-display-all-list-items-vrt-1-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-4.03 KB
(75%)
...-UnderlineNav-Interactions-dark-colorblind-Overflow-interaction-vrt-1-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-2.19 KB
(82%)
...-UnderlineNav-Interactions-dark-colorblind-Overflow-interaction-vrt-2-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-205 Bytes
(99%)
...-UnderlineNav-Interactions-dark-colorblind-Overflow-interaction-vrt-3-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-3.2 KB
(76%)
...-UnderlineNav-Interactions-dark-colorblind-Overflow-interaction-vrt-4-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-2.45 KB
(83%)
...ractions-dark-di-0885b-t-enough-space-to-display-all-list-items-vrt-1-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-2.42 KB
(83%)
...ractions-dark-di-b98f2-t-enough-space-to-display-all-list-items-vrt-2-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-2.45 KB
(83%)
...eNav-UnderlineNav-Interactions-dark-dimmed-Overflow-interaction-vrt-1-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-2.01 KB
(83%)
...eNav-UnderlineNav-Interactions-dark-dimmed-Overflow-interaction-vrt-2-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-804 Bytes
(96%)
...eNav-UnderlineNav-Interactions-dark-dimmed-Overflow-interaction-vrt-3-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-3.04 KB
(77%)
...eNav-UnderlineNav-Interactions-dark-dimmed-Overflow-interaction-vrt-4-linux.png
Oops, something went wrong.
Binary file modified
BIN
-3.58 KB
(77%)
...ractions-dark-hi-277e8-t-enough-space-to-display-all-list-items-vrt-2-linux.png
Oops, something went wrong.
Binary file modified
BIN
-3.58 KB
(77%)
...ractions-dark-hi-75912-t-enough-space-to-display-all-list-items-vrt-1-linux.png
Oops, something went wrong.
Binary file modified
BIN
-3.58 KB
(77%)
...derlineNav-Interactions-dark-high-contrast-Overflow-interaction-vrt-1-linux.png
Oops, something went wrong.
Binary file modified
BIN
-1.83 KB
(85%)
...derlineNav-Interactions-dark-high-contrast-Overflow-interaction-vrt-2-linux.png
Oops, something went wrong.
Binary file modified
BIN
+550 Bytes
(100%)
...derlineNav-Interactions-dark-high-contrast-Overflow-interaction-vrt-3-linux.png
Oops, something went wrong.
Binary file modified
BIN
-2.9 KB
(78%)
...derlineNav-Interactions-dark-high-contrast-Overflow-interaction-vrt-4-linux.png
Oops, something went wrong.
Binary file modified
BIN
-4.03 KB
(75%)
...ractions-dark-tr-3b2b3-t-enough-space-to-display-all-list-items-vrt-1-linux.png
Oops, something went wrong.
Binary file modified
BIN
-4.03 KB
(75%)
...ractions-dark-tr-488ac-t-enough-space-to-display-all-list-items-vrt-2-linux.png
Oops, something went wrong.
Binary file modified
BIN
-4.03 KB
(75%)
...-UnderlineNav-Interactions-dark-tritanopia-Overflow-interaction-vrt-1-linux.png
Oops, something went wrong.
Binary file modified
BIN
-2.19 KB
(82%)
...-UnderlineNav-Interactions-dark-tritanopia-Overflow-interaction-vrt-2-linux.png
Oops, something went wrong.
Binary file modified
BIN
-900 Bytes
(96%)
...-UnderlineNav-Interactions-dark-tritanopia-Overflow-interaction-vrt-3-linux.png
Oops, something went wrong.
Binary file modified
BIN
-3.25 KB
(75%)
...-UnderlineNav-Interactions-dark-tritanopia-Overflow-interaction-vrt-4-linux.png
Oops, something went wrong.
Binary file modified
BIN
-3.66 KB
(76%)
...ractions-light-H-38ba9-t-enough-space-to-display-all-list-items-vrt-2-linux.png
Oops, something went wrong.
Binary file modified
BIN
-3.66 KB
(76%)
...ractions-light-H-42961-t-enough-space-to-display-all-list-items-vrt-1-linux.png
Oops, something went wrong.
Binary file modified
BIN
-3.66 KB
(76%)
...derlineNav-UnderlineNav-Interactions-light-Overflow-interaction-vrt-1-linux.png
Oops, something went wrong.
Binary file modified
BIN
-2.25 KB
(82%)
...derlineNav-UnderlineNav-Interactions-light-Overflow-interaction-vrt-2-linux.png
Oops, something went wrong.
Binary file modified
BIN
-1.08 KB
(94%)
...derlineNav-UnderlineNav-Interactions-light-Overflow-interaction-vrt-3-linux.png
Oops, something went wrong.
Binary file modified
BIN
-2.93 KB
(77%)
...derlineNav-UnderlineNav-Interactions-light-Overflow-interaction-vrt-4-linux.png
Oops, something went wrong.
Binary file modified
BIN
-3.65 KB
(76%)
...ractions-light-c-5b01a-t-enough-space-to-display-all-list-items-vrt-2-linux.png
Oops, something went wrong.
Binary file modified
BIN
-3.66 KB
(76%)
...ractions-light-c-617fb-t-enough-space-to-display-all-list-items-vrt-1-linux.png
Oops, something went wrong.
Binary file modified
BIN
-3.66 KB
(76%)
...UnderlineNav-Interactions-light-colorblind-Overflow-interaction-vrt-1-linux.png
Oops, something went wrong.
Binary file modified
BIN
-1.94 KB
(84%)
...UnderlineNav-Interactions-light-colorblind-Overflow-interaction-vrt-2-linux.png
Oops, something went wrong.
Binary file modified
BIN
-264 Bytes
(99%)
...UnderlineNav-Interactions-light-colorblind-Overflow-interaction-vrt-3-linux.png
Oops, something went wrong.
Binary file modified
BIN
-2.51 KB
(80%)
...UnderlineNav-Interactions-light-colorblind-Overflow-interaction-vrt-4-linux.png
Oops, something went wrong.
Binary file modified
BIN
-3.66 KB
(77%)
...ractions-light-h-7fa44-t-enough-space-to-display-all-list-items-vrt-2-linux.png
Oops, something went wrong.
Binary file modified
BIN
-3.65 KB
(77%)
...ractions-light-h-9f6e1-t-enough-space-to-display-all-list-items-vrt-1-linux.png
Oops, something went wrong.
Binary file modified
BIN
-3.65 KB
(77%)
...erlineNav-Interactions-light-high-contrast-Overflow-interaction-vrt-1-linux.png
Oops, something went wrong.
Binary file modified
BIN
-1.93 KB
(84%)
...erlineNav-Interactions-light-high-contrast-Overflow-interaction-vrt-2-linux.png
Oops, something went wrong.
Binary file modified
BIN
-525 Bytes
(97%)
...erlineNav-Interactions-light-high-contrast-Overflow-interaction-vrt-3-linux.png
Oops, something went wrong.
Binary file modified
BIN
-3.19 KB
(76%)
...erlineNav-Interactions-light-high-contrast-Overflow-interaction-vrt-4-linux.png
Oops, something went wrong.
Binary file modified
BIN
-3.66 KB
(76%)
...ractions-light-t-c1290-t-enough-space-to-display-all-list-items-vrt-1-linux.png
Oops, something went wrong.
Binary file modified
BIN
-3.65 KB
(76%)
...ractions-light-t-fd45e-t-enough-space-to-display-all-list-items-vrt-2-linux.png
Oops, something went wrong.
Binary file modified
BIN
-3.66 KB
(76%)
...UnderlineNav-Interactions-light-tritanopia-Overflow-interaction-vrt-1-linux.png
Oops, something went wrong.
Binary file modified
BIN
-1.94 KB
(84%)
...UnderlineNav-Interactions-light-tritanopia-Overflow-interaction-vrt-2-linux.png
Oops, something went wrong.
Binary file modified
BIN
-263 Bytes
(99%)
...UnderlineNav-Interactions-light-tritanopia-Overflow-interaction-vrt-3-linux.png
Oops, something went wrong.
Binary file modified
BIN
-2.81 KB
(78%)
...UnderlineNav-Interactions-light-tritanopia-Overflow-interaction-vrt-4-linux.png
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
....test.ts-snapshots/drafts-SelectPanel-External-Anchor-dark-colorblind-linux.png
Oops, something went wrong.
Binary file modified
BIN
-10 Bytes
(100%)
...anel.test.ts-snapshots/drafts-SelectPanel-External-Anchor-dark-dimmed-linux.png
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
...st.ts-snapshots/drafts-SelectPanel-External-Anchor-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file modified
BIN
-1 Byte
(100%)
...SelectPanel.test.ts-snapshots/drafts-SelectPanel-External-Anchor-dark-linux.png
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
....test.ts-snapshots/drafts-SelectPanel-External-Anchor-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file modified
BIN
+17 Bytes
(100%)
...test.ts-snapshots/drafts-SelectPanel-External-Anchor-light-colorblind-linux.png
Oops, something went wrong.
Binary file modified
BIN
+16 Bytes
(100%)
...t.ts-snapshots/drafts-SelectPanel-External-Anchor-light-high-contrast-linux.png
Oops, something went wrong.
Binary file modified
BIN
+16 Bytes
(100%)
...electPanel.test.ts-snapshots/drafts-SelectPanel-External-Anchor-light-linux.png
Oops, something went wrong.
Binary file modified
BIN
+17 Bytes
(100%)
...test.ts-snapshots/drafts-SelectPanel-External-Anchor-light-tritanopia-linux.png
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated the label of the overflow button to "More items", aligning with this issue for
ActionBar: #7437