@devries-cameron20 / t3code Mirror · read-only / commits / def3722faa
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 12:15 UTC

fix(web): Shift+F6 moves from a side chat back to the main chat (#31931)

Co-authored-by: Julius Marminge <julius0216@outlook.com>

Mel Boonchan committed Nov 15, 2026 at 11:35 UTC def3722faa3695034c03058e6ca73c31db353e7c
2 files changed +18 -1
apps/web/src/lib/workspaceFocus.browser.test.ts
+12
@@ -63,6 +63,18 @@ describe("workspace area focus", () => {
63 expect(document.activeElement).toBe(panel.button);
64 });
65
66 + it("moves back out of a side chat whose areas reuse the main chat's names", () => {
67 + using fixture = setup();
68 + const composer = fixture.area("composer", 2);
69 + const panel = fixture.area("panel", 4);
70 + const sideComposer = fixture.area("composer", 2, panel.element);
71 + composer.button.focus();
72 + fixture.controller.move(1);
73 + expect(document.activeElement).toBe(sideComposer.button);
74 + fixture.controller.move(-1);
75 + expect(document.activeElement).toBe(composer.button);
76 + });
77 +
78 it("skips hidden, inert, and maximized-away areas", () => {
79 using fixture = setup();
80 const sidebar = fixture.area("sidebar", 0);
apps/web/src/lib/workspaceFocus.ts
+6 -1
@@ -270,7 +270,12 @@ export function createWorkspaceFocusController(doc: Document) {
270 if (areas.length === 0) return false;
271 const activeArea = doc.activeElement?.closest<HTMLElement>(AREA_SELECTOR);
272 const currentId = fromArea ?? activeArea?.dataset.workspaceArea ?? lastArea;
273 - const current = areas.findIndex((area) => area.dataset.workspaceArea === currentId);
273 + // A side chat nests areas with the main chat's names, so prefer the focused element.
274 + const activeIndex = fromArea || !activeArea ? -1 : areas.indexOf(activeArea);
275 + const current =
276 + activeIndex === -1
277 + ? areas.findIndex((area) => area.dataset.workspaceArea === currentId)
278 + : activeIndex;
279 const index =
280 current === -1
281 ? direction === 1