feat(coding-agent): configurable double-escape action (tree vs branch)

Add doubleEscapeAction setting to choose whether double-escape with an
empty editor opens /tree (default) or /branch.

- Add setting to Settings interface and SettingsManager
- Add to /settings UI for easy toggling
- Update interactive-mode to respect the setting
- Document in README.md settings table

fixes #404
This commit is contained in:
Mario Zechner 2026-01-03 01:59:08 +01:00
parent 17b3a14bfa
commit 42b1e06ad1
6 changed files with 34 additions and 6 deletions

View file

@ -33,6 +33,7 @@ export interface SettingsConfig {
availableThemes: string[];
hideThinkingBlock: boolean;
collapseChangelog: boolean;
doubleEscapeAction: "branch" | "tree";
}
export interface SettingsCallbacks {
@ -46,6 +47,7 @@ export interface SettingsCallbacks {
onThemePreview?: (theme: string) => void;
onHideThinkingBlockChange: (hidden: boolean) => void;
onCollapseChangelogChange: (collapsed: boolean) => void;
onDoubleEscapeActionChange: (action: "branch" | "tree") => void;
onCancel: () => void;
}
@ -160,6 +162,13 @@ export class SettingsSelectorComponent extends Container {
currentValue: config.collapseChangelog ? "true" : "false",
values: ["true", "false"],
},
{
id: "double-escape-action",
label: "Double-escape action",
description: "Action when pressing Escape twice with empty editor",
currentValue: config.doubleEscapeAction,
values: ["tree", "branch"],
},
{
id: "thinking",
label: "Thinking level",
@ -264,6 +273,9 @@ export class SettingsSelectorComponent extends Container {
case "collapse-changelog":
callbacks.onCollapseChangelogChange(newValue === "true");
break;
case "double-escape-action":
callbacks.onDoubleEscapeActionChange(newValue as "branch" | "tree");
break;
}
},
callbacks.onCancel,