docs: add Sistent Permission component documentation - #7933
docs: add Sistent Permission component documentation#7933dhruveshmishra wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds documentation for the Sistent PermissionShield (Permission) component, addressing #7927.
Changes:
- Added a Permission component landing page with examples for inline overlay and badge variants.
- Added usage/gating guidance (disable vs. hide) and best practices.
- Added integration/code samples and an API/props reference table.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 12 comments.
| File | Description |
|---|---|
| src/collections/sistent/components/permission/index.mdx | Adds overview + inline/badge variant examples for PermissionShield |
| src/collections/sistent/components/permission/guidance.mdx | Adds design guidance and best practices for permission gating |
| src/collections/sistent/components/permission/code.mdx | Adds installation, usage examples, and props/API reference |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughThe PR adds Sistent Permission component documentation. It covers PermissionShield usage, inline and badge variants, security guidance, installation, examples, ChangesPermission component documentation
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed: dependency version conflict. Check your lock file or package.json. 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. Comment |
3eac6de to
b90c441
Compare
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
src/collections/sistent/components/permission/code.mdx (1)
57-60: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick winFix the
PermissionShieldAPI props table.
PermissionShielddoes not exposePermissionKeySpec,boundaryPadding, ordefaultin@sistent/sistent0.21.44; its props arepermissionKey: Key,children, and optionalvariant?: 'inline' | 'badge'. Replace the table row with the actual API around lines 85-90.🤖 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/collections/sistent/components/permission/code.mdx` around lines 57 - 60, Update the PermissionShield API props table near the documented example to match `@sistent/sistent` 0.21.44: document permissionKey as Key, children, and optional variant with inline or badge values. Remove references to PermissionKeySpec, boundaryPadding, and default.
🤖 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/collections/sistent/components/permission/code.mdx`:
- Around line 23-45: Update the basic-permission-shield example and its
CodeBlock snippet to include the required SistentThemeProvider and a denied
permission state that visibly triggers the lock badge. Keep the
PermissionShield/Button usage intact and make the copied snippet self-contained,
or explicitly document both prerequisites within it.
In `@src/collections/sistent/components/permission/guidance.mdx`:
- Line 48: Update the guidance around “Interactive Closeness” to instruct
disabling nested controls directly, using preventDefault() where necessary
instead of relying on propagation stopping. For custom controls, also specify
keyboard handling and aria-disabled so pointer and keyboard interactions cannot
trigger actions.
In `@src/collections/sistent/components/permission/index.mdx`:
- Line 11: Add an explicit authorization disclaimer to the PermissionShield
documentation in the overview, guidance.mdx, and code.mdx: clarify that it is
presentation-layer UI gating only, client-side checks must not decide access,
and the API, routes, and server must enforce permissions on every request.
---
Nitpick comments:
In `@src/collections/sistent/components/permission/code.mdx`:
- Around line 57-60: Update the PermissionShield API props table near the
documented example to match `@sistent/sistent` 0.21.44: document permissionKey as
Key, children, and optional variant with inline or badge values. Remove
references to PermissionKeySpec, boundaryPadding, and default.
🪄 Autofix
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: 06d65de1-f722-435b-92d2-50ce8f5f6e95
📒 Files selected for processing (3)
src/collections/sistent/components/permission/code.mdxsrc/collections/sistent/components/permission/guidance.mdxsrc/collections/sistent/components/permission/index.mdx
Signed-off-by: dhruveshmishra <dhruveshmishra09@gmail.com>
f8d73fa to
d9769ea
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
Description
This PR fixes #7927
Summary by CodeRabbit