feat: Shift+Tab cycles work modes, Ctrl+T cycles thinking level
- Shift+Tab: cycles work mode (chat→plan→build→review→repair→research) when idle; opens steerable panel during autonomous execution - Ctrl+T: cycles thinking level (replaces shift+tab binding) - Removed toggleThinking from default Ctrl+T (superseded by cycleThinkingLevel) - Drop hint for toggleThinking from interactive mode help text Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
22cbd83675
commit
5188b93ddc
3 changed files with 39 additions and 20 deletions
|
|
@ -55,12 +55,12 @@ const DEFAULT_APP_KEYBINDINGS: Record<AppAction, KeyId | KeyId[]> = {
|
|||
clear: "ctrl+c",
|
||||
exit: "ctrl+d",
|
||||
suspend: "ctrl+z",
|
||||
cycleThinkingLevel: "shift+tab",
|
||||
cycleThinkingLevel: "ctrl+t",
|
||||
cycleModelForward: "ctrl+p",
|
||||
cycleModelBackward: "shift+ctrl+p",
|
||||
selectModel: "ctrl+l",
|
||||
expandTools: "ctrl+o",
|
||||
toggleThinking: "ctrl+t",
|
||||
toggleThinking: [],
|
||||
toggleSessionNamedFilter: "ctrl+n",
|
||||
externalEditor: "ctrl+g",
|
||||
followUp: ["alt+enter", "ctrl+enter"],
|
||||
|
|
|
|||
|
|
@ -673,7 +673,6 @@ export class InteractiveMode {
|
|||
),
|
||||
hint("selectModel", "to select model"),
|
||||
hint("expandTools", "to expand tools"),
|
||||
hint("toggleThinking", "to expand thinking"),
|
||||
hint("externalEditor", "for external editor"),
|
||||
rawKeyHint("/", "for commands"),
|
||||
rawKeyHint("!", "to run bash"),
|
||||
|
|
|
|||
|
|
@ -1,15 +1,20 @@
|
|||
/**
|
||||
* Steerable Autonomous Extension - Copilot Auto-style controls
|
||||
*
|
||||
* Provides Shift+Tab interface for steering and asking questions
|
||||
* during autonomous execution, similar to Copilot Auto.
|
||||
* Also integrates Ctrl+Y for YOLO mode (bypass git prompts).
|
||||
* Purpose: provide Shift+Tab for run-control cycling (manual → assisted →
|
||||
* autonomous) when the session is idle, and for steering/asking questions
|
||||
* during autonomous execution (Copilot Auto style). Also integrates Ctrl+Y
|
||||
* for YOLO mode (bypass git prompts).
|
||||
*
|
||||
* Consumer: index.js → steerableAutonomousExtension(pi) on every startup.
|
||||
*/
|
||||
|
||||
import {
|
||||
handleSteerableModeKey,
|
||||
SteerableAutonomousPanel,
|
||||
} from "./steerable-autonomous-panel.js";
|
||||
import { WORK_MODES } from "./operating-model.js";
|
||||
import { getAutoSession } from "./auto/session.js";
|
||||
|
||||
export default function steerableAutonomousExtension(api) {
|
||||
let panel = null;
|
||||
|
|
@ -26,22 +31,34 @@ export default function steerableAutonomousExtension(api) {
|
|||
|
||||
// Handle key events - Shift+Tab and Ctrl+Y
|
||||
api.registerShortcut("shift+tab", {
|
||||
description: "Open/close steerable autonomous panel",
|
||||
description:
|
||||
"Cycle work mode (chat → plan → build → review → repair → research) or open steerable panel during autonomous",
|
||||
handler: async (event, ctx) => {
|
||||
if (!isAutonomousActive) {
|
||||
ctx.ui.notify(
|
||||
"Autonomous mode not active - use /autonomous to start",
|
||||
"info",
|
||||
);
|
||||
if (isAutonomousActive) {
|
||||
// During autonomous execution: toggle steering panel
|
||||
if (panel) {
|
||||
panel.hide();
|
||||
panel = null;
|
||||
} else {
|
||||
panel = new SteerableAutonomousPanel(ctx);
|
||||
await panel.show();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (panel) {
|
||||
panel.hide();
|
||||
panel = null;
|
||||
} else {
|
||||
panel = new SteerableAutonomousPanel(ctx);
|
||||
await panel.show();
|
||||
// Outside autonomous: cycle work mode
|
||||
try {
|
||||
const s = getAutoSession();
|
||||
const current = s.getMode().workMode;
|
||||
const idx = WORK_MODES.indexOf(current);
|
||||
const next = WORK_MODES[(idx + 1) % WORK_MODES.length];
|
||||
s.setMode({ workMode: next });
|
||||
ctx.ui.notify(`Work mode: ${current} → ${next}`, "info");
|
||||
} catch {
|
||||
ctx.ui.notify(
|
||||
"Work mode: use /mode <chat|plan|build|review|repair|research>",
|
||||
"info",
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
|
@ -66,7 +83,7 @@ export default function steerableAutonomousExtension(api) {
|
|||
|
||||
// Handle slash command for panel
|
||||
api.registerCommand("steer", {
|
||||
description: "Open steerable autonomous panel (Shift+Tab)",
|
||||
description: "Open steerable autonomous panel (Shift+Tab during autonomous)",
|
||||
handler: async (_, ctx) => {
|
||||
if (!isAutonomousActive) {
|
||||
ctx.ui.notify(
|
||||
|
|
@ -89,7 +106,10 @@ export default function steerableAutonomousExtension(api) {
|
|||
// Listen for autonomous mode changes
|
||||
api.on("autonomous_start", async (_, ctx) => {
|
||||
isAutonomousActive = true;
|
||||
ctx.ui.notify("🤖 Autonomous mode active - Shift+Tab to steer", "info");
|
||||
ctx.ui.notify(
|
||||
"🤖 Autonomous mode active — Shift+Tab to steer",
|
||||
"info",
|
||||
);
|
||||
});
|
||||
|
||||
api.on("autonomous_stop", async (_, ctx) => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue