-
Notifications
You must be signed in to change notification settings - Fork 51
AppSideNav::List:Link
- Fix background issue
#3032
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
Pull Request Overview
This PR fixes a background/z-index stacking issue in AppSideNav::List::Link
where focused states were being covered by subsequent list items. The fix changes the background from an explicit color to transparent, allowing proper stacking of focus states that are now implemented as box shadows.
Key changes:
- Changed background color from explicit surface color to transparent for link items
- Updated showcase to demonstrate the fix with multiple links in lists
- Added margin reset for better visual consistency in showcase
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
packages/components/src/styles/components/app-side-nav/content.scss | Sets transparent background for link items to fix focus state stacking |
showcase/app/templates/page-components/app-side-nav/index.hbs | Updates showcase to use multiple links and proper list structure to demonstrate the fix |
showcase/app/styles/showcase-pages/app-side-nav.scss | Adds margin reset for showcase list wrapper styling |
packages/components/src/styles/components/app-side-nav/content.scss
Outdated
Show resolved
Hide resolved
091dff7
to
116fd5a
Compare
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.
8641278
to
9e68039
Compare
@heatherlarsen yes, this is a known issue. While we know what a possible fix may be for it, this PR is only focusing on the background issue
yeah, nice catch! there are so many combinations and permutations that it's hard to test them all! I've added more use cases to the showcase page for the AppSideNav, related to this, and I'll move the PR to draft so that @KristinLBradley can have a proper look at it and see if the fixes to this issue are correct, if there are better alternatives, and expecially if we're covering all the use possible cases (there may be more that I have forgotten). |
From Heather:
I've been investigating the remaining focus ring issues. For the first one, when panels are used there is an overflow:hidden on the panel that causes the focus ring to be cut off. This was part of a bug fix with scrolling: Merged PR, Jira ticket The safest way to fix this bug (I think) would be to add a bit of top and bottom padding to the panel container to give the focus ring room. This would alter the layout from the AppSideNav's not using panels though. (It would probably be possible to add some tricky CSS to change the overall visual padding dependent of the AppSideNav when it contains a panel vs. not to keep the visual spacing consistent but it would be a touch messy.) It may also be possible to delete the overflow:hidden style on the panel but that risks re-introducing bugs with scrolling the AppSideNav content and is difficult to test for to account for all possible interactions related to navigating between links. For the 2nd issue, with active list item backgrounds overlapping the focus ring, I wasn't able to duplicate it so it seems that this issue may already be fixed in this PR? |
Co-authored-by: Kristin Bradley <[email protected]>
@KristinLBradley yes, that was I was hoping you could do or have more context about: do you remember why this fix was introduced, and how to replicate the issue that made us make the fix, so we can see if it's still applicable?
Yes, I would assume this is fixed with this PR, but I need you to double check the proposed solution, because it involves a bit of refactoring of |
@didoo I checked out this PR branch locally and also removed the I'll continue testing your other solution for the 2nd issue to see if I encounter issues but so far I'm not seeing any. |
@@ -130,6 +131,7 @@ | |||
// Important: This element does not doing anything when interacted with so should not change color according to state | |||
&.active, | |||
&.active:hover:focus { | |||
position: relative; // for the "active" indicator bar to be correctly positioned |
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.
So far, I haven't been able to uncover issues related to this change and the z-index above.
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.
Nice!
@KristinLBradley I have moved the PR out of draft, please review. Note: this PR fixes only the background issue; for the overflow issue you should open a distinct PR so we have better traceability of the changes we're introducing. As soon as it's open, I can review it. |
@didoo Should I create a Jira ticket or is it ok to open a PR directly? |
📌 Summary
This is a follow-up of #3026.
I've noticed that the focused state of the
AppSideNav::List:Link
items was covered by the following item in the list:The reason is that in #3026 I have applied an explicit background to it, the same color as the backdrop of their container.
This issue didn't happen in the previous implementation (

SideNav::List:Link
):The reason for this difference is that before the focus was applied via a pseudo-element, so the
z-index
would take care of the stacking, while in the new implementation of the side navigation the focus is applied as box shadow.This PR fixes the issue.
🛠️ Detailed description
In this PR I have:
AppSideNav::List:Link
to make the problem visible.hds-app-side-nav__list-item-link
👉 👉 👉 Preview: https://hds-showcase-git-sidenav-list-link-fix-backgro-cf8dad-hashicorp.vercel.app/components/app-side-nav#states
📸 Screenshots
Before:

After:

🔗 External links
Jira ticket: https://hashicorp.atlassian.net/browse/HDS-5153
👀 Component checklist
💬 Please consider using conventional comments when reviewing this PR.
📋 PCI review checklist
Examples of changes to controls include access controls, encryption, logging, etc.
Examples include changes to operating systems, ports, protocols, services, cryptography-related components, PII processing code, etc.