Skip to content

fix(web): add destructive hover background to menu item components#35322

Merged
lyzno1 merged 1 commit intomainfrom
cursor/fix-destructive-menu-item-hover-bg
Apr 16, 2026
Merged

fix(web): add destructive hover background to menu item components#35322
lyzno1 merged 1 commit intomainfrom
cursor/fix-destructive-menu-item-hover-bg

Conversation

@lyzno1
Copy link
Copy Markdown
Member

@lyzno1 lyzno1 commented Apr 16, 2026

Summary

The destructive prop on DropdownMenuItem, DropdownMenuSubTrigger, DropdownMenuLinkItem, ContextMenuItem, ContextMenuLinkItem, and ContextMenuSubTrigger only applied text-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-hover to all destructive-aware menu components so that hovering a destructive item shows a red background, matching the design intent.

Additionally, edge-contextmenu.tsx was manually overriding styles to achieve this effect. Now that the base components handle it properly, the manual overrides are replaced with the destructive prop.

Screenshots

Before After
Destructive items hover with gray background Destructive items hover with red background

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran make lint && make type-check (backend) and cd web && pnpm exec vp staged (frontend) to appease the lint gods

From Cursor

Made with Cursor

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
@github-actions github-actions Bot added the web This relates to changes on the web. label Apr 16, 2026
@lyzno1 lyzno1 marked this pull request as ready for review April 16, 2026 11:54
@lyzno1 lyzno1 requested review from iamjoel and zxhlyh as code owners April 16, 2026 11:54
@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Apr 16, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.07%. Comparing base (3445469) to head (7b8ff69).
⚠️ Report is 1 commits behind head on main.

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           
Flag Coverage Δ
web 86.27% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lyzno1 lyzno1 enabled auto-merge April 16, 2026 12:06
@lyzno1 lyzno1 added this pull request to the merge queue Apr 16, 2026
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Apr 16, 2026
Merged via the queue into main with commit e507675 Apr 16, 2026
33 checks passed
@lyzno1 lyzno1 deleted the cursor/fix-destructive-menu-item-hover-bg branch April 16, 2026 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files. web This relates to changes on the web.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants