feat(frontend): open a live session straight to its pending gate
Opening an in-progress session that has a live Pi runtime now reconnects to its pending gate instead of the empty landing screen that read as "stopped". Cold/completed sessions keep the read-only documents panel with its explicit Resume, so a mere click never spawns a runtime. Backend GET /sessions now reports a per-session `active` flag (live runtime bound) to drive this. Also: - "New session" now closes any open session detail panel (left box). - The model-activity separator can be dragged to a full 50/50 split (was capped at 576px); central-min still guards narrow viewports. Test fixes uncovered along the way: - Node 25 ships an experimental global localStorage that shadows jsdom's and lacks clear(), failing every jsdom test at setup; install a spec-compliant in-memory Storage (feature-detected, inert on CI/LTS). - Fix 4 pre-existing session-mgmt tests that used an ambiguous getByText for a session shown in both nav and header; target the nav item by test id. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -10,10 +10,11 @@ import {
|
||||
} from "./useActivityPanelResize";
|
||||
|
||||
describe("activity panel resize contract", () => {
|
||||
test("computes desktop bounds while preserving 512px centrally", () => {
|
||||
expect(getActivityPanelBounds(1200)).toEqual({ min: 288, max: 576 });
|
||||
expect(getActivityPanelBounds(1024)).toEqual({ min: 288, max: 512 });
|
||||
expect(getActivityPanelBounds(800)).toEqual({ min: 288, max: 288 });
|
||||
test("lets the panel reach a 50/50 split while preserving 512px centrally when narrow", () => {
|
||||
expect(getActivityPanelBounds(2000)).toEqual({ min: 288, max: 1000 }); // exactly 50%
|
||||
expect(getActivityPanelBounds(1200)).toEqual({ min: 288, max: 600 }); // 50%, central 600 ≥ 512
|
||||
expect(getActivityPanelBounds(1024)).toEqual({ min: 288, max: 512 }); // 50% == central-min
|
||||
expect(getActivityPanelBounds(800)).toEqual({ min: 288, max: 288 }); // central-min binds before 50%
|
||||
});
|
||||
|
||||
test("clamps finite values and falls back for invalid values", () => {
|
||||
|
||||
Reference in New Issue
Block a user