fix(web): add destructive hover background to menu item components#35322
Merged
fix(web): add destructive hover background to menu item components#35322
Conversation
The `destructive` prop on DropdownMenuItem and ContextMenuItem only applied red text color but missed the hover background, making it inconsistent with the design intent. Add `data-highlighted:bg-state-destructive-hover` to all destructive-aware menu components and clean up the manual override in edge-contextmenu to use the prop instead. Made-with: Cursor
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #35322 +/- ##
=======================================
Coverage 85.07% 85.07%
=======================================
Files 4396 4396
Lines 201638 201638
Branches 38304 38304
=======================================
Hits 171541 171541
Misses 26994 26994
Partials 3103 3103
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
hyoban
approved these changes
Apr 16, 2026
HanqingZ
pushed a commit
to HanqingZ/dify
that referenced
this pull request
Apr 23, 2026
asukaminato0721
pushed a commit
to asukaminato0721/dify
that referenced
this pull request
Apr 24, 2026
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
The
destructiveprop onDropdownMenuItem,DropdownMenuSubTrigger,DropdownMenuLinkItem,ContextMenuItem,ContextMenuLinkItem, andContextMenuSubTriggeronly appliedtext-text-destructive(red text) but did not change the hover background color. This made destructive menu items visually inconsistent — the text turned red but hover remained the default gray (bg-state-base-hover).This PR adds
data-highlighted:bg-state-destructive-hoverto all destructive-aware menu components so that hovering a destructive item shows a red background, matching the design intent.Additionally,
edge-contextmenu.tsxwas manually overriding styles to achieve this effect. Now that the base components handle it properly, the manual overrides are replaced with thedestructiveprop.Screenshots
Checklist
make lint && make type-check(backend) andcd web && pnpm exec vp staged(frontend) to appease the lint godsFrom Cursor
Made with Cursor