Compare commits

..

1 Commits

Author SHA1 Message Date
Kit Langton 5d37d68bc4 fix(tui): move debug overlay to devtools 2026-08-07 20:33:54 +00:00
5 changed files with 15 additions and 17 deletions
-10
View File
@@ -156,7 +156,6 @@ const appBindingCommands = [
"help.show",
"docs.open",
"diff.open",
"app.debug",
"app.console",
"terminal.suspend",
"terminal.title.toggle",
@@ -958,15 +957,6 @@ function App(props: { pair?: DialogPairCredentials }) {
run: () => exit(),
category: "System",
},
{
name: "app.debug",
title: "Toggle debug panel",
category: "System",
run: () => {
renderer.toggleDebugOverlay()
dialog.clear()
},
},
{
name: "app.console",
title: "Toggle console",
@@ -41,6 +41,7 @@ export function DevToolsBar() {
const [dumping, setDumping] = createSignal(false)
const [dumpPath, setDumpPath] = createSignal<string>()
const [dumpError, setDumpError] = createSignal<string>()
const [debugOverlay, setDebugOverlay] = createSignal(Boolean(renderer.debugOverlay.enabled))
const [frontendSamples, setFrontendSamples] = createSignal<readonly ProcessSample[]>([])
let focus: Renderable | null
const connected = createMemo(() => client.connection.status() === "connected")
@@ -391,6 +392,15 @@ export function DevToolsBar() {
>
{verboseTurnTokens() ? "[x]" : "[ ]"} Turn token usage (verbose)
</Action>
<Action
onClick={() => {
renderer.toggleDebugOverlay()
setDebugOverlay(Boolean(renderer.debugOverlay.enabled))
}}
hoverBackground
>
{debugOverlay() ? "[x]" : "[ ]"} Renderer debug overlay
</Action>
</box>
<For each={groups()}>
{(group) => (
-2
View File
@@ -46,7 +46,6 @@ export const Definitions = {
leader: keybind(LeaderDefault, "Leader key for keybind combinations"),
app_exit: keybind("ctrl+c,ctrl+d,<leader>q", "Exit the application"),
app_debug: keybind("none", "Toggle debug panel"),
app_console: keybind("none", "Toggle console"),
app_heap_snapshot: keybind("none", "Write heap snapshot"),
app_toggle_animations: keybind("none", "Toggle animations"),
@@ -251,7 +250,6 @@ export const Descriptions = Object.fromEntries(
) as Record<KeybindName, string>
export const CommandMap = {
app_exit: "app.exit",
app_debug: "app.debug",
app_console: "app.console",
app_heap_snapshot: "app.heap_snapshot",
app_toggle_animations: "app.toggle.animations",
+3 -3
View File
@@ -154,14 +154,14 @@ function wildcardDirectory(value: string) {
export function permissionAlwaysLines(input: { action: string; save?: ReadonlyArray<string> }): string[] {
const save = input.save ?? []
if (save.length === 1 && save[0] === "*") {
return [`This will always allow ${input.action} for this project.`]
return [`This will allow ${input.action} until OpenCode is restarted.`]
}
return ["This will always allow the following patterns for this project.", ...save.map((item) => `- ${item}`)]
return ["This will allow the following patterns until OpenCode is restarted.", ...save.map((item) => `- ${item}`)]
}
export function permissionOptionLabel(option: "once" | "always" | "reject" | "confirm" | "cancel") {
if (option === "once") return "Allow once"
if (option === "always") return "Always allow"
if (option === "always") return "Allow always"
if (option === "reject") return "Reject"
if (option === "confirm") return "Confirm"
return "Cancel"
@@ -183,11 +183,11 @@ describe("run permission shared", () => {
test("formats always-allow copy for wildcard and explicit patterns", () => {
expect(permissionAlwaysLines(req({ action: "bash", save: ["*"] }))).toEqual([
"This will always allow bash for this project.",
"This will allow bash until OpenCode is restarted.",
])
expect(permissionAlwaysLines(req({ save: ["src/**/*.ts", "src/**/*.tsx"] }))).toEqual([
"This will always allow the following patterns for this project.",
"This will allow the following patterns until OpenCode is restarted.",
"- src/**/*.ts",
"- src/**/*.tsx",
])