Skip to content

Commit 7c39229

Browse files
committed
refactor(agents): rename focusedAgent prop to selectedAgent (anomalyco#4825)
1 parent 10d082a commit 7c39229

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎packages/opencode/src/cli/cmd/tui/component/dialog-agent-details.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export function DialogAgentDetails(props: { agentName: string }) {
2424
useKeyboard((evt) => {
2525
if (evt.name === "escape" || evt.name === "return") {
2626
evt.preventDefault()
27-
dialog.replace(() => <DialogAgent focusedAgent={props.agentName} />)
27+
dialog.replace(() => <DialogAgent selectedAgent={props.agentName} />)
2828
return
2929
}
3030
if (evt.name === "up" || (evt.ctrl && evt.name === "p")) {

‎packages/opencode/src/cli/cmd/tui/component/dialog-agent.tsx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ import { Keybind } from "@/util/keybind"
77
import { Locale } from "@/util/locale"
88
import { DialogAgentDetails } from "./dialog-agent-details"
99

10-
export function DialogAgent(props: { focusedAgent?: string }) {
10+
export function DialogAgent(props: { selectedAgent?: string }) {
1111
const local = useLocal()
1212
const dialog = useDialog()
1313
const dimensions = useTerminalDimensions()
1414

15-
const [selectedAgentName, setSelectedAgentName] = createSignal(props.focusedAgent ?? local.agent.current().name)
15+
const [selectedAgentName, setSelectedAgentName] = createSignal(props.selectedAgent ?? local.agent.current().name)
1616

1717
const selectedAgentHasDescription = createMemo(() => {
1818
const agent = local.agent.list().find((a) => a.name === selectedAgentName())
@@ -54,7 +54,7 @@ export function DialogAgent(props: { focusedAgent?: string }) {
5454
<DialogSelect
5555
title="Select agent"
5656
current={local.agent.current().name}
57-
defaultSelected={props.focusedAgent}
57+
defaultSelected={props.selectedAgent}
5858
options={options()}
5959
onMove={(option) => setSelectedAgentName(option.value)}
6060
onSelect={(option) => {

0 commit comments

Comments
 (0)