Skip to content

chore(permissions): delete dead client-side permission hooks#1608

Open
timothyfroehlich wants to merge 1 commit into
mainfrom
worktree-dead-permissions-hooks
Open

chore(permissions): delete dead client-side permission hooks#1608
timothyfroehlich wants to merge 1 commit into
mainfrom
worktree-dead-permissions-hooks

Conversation

@timothyfroehlich

Copy link
Copy Markdown
Owner

Summary

  • Deletes src/lib/permissions/hooks.ts (254 lines, 8 React hooks: usePermission, usePermissionState, usePermissions, usePermissionStates, useAccessLevel, useIsAuthenticated, useIsConditionalPermission, useRawPermission) and its re-export from src/lib/permissions/index.ts.
  • Confirmed dead: a Stryker mutation audit (PP-x4li.2) found 0% coverage on this file, and a repo-wide grep found zero production consumers — all call sites use checkPermission() from helpers.ts directly instead.
  • Closes PP-t4du ("decide fate of dead permissions hooks.ts") per Tim's confirm-and-delete call.

Test plan

  • pnpm run check — types, lint, format, unit (163 files / 1306 tests) all pass
  • Repo-wide grep confirms no remaining imports of permissions/hooks or its exported hook/type names

🤖 Generated with Claude Code

Stryker mutation audit (PP-x4li.2) found hooks.ts had zero test coverage
and zero production consumers anywhere in src/ — all permission checks
go through checkPermission() from helpers.ts directly. Confirmed via
repo-wide grep before deleting.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 6, 2026 00:55
@vercel

vercel Bot commented Jul 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pin-point Ready Ready Preview, Comment Jul 6, 2026 12:56am

Request Review

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

Removes an unused client-side permissions hook layer from the permissions module, keeping permission enforcement centralized around the helper APIs (checkPermission() et al.) that are actually used across the app.

Changes:

  • Removed the client-side React permission hooks module (src/lib/permissions/hooks.ts).
  • Removed the corresponding hook/type re-exports from the permissions barrel (src/lib/permissions/index.ts).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/lib/permissions/index.ts Drops hook/type re-exports so the permissions barrel only exposes matrix + helper APIs.
src/lib/permissions/hooks.ts Deletes the unused client-side permission hook implementations.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 24 to 37
// Helper exports
export {
type OwnershipContext,
type PermissionState,
getAccessLevel,
checkPermission,
getPermissionState,
getPermissionDeniedReason,
checkPermissions,
checkAnyPermission,
getGrantedPermissions,
getRawPermissionValue,
isConditionalPermission,
} from "./helpers";
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.

2 participants