feat(PermissionShield): add context icons, bottom-left badge placement, and disabled hover cursor - #1756
Conversation
Signed-off-by: Rishi Raj <rishiraj438gt@gmail.com>
📝 WalkthroughWalkthroughThree configurable SVG icons are added and exported through the icon barrel. ChangesPermission context icons
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/custom/permissions.tsx (1)
293-299: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winMark the context icons as decorative.
These icons duplicate the adjacent
User,Org, andRole(s)text. Passaria-hidden="true"to each SVG so assistive technology does not treat them as separate unlabeled graphics.Also applies to: 312-318, 330-336
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/custom/permissions.tsx` around lines 293 - 299, Mark the UsersIcon and the corresponding organization and role context icons as decorative by passing aria-hidden="true" to each SVG component, covering the instances near the User, Org, and Role(s) labels.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/custom/permissions.tsx`:
- Around line 24-26: Update CONTEXT_ICON_COLOR usage in the tooltip icon
rendering to resolve the active Sistent theme’s semantic secondary-text/icon
token at render time instead of using the hard-coded `#9E9E9E` value. Use the
existing Sistent theme exports and pass the resolved color to all three icons,
preserving CONTEXT_ICON_SIZE.
---
Nitpick comments:
In `@src/custom/permissions.tsx`:
- Around line 293-299: Mark the UsersIcon and the corresponding organization and
role context icons as decorative by passing aria-hidden="true" to each SVG
component, covering the instances near the User, Org, and Role(s) labels.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: acf478eb-bcda-4b88-95de-cdc5527c877b
📒 Files selected for processing (8)
src/custom/permissions.tsxsrc/icons/OrgHierarchy/OrgHierarchyIcon.tsxsrc/icons/OrgHierarchy/index.tssrc/icons/RoleKey/RoleKeyIcon.tsxsrc/icons/RoleKey/index.tssrc/icons/Users/UsersIcon.tsxsrc/icons/Users/index.tssrc/icons/index.ts
| /** Monochrome fill used for tooltip-context icons */ | ||
| const CONTEXT_ICON_COLOR = '#9E9E9E'; | ||
| const CONTEXT_ICON_SIZE = '14'; |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Resolve the tooltip icon color from the active theme.
CONTEXT_ICON_COLOR hard-codes #9E9E9E and is passed to all three new icons. Derive this value from the Sistent theme’s semantic secondary-text/icon token at render time so custom and light/dark themes remain consistent.
As per coding guidelines, theme-aware UI must use Sistent theme exports and semantic palette tokens rather than raw MUI defaults.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/custom/permissions.tsx` around lines 24 - 26, Update CONTEXT_ICON_COLOR
usage in the tooltip icon rendering to resolve the active Sistent theme’s
semantic secondary-text/icon token at render time instead of using the
hard-coded `#9E9E9E` value. Use the existing Sistent theme exports and pass the
resolved color to all three icons, preserving CONTEXT_ICON_SIZE.
Source: Coding guidelines
Description
This PR enhances
PermissionShieldand adds new reusable identity icons in Sistent:RoleKeyIcon,OrgHierarchyIcon, andUsersIconto the user-context section ofPermissionShieldtooltips (rendered next to User, Org, and Role(s) labels).RoleKeyIcon,OrgHierarchyIcon, andUsersIconin@sistent/sistent(src/icons/), matching the canonical Meshery identity icon definitions.variant="badge"shield indicator on buttons from top-right to bottom-left (bottom: -6, left: -6).cursor: 'not-allowed'to thePermissionShieldwrapper so hovering over a permission-restricted element provides immediate disabled visual feedback.Signed commits
Summary by CodeRabbit