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:
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user