mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-18 20:03:33 +00:00
feat(coding-agent): add treeFilterMode setting for /tree default filter (#1852)
Add configurable initial filter mode for the session tree navigator. Users who always switch to a specific filter (e.g. no-tools via Ctrl+T) can now set it as default in settings. Same pattern as doubleEscapeAction (#404). Filter infra from #747.
This commit is contained in:
parent
a0d839ce84
commit
1f39cc776a
5 changed files with 39 additions and 2 deletions
|
|
@ -87,6 +87,7 @@ export interface Settings {
|
|||
images?: ImageSettings;
|
||||
enabledModels?: string[]; // Model patterns for cycling (same format as --models CLI flag)
|
||||
doubleEscapeAction?: "fork" | "tree" | "none"; // Action for double-escape with empty editor (default: "tree")
|
||||
treeFilterMode?: "default" | "no-tools" | "user-only" | "labeled-only" | "all"; // Default filter when opening /tree
|
||||
thinkingBudgets?: ThinkingBudgetsSettings; // Custom token budgets for thinking levels
|
||||
editorPaddingX?: number; // Horizontal padding for input editor (default: 0)
|
||||
autocompleteMaxVisible?: number; // Max visible items in autocomplete dropdown (default: 5)
|
||||
|
|
@ -866,6 +867,18 @@ export class SettingsManager {
|
|||
this.save();
|
||||
}
|
||||
|
||||
getTreeFilterMode(): "default" | "no-tools" | "user-only" | "labeled-only" | "all" {
|
||||
const mode = this.settings.treeFilterMode;
|
||||
const valid = ["default", "no-tools", "user-only", "labeled-only", "all"];
|
||||
return mode && valid.includes(mode) ? mode : "default";
|
||||
}
|
||||
|
||||
setTreeFilterMode(mode: "default" | "no-tools" | "user-only" | "labeled-only" | "all"): void {
|
||||
this.globalSettings.treeFilterMode = mode;
|
||||
this.markModified("treeFilterMode");
|
||||
this.save();
|
||||
}
|
||||
|
||||
getShowHardwareCursor(): boolean {
|
||||
return this.settings.showHardwareCursor ?? process.env.PI_HARDWARE_CURSOR === "1";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue