Skip to content

docs: add Sistent Permission component documentation - #7933

Open
dhruveshmishra wants to merge 2 commits into
layer5io:masterfrom
dhruveshmishra:docs/sistent-permission-shield-docs
Open

docs: add Sistent Permission component documentation#7933
dhruveshmishra wants to merge 2 commits into
layer5io:masterfrom
dhruveshmishra:docs/sistent-permission-shield-docs

Conversation

@dhruveshmishra

@dhruveshmishra dhruveshmishra commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Description

This PR fixes #7927

  • This PR adds the Sistent PermissionShield (Permission) component documentation pages (index.mdx, guidance.mdx, and code.mdx) under Sistent components .
  • The documentation includes the component overview, design gating guidance (Disable vs. Hide), integration code examples, and the full API/Props reference.

Summary by CodeRabbit

  • Documentation
    • Added comprehensive documentation for the PermissionShield component, including shield overlays and standalone badge variants.
    • Included installation steps, usage examples, configuration options, and a props API reference.
    • Added guidance on backend authorization, accessibility, responsive layouts, badge placement, tooltip accuracy, and interactions with nested controls.

Copilot AI lite review requested due to automatic review settings August 6, 2026 09:31

Copilot AI 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.

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

Comment thread src/collections/sistent/components/permission/index.mdx Outdated
Comment thread src/collections/sistent/components/permission/index.mdx Outdated
Comment thread src/collections/sistent/components/permission/guidance.mdx Outdated
Comment thread src/collections/sistent/components/permission/guidance.mdx Outdated
Comment thread src/collections/sistent/components/permission/guidance.mdx Outdated
Comment thread src/collections/sistent/components/permission/code.mdx Outdated
Comment thread src/collections/sistent/components/permission/code.mdx Outdated
Comment thread src/collections/sistent/components/permission/code.mdx
Comment thread src/collections/sistent/components/permission/index.mdx Outdated
Comment thread src/collections/sistent/components/permission/code.mdx Outdated
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3bde10ae-b68d-4d4f-826f-85b871df5f6b

📥 Commits

Reviewing files that changed from the base of the PR and between d7eda01 and d9769ea.

📒 Files selected for processing (3)
  • src/collections/sistent/components/permission/code.mdx
  • src/collections/sistent/components/permission/guidance.mdx
  • src/collections/sistent/components/permission/index.mdx
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/collections/sistent/components/permission/index.mdx
  • src/collections/sistent/components/permission/code.mdx
  • src/collections/sistent/components/permission/guidance.mdx

📝 Walkthrough

Walkthrough

The PR adds Sistent Permission component documentation. It covers PermissionShield usage, inline and badge variants, security guidance, installation, examples, boundaryPadding configuration, and prop definitions.

Changes

Permission component documentation

Layer / File(s) Summary
Permission page and usage guidance
src/collections/sistent/components/permission/index.mdx, src/collections/sistent/components/permission/guidance.mdx
The documentation describes PermissionShield behavior, inline and badge variants, protected-content examples, backend authorization, disable-versus-hide decisions, badge placement, tooltip accuracy, responsive layouts, and nested control handling.
PermissionShield code examples and API
src/collections/sistent/components/permission/code.mdx
The documentation adds installation instructions, gated button examples, custom boundaryPadding usage, and prop definitions for permissionKey, children, variant, and boundaryPadding.

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

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the addition of Sistent Permission component documentation.
Linked Issues check ✅ Passed The documentation covers the issue requirements, including guidance, usage examples, installation, accessibility considerations, and the props reference [#7927].
Out of Scope Changes check ✅ Passed All changes add PermissionShield documentation and remain within the scope of the linked issue [#7927].
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

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.

❤️ Share

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

@dhruveshmishra
dhruveshmishra force-pushed the docs/sistent-permission-shield-docs branch from 3eac6de to b90c441 Compare August 6, 2026 09:37

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
src/collections/sistent/components/permission/code.mdx (1)

57-60: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Fix the PermissionShield API props table.

PermissionShield does not expose PermissionKeySpec, boundaryPadding, or default in @sistent/sistent 0.21.44; its props are permissionKey: Key, children, and optional variant?: '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

📥 Commits

Reviewing files that changed from the base of the PR and between b1edb88 and b90c441.

📒 Files selected for processing (3)
  • src/collections/sistent/components/permission/code.mdx
  • src/collections/sistent/components/permission/guidance.mdx
  • src/collections/sistent/components/permission/index.mdx

Comment thread src/collections/sistent/components/permission/code.mdx Outdated
Comment thread src/collections/sistent/components/permission/guidance.mdx Outdated
Comment thread src/collections/sistent/components/permission/index.mdx
Signed-off-by: dhruveshmishra <dhruveshmishra09@gmail.com>
@dhruveshmishra
dhruveshmishra force-pushed the docs/sistent-permission-shield-docs branch from f8d73fa to d9769ea Compare August 6, 2026 09:48
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

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.

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.

Add documentation for the Permission component to the Sistent Components documentation

3 participants