Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/worktree-history-default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"kilo-code": patch
---

Open `/sessions` on a git worktree with the Worktree history filter selected by default.
3 changes: 3 additions & 0 deletions packages/kilo-vscode/tests/history-accessibility.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ test.describe("history session accessibility", () => {

const local = page.getByRole("tab", { name: "Local" })
const worktree = page.getByRole("tab", { name: "Worktree" })
await expect(worktree).toHaveAttribute("aria-selected", "true")
await expect(page.getByRole("tabpanel", { name: "Worktree" })).toBeVisible()

await local.focus()
await page.keyboard.press("End")
await expect(worktree).toBeFocused()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,15 @@ const HistoryView: Component<HistoryViewProps> = (props) => {
const dialog = useDialog()
const session = useSession()
const tabs = useLocalTabs()
const [tab, setTab] = createSignal<Source>("local")
const worktreeIds = () => props.worktreeSessionIds?.()
const [tab, setTab] = createSignal<Source>(worktreeIds() ? "worktree" : "local")
let local: HTMLButtonElement | undefined
let cloud: HTMLButtonElement | undefined
let worktree: HTMLButtonElement | undefined
let localPanel: HTMLDivElement | undefined
let cloudPanel: HTMLDivElement | undefined
let worktreePanel: HTMLDivElement | undefined

const worktreeIds = () => props.worktreeSessionIds?.()

createEffect(() => {
if (tab() === "worktree" && !worktreeIds()) setTab("local")
})
Expand Down
Loading