Skip to content

fix(defaultModel): prevent star button injection into non-model menus - #481

Merged
Nagi-ovo merged 1 commit into
mainfrom
Nagi-ovo/fix-default-model-inject
Mar 12, 2026
Merged

fix(defaultModel): prevent star button injection into non-model menus#481
Nagi-ovo merged 1 commit into
mainfrom
Nagi-ovo/fix-default-model-inject

Conversation

@Nagi-ovo

@Nagi-ovo Nagi-ovo commented Mar 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • The fallback selector .mat-mdc-menu-panel[role="menu"] was too broad, causing default-model star buttons (gv-default-star-btn) to appear in the settings dropdown and theme picker submenu
  • Added :not(.desktop-settings-menu) to the fallback CSS selector to exclude the settings menu
  • Added isModelMenu guard in injectStarButtons() requiring .title-and-description, .mode-title, or [data-mode-id] — markers absent from non-model menus like the theme picker (which uses menuitemradio but lacks model-specific DOM structure)

Test plan

  • Added test: settings menu (desktop-settings-menu) does not receive star buttons
  • Added test: theme submenu (menuitemradio without model markers) does not receive star buttons
  • All 15 existing + new tests pass
  • Manual: open Gemini settings dropdown → verify no star icons on menu items
  • Manual: open Theme submenu → verify no star icons on 系统/浅色/深色 items
  • Manual: open model selector → verify star icons still work correctly

🤖 Generated with Claude Code


Open with Devin

The fallback selector `.mat-mdc-menu-panel[role="menu"]` was too broad,
causing default-model star buttons to appear in the settings dropdown
and theme picker submenu. Fix with two layers of defense:
1. Exclude `.desktop-settings-menu` from the fallback CSS selector
2. Add isModelMenu guard requiring `.title-and-description`, `.mode-title`,
   or `[data-mode-id]` before injecting — markers absent from non-model menus

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

@Nagi-ovo
Nagi-ovo merged commit c111063 into main Mar 12, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant