Skip to content

UI: Fix floating menu button background color#32554

Merged
ghengeveld merged 2 commits into
a11y-consolidationfrom
fix-floating-button-bgcolor
Sep 25, 2025
Merged

UI: Fix floating menu button background color#32554
ghengeveld merged 2 commits into
a11y-consolidationfrom
fix-floating-button-bgcolor

Conversation

@ghengeveld
Copy link
Copy Markdown
Member

@ghengeveld ghengeveld commented Sep 24, 2025

Closes #

What I did

Resolves this problem:

Screenshot 2025-09-24 at 17 06 43

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!

Documentation

  • Add or update documentation reflecting your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli-storybook/src/sandbox-templates.ts

  • Make sure this PR contains one of the labels below:

    Available labels
    • bug: Internal changes that fixes incorrect behavior.
    • maintenance: User-facing maintenance tasks.
    • dependencies: Upgrading (sometimes downgrading) dependencies.
    • build: Internal-facing build tooling & test updates. Will not show up in release changelog.
    • cleanup: Minor cleanup style change. Will not show up in release changelog.
    • documentation: Documentation only changes. Will not show up in release changelog.
    • feature request: Introducing a new feature.
    • BREAKING CHANGE: Changes that break compatibility in some way with current major version.
    • other: Changes that don't fit in the above categories.

🦋 Canary release

This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the @storybookjs/core team here.

core team members can create a canary release here or locally with gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=<PR_NUMBER>

Summary by CodeRabbit

  • Style
    • Floating Status Button now adapts its background and shadow to light/dark themes for a more consistent look.
    • Improved visual contrast and layering in themed modes, enhancing clarity against the UI.
    • No changes to layout or positioning; appearance updates only.

@ghengeveld ghengeveld self-assigned this Sep 24, 2025
@ghengeveld ghengeveld requested review from Sidnioulz and removed request for jonniebigodes and kylegach September 24, 2025 17:36
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Sep 24, 2025

Walkthrough

In code/core/src/manager/components/sidebar/ContextMenu.tsx, a static style for FloatingStatusButton was replaced with a theme-aware style function. The new function derives background color based on theme.base (light/dark) and applies it to both background and boxShadow. Other style properties (position, right, zIndex) remain unchanged. No exported/public API changes were made.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly and accurately describes the primary change, which is updating the floating menu button’s background color, matching the dynamic, theme-aware styling implemented in the code.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-floating-button-bgcolor

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 33f4e0d and fff6a0f.

📒 Files selected for processing (1)
  • code/core/src/manager/components/sidebar/ContextMenu.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Adhere to ESLint and Prettier rules across all JS/TS source files

Files:

  • code/core/src/manager/components/sidebar/ContextMenu.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Fix type errors and prefer precise typings instead of using any or suppressions, consistent with strict mode

Files:

  • code/core/src/manager/components/sidebar/ContextMenu.tsx
🧬 Code graph analysis (1)
code/core/src/manager/components/sidebar/ContextMenu.tsx (2)
code/core/src/manager/components/sidebar/StatusButton.tsx (1)
  • StatusButton (91-93)
code/core/src/theming/base.ts (1)
  • background (46-59)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: normal
  • GitHub Check: Core Unit Tests, windows-latest
🔇 Additional comments (1)
code/core/src/manager/components/sidebar/ContextMenu.tsx (1)

31-34: Avoid hard-coded theme colors; derive from tokens to keep custom themes accurate.

Use theme colors to compute the opaque hover color, rather than fixed hexes. This keeps the button consistent across custom/dark themes and reduces brittleness.

Apply this diff:

-  // --tree-node-background-hover, but opaque to avoid layering colors
-  const background = theme.base === 'dark' ? '#1b2432' : '#ddebfa';
+  // Opaque equivalent of a 10% secondary overlay on the app background
+  const background = mix(0.1, theme.color.secondary, theme.background.app);

And add this import at the top of the file:

import { mix } from 'polished';

Please verify with:

  • Default and custom themes (light/dark), including any brand themes.
  • Hover/focus states of StatusButton remain legible on the new background.
  • The boxShadow “halo” doesn’t bleed awkwardly against neighboring surfaces.

Comment @coderabbitai help to get the list of available commands and usage tips.

@ghengeveld ghengeveld changed the base branch from next to a11y-consolidation September 24, 2025 17:37
@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Sep 24, 2025

View your CI Pipeline Execution ↗ for commit fff6a0f

Command Status Duration Result
nx run-many -t build --parallel=3 ✅ Succeeded 50s View ↗

☁️ Nx Cloud last updated this comment at 2025-09-25 11:07:38 UTC

Comment thread code/core/src/manager/components/sidebar/ContextMenu.tsx
@storybook-app-bot
Copy link
Copy Markdown

Package Benchmarks

Commit: fff6a0f, ran on 25 September 2025 at 10:55:48 UTC

The following packages have significant changes to their size or dependencies:

@storybook/vue3-vite

Before After Difference
Dependency count 109 109 0
Self size 38 KB 38 KB 0 B
Dependency size 43.76 MB 43.77 MB 🚨 +12 KB 🚨
Bundle Size Analyzer Link Link

@ghengeveld ghengeveld merged commit 1c053c0 into a11y-consolidation Sep 25, 2025
46 of 54 checks passed
@ghengeveld ghengeveld deleted the fix-floating-button-bgcolor branch September 25, 2025 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants