mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 22:03:45 +00:00
feat: add Tab key to cycle through thinking levels
- Add onTab callback to CustomEditor - Implement cycleThinkingLevel() in TuiRenderer - Only works when model supports reasoning - Cycles through: off → minimal → low → medium → high → off - Update footer to show current thinking level with '(tab to cycle)' hint - Update header instructions to mention tab for thinking - Show notification when thinking level changes
This commit is contained in:
parent
1f68d6eb40
commit
9e8373b86a
3 changed files with 68 additions and 15 deletions
|
|
@ -6,8 +6,17 @@ import { Editor } from "@mariozechner/pi-tui";
|
|||
export class CustomEditor extends Editor {
|
||||
public onEscape?: () => void;
|
||||
public onCtrlC?: () => void;
|
||||
public onTab?: () => boolean;
|
||||
|
||||
handleInput(data: string): void {
|
||||
// Intercept Tab key when autocomplete is not showing
|
||||
if (data === "\t" && !this.isShowingAutocomplete() && this.onTab) {
|
||||
const handled = this.onTab();
|
||||
if (handled) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Intercept Escape key - but only if autocomplete is NOT active
|
||||
// (let parent handle escape for autocomplete cancellation)
|
||||
if (data === "\x1b" && this.onEscape && !this.isShowingAutocomplete()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue