tui: add escape key handling to permission dialogs for better keyboard navigation

This commit is contained in:
Dax Raad
2026-01-02 18:48:26 -05:00
parent 1261b7d333
commit 4956ee3ebd
3 changed files with 14 additions and 32 deletions

View File

@@ -2721,39 +2721,10 @@ export namespace Server {
const response = await proxy(`https://app.opencode.ai${path}`, {
...c.req,
headers: {
...c.req.raw.headers,
host: "app.opencode.ai",
},
})
// Cloudflare doesn't return Content-Type for static assets, so we need to add it
const mimeTypes: Record<string, string> = {
".js": "application/javascript",
".mjs": "application/javascript",
".css": "text/css",
".json": "application/json",
".wasm": "application/wasm",
".svg": "image/svg+xml",
".png": "image/png",
".jpg": "image/jpeg",
".jpeg": "image/jpeg",
".gif": "image/gif",
".ico": "image/x-icon",
".webp": "image/webp",
".woff": "font/woff",
".woff2": "font/woff2",
".ttf": "font/ttf",
".eot": "application/vnd.ms-fontobject",
}
for (const [ext, mime] of Object.entries(mimeTypes)) {
if (path.endsWith(ext)) {
const headers = new Headers(response.headers)
headers.set("Content-Type", mime)
return new Response(response.body, {
status: response.status,
statusText: response.statusText,
headers,
})
}
}
return response
}),
)