Remove agent cycling and enhance model selector display

- Remove Tab/Shift+Tab shortcuts for cycling agents
- Remove Next/Previous Agent commands from command palette
- Remove handleCycleAgent and handleCycleAgentReverse functions
- Remove Tab keyboard hint from agent selector UI
- Enhance model selector to show provider/modelId below model name
- Widen model selector button to accommodate additional text
This commit is contained in:
Shantur Rathore
2025-10-24 12:35:53 +01:00
parent 7dbda45fb9
commit b24c7a572f
4 changed files with 14 additions and 115 deletions

View File

@@ -371,26 +371,6 @@ const App: Component = () => {
},
})
commandRegistry.register({
id: "next-agent",
label: "Next Agent",
description: "Cycle to next agent",
category: "Agent & Model",
keywords: ["agent", "switch", "cycle"],
shortcut: { key: "Tab" },
action: handleCycleAgent,
})
commandRegistry.register({
id: "prev-agent",
label: "Previous Agent",
description: "Cycle to previous agent",
category: "Agent & Model",
keywords: ["agent", "switch", "cycle"],
shortcut: { key: "Tab", shift: true },
action: handleCycleAgentReverse,
})
commandRegistry.register({
id: "open-model-selector",
label: "Open Model Selector",
@@ -503,54 +483,6 @@ const App: Component = () => {
commandRegistry.execute(commandId)
}
function handleCycleAgent() {
const instance = activeInstance()
const sessionId = activeSessionIdForInstance()
if (!instance || !sessionId || sessionId === "logs") return
const sessions = getSessions(instance.id)
const session = sessions.find((s) => s.id === sessionId)
if (!session) return
const instanceAgents = agents().get(instance.id) || []
const availableAgents =
session.parentId === null ? instanceAgents.filter((a) => a.mode !== "subagent") : instanceAgents
if (availableAgents.length === 0) return
const currentIndex = availableAgents.findIndex((a) => a.name === session.agent)
const nextIndex = (currentIndex + 1) % availableAgents.length
const nextAgent = availableAgents[nextIndex]
if (nextAgent) {
updateSessionAgent(instance.id, sessionId, nextAgent.name).catch(console.error)
}
}
function handleCycleAgentReverse() {
const instance = activeInstance()
const sessionId = activeSessionIdForInstance()
if (!instance || !sessionId || sessionId === "logs") return
const sessions = getSessions(instance.id)
const session = sessions.find((s) => s.id === sessionId)
if (!session) return
const instanceAgents = agents().get(instance.id) || []
const availableAgents =
session.parentId === null ? instanceAgents.filter((a) => a.mode !== "subagent") : instanceAgents
if (availableAgents.length === 0) return
const currentIndex = availableAgents.findIndex((a) => a.name === session.agent)
const prevIndex = currentIndex <= 0 ? availableAgents.length - 1 : currentIndex - 1
const prevAgent = availableAgents[prevIndex]
if (prevAgent) {
updateSessionAgent(instance.id, sessionId, prevAgent.name).catch(console.error)
}
}
onMount(() => {
initMarkdown(false).catch(console.error)
@@ -576,8 +508,6 @@ const App: Component = () => {
},
)
registerAgentShortcuts(
handleCycleAgent,
handleCycleAgentReverse,
() => {
const modelInput = document.querySelector("[data-model-selector]") as HTMLInputElement
if (modelInput) {