Skip to content

feat: hide admin-only sidebar links for non-signer wallets - #561

Open
BABAT-CODE wants to merge 1 commit into
WHEELBACK:mainfrom
BABAT-CODE:feature/sidebar-role-based-visibility
Open

feat: hide admin-only sidebar links for non-signer wallets#561
BABAT-CODE wants to merge 1 commit into
WHEELBACK:mainfrom
BABAT-CODE:feature/sidebar-role-based-visibility

Conversation

@BABAT-CODE

Copy link
Copy Markdown

Admin-only nav items (Treasury, Signers, Settings) are now hidden for any wallet that is not a registered signer in the treasury contract.

Changes:

  • Sidebar.tsx: mark Treasury, Signers, and Settings links as adminOnly. Filter visibleLinks using the treasury signer list fetched by useSigners(). Fail-closed while the signer list is loading to prevent a flash of privileged links. Accept a connectedAddress prop.
  • DashboardLayout.tsx: add useWalletAddress() and pass the resolved address to Sidebar as connectedAddress.
  • hooks/useWalletAddress.ts: new hook that polls Freighter for the connected public key every 5 s (returns null when not connected).
  • Sidebar.test.tsx: 7 tests covering non-admin wallet hides links, no wallet hides links, signer sees all links, loading state fail-closed, and case-insensitive address matching.

Pull Request

Summary

  • Describe the purpose of this PR in one or two sentences.

Checklist

  • Closes #__
  • Tests added or updated
  • ABI snapshot updated if contract sources changed (abis/ and COMEBACKHERE-contracts/)
  • Screenshots attached if UI changed
  • Documentation updated if needed

Notes

  • For contract changes, verify ABI snapshot hygiene with make check-abi-snapshots.
  • For UI changes, include screenshots or screen recordings to help reviewers.

closes #463

Admin-only nav items (Treasury, Signers, Settings) are now hidden for
any wallet that is not a registered signer in the treasury contract.

Changes:
- Sidebar.tsx: mark Treasury, Signers, and Settings links as adminOnly.
  Filter visibleLinks using the treasury signer list fetched by
  useSigners(). Fail-closed while the signer list is loading to prevent
  a flash of privileged links. Accept a connectedAddress prop.
- DashboardLayout.tsx: add useWalletAddress() and pass the resolved
  address to Sidebar as connectedAddress.
- hooks/useWalletAddress.ts: new hook that polls Freighter for the
  connected public key every 5 s (returns null when not connected).
- Sidebar.test.tsx: 7 tests covering non-admin wallet hides links,
  no wallet hides links, signer sees all links, loading state
  fail-closed, and case-insensitive address matching.

Closes WHEELBACK#3
@drips-wave

drips-wave Bot commented Aug 29, 2026

Copy link
Copy Markdown

@BABAT-CODE Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

feat: add role-based visibility to Sidebar navigation items

1 participant