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

@@ -210,7 +210,7 @@ class OpenCodeServerManager {
async reloadConfig(): Promise<void> {
logger.info('Reloading OpenCode configuration (via API)')
try {
const response = await fetch(`http://${OPENCODE_SERVER_HOST}:${OPENCODE_SERVER_PORT}/config/`, {
const response = await fetch(`http://${OPENCODE_SERVER_HOST}:${OPENCODE_SERVER_PORT}/config`, {
method: 'GET'
})
@@ -220,7 +220,7 @@ class OpenCodeServerManager {
const currentConfig = await response.json()
logger.info('Triggering OpenCode config reload via PATCH')
const patchResponse = await fetch(`http://${OPENCODE_SERVER_HOST}:${OPENCODE_SERVER_PORT}/config/`, {
const patchResponse = await fetch(`http://${OPENCODE_SERVER_HOST}:${OPENCODE_SERVER_PORT}/config`, {
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(currentConfig)