Fix overlapping hover and active backgrounds in sidebar items#81
Open
tusharmotwani1718 wants to merge 1 commit into
Open
Fix overlapping hover and active backgrounds in sidebar items#81tusharmotwani1718 wants to merge 1 commit into
tusharmotwani1718 wants to merge 1 commit into
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR fixes a visual issue in the sidebar where the hover background of a menu item visually overlaps with the adjacent active item.
Changes
Closes #80
Testing
Greptile Summary
This PR adds a single Tailwind utility class (
my-0.5) to the sidebar nav item class string to introduce a 2px vertical gap between items, preventing the hover background of one item from visually touching the active background of an adjacent item.navItemClass, which is used by bothSidebarNavLinkand the account menu button inSidebarFooter, so all sidebar items gain consistent spacing.absolute left-0 top-1 bottom-1) is positioned relative to the element's own box and is unaffected by the outer margin.Confidence Score: 5/5
A minimal, targeted one-class addition with no logic or data changes — safe to merge.
The only change is appending
my-0.5to a Tailwind class string. It correctly applies to both nav links and the account button (which reusesnavItemClass), and does not affect the absolute-positioned active indicator. No backend, auth, billing, or query logic is touched.No files require special attention.
Important Files Changed
my-0.5Tailwind margin tonavItemClassso adjacent sidebar items have a 2px gap that prevents hover and active backgrounds from visually blending together.Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Sidebar renders nav groups] --> B[SidebarNavLink per item] B --> C{Is item active?} C -- Yes --> D["Apply navItemClass + navItemActiveProps\n(bg-base-300/50, font-medium)"] C -- No --> E["Apply navItemClass only\n(hover:bg-base-300/50)"] D --> F["Render left accent bar\n(absolute, top-1 bottom-1)"] E --> G["No accent bar"] F --> H["my-0.5 gap separates items\nso hover bg doesn't touch active bg"] G --> H%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% flowchart TD A[Sidebar renders nav groups] --> B[SidebarNavLink per item] B --> C{Is item active?} C -- Yes --> D["Apply navItemClass + navItemActiveProps\n(bg-base-300/50, font-medium)"] C -- No --> E["Apply navItemClass only\n(hover:bg-base-300/50)"] D --> F["Render left accent bar\n(absolute, top-1 bottom-1)"] E --> G["No accent bar"] F --> H["my-0.5 gap separates items\nso hover bg doesn't touch active bg"] G --> HReviews (1): Last reviewed commit: "fix: fix sidebar hover-active overlap bu..." | Re-trigger Greptile