Skip to content

feat: add permissionKey support to NavigationNavbar#1741

Open
rishiraj38 wants to merge 5 commits into
layer5io:masterfrom
rishiraj38:feat/permission-key-select-textfield-checkbox-nav
Open

feat: add permissionKey support to NavigationNavbar#1741
rishiraj38 wants to merge 5 commits into
layer5io:masterfrom
rishiraj38:feat/permission-key-select-textfield-checkbox-nav

Conversation

@rishiraj38

@rishiraj38 rishiraj38 commented Jul 22, 2026

Copy link
Copy Markdown
Member

Description

This PR enhances Sistent components (NavigationNavbar) by adding native permissionKey and permissionAction support, seamlessly integrating them into Sistent's PermissionShield authorization system.

Key Changes

  • NavigationNavbar Component: Added permissionKey?: Key to NavigationItem interface and passed through to MenuItem for automatic PermissionShield tooltips.
  • Exports: Exported NavigationItem type from root barrel exports.
WhatsApp.Video.2026-07-24.at.02.00.30.mp4

Signed commits

  • Yes, I signed my commits.

Summary by CodeRabbit

  • New Features

    • Navigation items now support permission-based visibility and actions via permissionKey + permissionAction.
    • Navigation sub-items apply the same permission controls.
    • Navigation item icons are now optional.
    • Public API now exposes the NavigationItem type for consumers.
  • Bug Fixes

    • Improved bundled TypeScript declarations so NavigationNavbar and NavigationItem can be imported reliably.
  • Documentation

    • Added guidance for maintainers on ensuring new public exports appear in the generated dist type declarations.

…avigationNavbar

Signed-off-by: Rishi Raj <rishiraj438gt@gmail.com>
@rishiraj38
rishiraj38 requested a review from aabidsofi19 July 22, 2026 19:42
@coderabbitai

coderabbitai Bot commented Jul 22, 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: b48886e8-7bd8-4d1e-ba16-198eb40aeb2f

📥 Commits

Reviewing files that changed from the base of the PR and between 85e0733 and 15e8071.

📒 Files selected for processing (1)
  • AGENTS.md

📝 Walkthrough

Walkthrough

NavigationNavbar now supports permission-key and action-based gating for top-level and nested items while retaining legacy boolean permissions. NavigationItem and NavigationNavbar are re-exported through package entry points.

Changes

Permission-aware navigation

Layer / File(s) Summary
Permission-aware navigation rendering
src/custom/NavigationNavbar/navigationNavbar.tsx
NavigationItem adds permission fields and optional icons; top-level and nested MenuItem instances apply permission-based or legacy disabled behavior.
Public navigation exports
src/custom/NavigationNavbar/index.tsx, src/custom/index.tsx, src/index.tsx, AGENTS.md
NavigationItem and NavigationNavbar are re-exported through package entry points, with guidance for preserving root declaration exports.

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

Suggested reviewers: aabidsofi19

🚥 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 matches the main feature change: adding permissionKey support to NavigationNavbar.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@rishiraj38 rishiraj38 changed the title eat: add permissionKey support to Select, TextField, Checkbox, and NavigationNavbar feat: add permissionKey support to Select, TextField, Checkbox, and NavigationNavbar Jul 22, 2026
@rishiraj38
rishiraj38 marked this pull request as draft July 22, 2026 19:45
@rishiraj38
rishiraj38 marked this pull request as ready for review July 22, 2026 19:45

@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: 1

🤖 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/base/Checkbox/index.tsx`:
- Line 4: Propagate the new public symbols through every required barrel: update
src/base/Checkbox/index.tsx, src/base/Select/index.tsx, and
src/base/TextField/index.tsx for CheckboxProps, SelectProps, and TextFieldProps
respectively, then re-export those symbols from the base-domain barrel and
src/index.tsx; also re-export NavigationItem from src/custom/index.tsx and the
root barrel. Ensure each symbol is available through its feature-local, domain,
and root exports.
🪄 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: c4c2722f-3cdf-4505-b60d-f8f2e64464d4

📥 Commits

Reviewing files that changed from the base of the PR and between 2bb6802 and 723b4de.

📒 Files selected for processing (9)
  • src/base/Checkbox/Checkbox.tsx
  • src/base/Checkbox/index.tsx
  • src/base/Select/Select.tsx
  • src/base/Select/index.tsx
  • src/base/TextField/TextField.tsx
  • src/base/TextField/index.tsx
  • src/custom/NavigationNavbar/index.tsx
  • src/custom/NavigationNavbar/navigationNavbar.tsx
  • src/custom/index.tsx

Comment thread src/base/Checkbox/index.tsx Outdated
@rishiraj38
rishiraj38 requested a review from leecalcote July 22, 2026 19:54
…kbox

Signed-off-by: Rishi Raj <rishiraj438gt@gmail.com>
@rishiraj38 rishiraj38 changed the title feat: add permissionKey support to Select, TextField, Checkbox, and NavigationNavbar feat: add permissionKey support to NavigationNavbar Jul 23, 2026
@rishiraj38

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

NavigationItem (and NavigationNavbar's own declaration) reached the root
barrel only through `export * from './custom'`, which rollup-plugin-dts
drops from the bundled d.ts - so `import { type NavigationItem } from
'@sistent/sistent'` failed type-checking downstream despite the runtime
export existing. Add an explicit root re-export following the established
FeedbackButton pattern to force both declarations into the published bundle.

Signed-off-by: marblom007 <158522975+marblom007@users.noreply.github.com>
@marblom007

Copy link
Copy Markdown
Contributor

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@leecalcote

Copy link
Copy Markdown
Member

CodeRabbit, you're a lazy bastard.

Document the rollup-plugin-dts nested-barrel declaration-drop quirk that this
PR's NavigationItem/NavigationNavbar fix addresses, so future maintainers adding
custom exports know to add an explicit re-export in src/index.tsx and verify
against the built dist/index.d.ts.

Signed-off-by: marblom007 <158522975+marblom007@users.noreply.github.com>
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.

3 participants