Fix/permission dialog id bug (#71)

* Fix permission dialog using wrong ID and add typed permission labels

- Fix critical bug: pass permission.id instead of permission.permission when responding
- Replace hardcoded switch statement with PERMISSION_LABELS derived from OpenCode types
- Add all permission types from PermissionConfig schema
* Add per-repo reset permissions feature
- Add POST /api/repos/:id/reset-permissions endpoint that disposes OpenCode instance
- Add resetRepoPermissions API function in frontend
- Add Reset Permissions button in RepoDetail header and mobile dropdown
- Add confirmation dialog explaining the action clears Allow Always permissions

* Improve OpenCode config error handling and UI responsiveness
This commit is contained in:
Chris Scott authored and GitHub committed 2026-01-17 13:26:42 -05:00
1 parent 2bd2b024b8
commit d035e196bd
9 files changed
+206 -53

No files matched your search

+11
View File
@@ -201,3 +201,14 @@ export async function updateRepoOrder(order: number[]): Promise<void> {
throw new Error(error.error || 'Failed to update repo order')
}
}
export async function resetRepoPermissions(id: number): Promise<void> {
const response = await fetch(`${API_BASE_URL}/api/repos/${id}/reset-permissions`, {
method: 'POST',
})
if (!response.ok) {
const error = await response.json()
throw new Error(error.error || 'Failed to reset permissions')
}
}