| 339 | } |
| 340 | |
| 341 | const cycleTab = (dir: -1 | 1) => { |
| 342 | if (tabs().length === 0) { |
| 343 | return |
| 344 | } |
| 345 | |
| 346 | const routeState = route() |
| 347 | const current = |
| 348 | routeState.type === "subagent" ? tabs().findIndex((item) => item.sessionID === routeState.sessionID) : -1 |
| 349 | const index = current === -1 ? 0 : (current + dir + tabs().length) % tabs().length |
| 350 | const next = tabs()[index] |
| 351 | if (!next) { |
| 352 | return |
| 353 | } |
| 354 | |
| 355 | openTab(next.sessionID) |
| 356 | } |
| 357 | const composer = createPromptState({ |
| 358 | directory: props.directory, |
| 359 | findFiles: props.findFiles, |