Skip to content

[Button] Improve readability of permission-disabled buttons - #1862

Closed
vivekmaurya001 wants to merge 4 commits into
layer5io:masterfrom
vivekmaurya001:visibility-text
Closed

vivekmaurya001 wants to merge 4 commits into
layer5io:masterfrom
vivekmaurya001:visibility-text

Conversation

@vivekmaurya001

@vivekmaurya001 vivekmaurya001 commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Notes for Reviewers

This PR fixes #1805
removed extra fading and maded disabled button text darker

Signed commits

  • Yes, I signed my commits.

Summary by CodeRabbit

  • Bug Fixes
    • Permission-restricted buttons remain disabled and use the theme’s default text color in light mode; existing dark-mode colors and caller-provided styles are retained.
    • Carousel navigation buttons are hidden when scrolling in their direction is unavailable.
  • Accessibility
    • Carousel navigation buttons now have accessible labels, and catalog design names can receive keyboard focus.
  • Style
    • Catalog design names can wrap to two lines, with overflow indicated by an ellipsis. Hovering or focusing a name reveals its pattern name.
  • Documentation
    • Updated design guidance and the security vulnerability reporting contact.

@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8df34e92-b288-4f24-99f9-5d88c3d0747c
📥 Commits

Reviewing files that changed from the base of the PR and between cea1654 and 89be399.

📒 Files selected for processing: 1
  • src/base/Button/Button.tsx
🚧 Files skipped from review as they are similar to previous changes: 1
  • src/base/Button/Button.tsx

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

📝 Walkthrough

When a button lacks its required permission, it remains disabled. In light mode, it applies a disabled text color from theme.palette.text.default and combines this conditional style with caller-provided sx styles. In dark mode, the conditional style adds no override.

Changes: Permission-denied button styling

Layer / File(s) Summary
Disabled text color
src/base/Button/Button.tsx
The permission-denied button applies a light-mode text color override to its disabled state. The conditional style is combined with caller-provided sx input.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: maanvi212006

Merge Risk: ⚪ Minimal · up to 89be3

This change improves disabled-button text readability in light mode. No actionable merge-blocking risk was identified.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Linked Issues check Passed Issue #1805 requires readable text contrast in light mode for the Native Button Gating demo. In src/base/Button/Button.tsx, the permission-denied button applies theme.palette.text.default to `.Mui…
Out of Scope Changes check Passed The whole-PR diff changes only src/base/Button/Button.tsx. The change is limited to the permission-denied button style and preserves caller-provided sx values. The change directly supports issue #…
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly describes the main change: improving readability for buttons disabled by permission requirements.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@Maanvi212006 Maanvi212006 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.

Can you attach a short screen recording or before/after screenshots of the whole permissions page in light and dark mode, including Export Design / Manage Roles buttons ? Removing the shield's opacity affects them too, and the goal is that the native button looks identical to those.

@Maanvi212006 Maanvi212006 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.

Also, please add sign-off to the commit. You can follow the steps on this page to do so.

@vivekmaurya001

Copy link
Copy Markdown
Contributor Author

@Maanvi212006 please check, I have removed affects on others and included the video

@Maanvi212006 Maanvi212006 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.

looks good! the text is readable in light now in light mode.

  1. resolve the DCO failure

  2. open an issue to apply the same fix to "Create Workspace" and "Manage Organizations (Needs AnyOf)" button on this page.

@leecalcote leecalcote left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @vivekmaurya001 for picking up #1805, the before/after recordings make the improvement easy to see, and merging the caller's sx (array or object) rather than overwriting it is careful work.

Things to address:

  • The DCO check is failing. Could you sign off your commits (git commit --amend -s or git rebase --signoff) and force-push?
  • The override only applies in light mode. If dark mode has the same readability issue, it would be nice to handle both, otherwise a short comment explaining why dark mode is excluded helps future readers (inline note).
  • The title could be more descriptive, for example [Button] Improve readability of permission-disabled buttons.
  • There is an outstanding changes-requested review; please make sure those points are addressed too.

disabled
sx={[
(theme) =>
theme.palette.mode === 'light'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is dark mode intentionally left unchanged? If disabled text is also hard to read there, using a single token that works in both modes (rather than branching on palette.mode) would keep the two themes in parity. If light-only is intentional, a one-line comment here would help.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@leecalcote dark mode texts are readable hence currently i have maded changes related to light mode specifically

@vivekmaurya001
vivekmaurya001 force-pushed the visibility-text branch 2 times, most recently from df453df to f87024f Compare October 15, 2026 13:11
Signed-off-by: vivekmaurya001 <vm8118134@gmail.com>
Signed-off-by: vivekmaurya001 <vm8118134@gmail.com>
Signed-off-by: vivekmaurya001 <vm8118134@gmail.com>
Signed-off-by: vivekmaurya001 <vm8118134@gmail.com>
@vivekmaurya001 vivekmaurya001 changed the title removed opacity and updated shading [Button] Improve readability of permission-disabled buttons Oct 15, 2026
@vivekmaurya001

vivekmaurya001 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor Author

@Maanvi212006 @leecalcote I have resolved DCO issue and added an inline comment explaining that this fix targets the light-mode issue reported in #1805 and preserves existing dark-mode styling.

@vivekmaurya001

vivekmaurya001 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor Author

@Maanvi212006 I created another similar PR for this page.

@Maanvi212006

Copy link
Copy Markdown
Contributor

Tracked in #1869

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.

[Bug]: Unreadable text on Native Button Gating demo in light mode

3 participants