fix: prevent sidebar action menus from being cropped

Use viewport-constrained positioning for sidebar action menus and keep the auth warning test isolated from local models.json config so pre-commit verification is deterministic.
This commit is contained in:
Federico Jaramillo Martinez
2026-06-11 01:31:56 +02:00
parent 5855c443ca
commit 577594a622
6 changed files with 10 additions and 5 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"@jmfederico/pi-web": patch
---
Allow sidebar action/detail menus to expand beyond their list section when only a few rows are shown.
+1 -1
View File
@@ -124,7 +124,7 @@ export class MachineList extends LitElement implements KeyboardNavigableSection
this.openMenuMachineId = undefined;
return;
}
this.menuStyle = actionMenuPanelStyle(target);
this.menuStyle = actionMenuPanelStyle(target, { constrainTo: "viewport" });
this.openMenuMachineId = machineId;
}
+1 -1
View File
@@ -109,7 +109,7 @@ export class ProjectList extends LitElement implements KeyboardNavigableSection
this.openMenuProjectId = undefined;
return;
}
this.menuStyle = actionMenuPanelStyle(target);
this.menuStyle = actionMenuPanelStyle(target, { constrainTo: "viewport" });
this.openMenuProjectId = projectId;
}
+1 -1
View File
@@ -336,7 +336,7 @@ export class SessionList extends LitElement implements KeyboardNavigableSection
this.openMenuSessionId = undefined;
return;
}
this.menuStyle = actionMenuPanelStyle(target);
this.menuStyle = actionMenuPanelStyle(target, { constrainTo: "viewport" });
this.openMenuSessionId = sessionId;
}
+1 -1
View File
@@ -180,7 +180,7 @@ export class WorkspaceList extends LitElement implements KeyboardNavigableSectio
this.openMenuWorkspaceId = undefined;
return;
}
this.menuStyle = actionMenuPanelStyle(target);
this.menuStyle = actionMenuPanelStyle(target, { constrainTo: "viewport" });
this.openMenuWorkspaceId = workspaceId;
}
+1 -1
View File
@@ -632,7 +632,7 @@ describe("PiSessionService", () => {
it("refreshes auth state and dedupes warnings when logout removes the current model's credentials", async () => {
const hub = new CapturingSessionEventHub();
const authStorage = AuthStorage.inMemory({ anthropic: { type: "api_key", key: "sk-test" } });
const modelRegistry = ModelRegistry.create(authStorage);
const modelRegistry = ModelRegistry.inMemory(authStorage);
const model = modelRegistry.find("anthropic", "claude-3-5-sonnet-20241022");
if (model === undefined) throw new Error("Expected Anthropic model fixture");
const fake = fakeRuntime("auth-session", { model, modelRegistry });