Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins
TypeScript ai-agentcoding-agentdesktop-appelectronglobali18nlocal-firstmcppipi-agentpi-desktoppluginsreactrusttypescript
fix(sidebar): keep project menus near bottom rows
vastsad427d87d77b3
diff --git a/apps/desktop/src/components/Sidebar.tsx b/apps/desktop/src/components/Sidebar.tsxindex e0324e61b..0665f25cf 100644--- a/apps/desktop/src/components/Sidebar.tsx+++ b/apps/desktop/src/components/Sidebar.tsx@@ -5,6 +5,7 @@ import { isRemoteSession, sessionAllows } from "../lib/remote-session-safety";import {useCallback,useEffect,+ useLayoutEffect,useMemo,useRef,useState,@@ -18,7 +19,8 @@ import { TooltipButton, cx } from "./ui";import { portalToBody } from "../lib/portal-visibility";import {- clampSidebarFloatingMenuTop,+ placeSidebarFloatingMenuTop,+ SIDEBAR_FLOATING_MENU_MAX_HEIGHT,SIDEBAR_MENU_VIEWPORT_PADDING,} from "../lib/sidebar-floating-menu";import { useTranslation } from "react-i18next";@@ -295,6 +297,8 @@ export function Sidebar({const [menuPosition, setMenuPosition] = useState<{top: number;left: number;+ anchorTop: number;+ anchorBottom: number;} | null>(null);const {card: sessionHoverCard,@@ -315,6 +319,7 @@ export function Sidebar({const menuTriggerRef = useRef<HTMLButtonElement | null>(null);const menuFirstItemRef = useRef<HTMLButtonElement | null>(null);+ const floatingMenuRef = useRef<HTMLDivElement | null>(null);const sessionPrefetchTimerRef = useRef<number | undefined>(undefined);const sidebarResizeRef = useRef<SidebarResizeState | null>(null);const projectReorderRef = useRef<ProjectReorderPointerState | null>(null);@@ -503,18 +508,32 @@ export function Sidebar({const placeMenu = useCallback((event: ReactMouseEvent<HTMLButtonElement>) => {const rect = event.currentTarget.getBoundingClientRect();+ const anchor = { top: rect.top, bottom: rect.bottom };setMenuPosition({- top: clampSidebarFloatingMenuTop(rect.bottom + 4, window.innerHeight),+ top: placeSidebarFloatingMenuTop(+ anchor,+ SIDEBAR_FLOATING_MENU_MAX_HEIGHT,+ window.innerHeight,+ ),left: Math.max(SIDEBAR_MENU_VIEWPORT_PADDING, rect.right + 4),+ anchorTop: anchor.top,+ anchorBottom: anchor.bottom,});}, []);// Body-level sidebar menus always anchor their left edge to the right side// of the trigger or pointer; they never flip to the left at the viewport edge.const placeMenuAtPoint = useCallback((x: number, y: number) => {+ const anchor = { top: y, bottom: y };setMenuPosition({- top: clampSidebarFloatingMenuTop(y + 4, window.innerHeight),+ top: placeSidebarFloatingMenuTop(+ anchor,+ SIDEBAR_FLOATING_MENU_MAX_HEIGHT,+ window.innerHeight,+ ),left: Math.max(SIDEBAR_MENU_VIEWPORT_PADDING, x + 4),+ anchorTop: anchor.top,+ anchorBottom: anchor.bottom,});}, []);@@ -584,6 +603,39 @@ export function Sidebar({requestAnimationFrame(() => menuFirstItemRef.current?.focus());}, [sessionMenu, projectMenu, sectionMenu, sortOpen]);+ const menuAnchorTop = menuPosition?.anchorTop;+ const menuAnchorBottom = menuPosition?.anchorBottom;++ useLayoutEffect(() => {+ if (menuAnchorTop === undefined || menuAnchorBottom === undefined) return;+ const menu = floatingMenuRef.current;+ if (!menu) return;++ const reposition = () => {+ const top = placeSidebarFloatingMenuTop(+ { top: menuAnchorTop, bottom: menuAnchorBottom },+ menu.getBoundingClientRect().height,+ window.innerHeight,+ );+ setMenuPosition((current) =>+ current && current.top !== top ? { ...current, top } : current,+ );+ };++ reposition();+ if (typeof ResizeObserver === "undefined") return;+ const observer = new ResizeObserver(reposition);+ observer.observe(menu);+ return () => observer.disconnect();+ }, [+ menuAnchorTop,+ menuAnchorBottom,+ sessionMenu,+ projectMenu,+ sectionMenu,+ sortOpen,+ ]);+// Footer utility bar: settings / plugins / notifications + build chip.// An update only earns the accent dot once it is actionable — a pending@@ -2020,6 +2072,7 @@ export function Sidebar({const Icon = isSessions ? IconNewSession : IconNewProject;return portalToBody(<div+ ref={floatingMenuRef}className="sidebar-row-menu sidebar-floating-menu sidebar-section-menu"role="menu"data-sidebar-section-menu={sectionMenu}@@ -2049,6 +2102,7 @@ export function Sidebar({if (sortOpen) {return portalToBody(<div+ ref={floatingMenuRef}className="sidebar-popover sidebar-sort-menu sidebar-floating-menu"role="menu"onKeyDown={onMenuKeyDown}@@ -2083,6 +2137,7 @@ export function Sidebar({if (!session && !entry) return null;return portalToBody(<div+ ref={floatingMenuRef}className="sidebar-row-menu sidebar-floating-menu"role="menu"onKeyDown={onMenuKeyDown}diff --git a/apps/desktop/src/lib/sidebar-floating-menu.ts b/apps/desktop/src/lib/sidebar-floating-menu.tsindex 3fe0a0e5d..696853e6b 100644--- a/apps/desktop/src/lib/sidebar-floating-menu.ts+++ b/apps/desktop/src/lib/sidebar-floating-menu.ts@@ -1,16 +1,45 @@export const SIDEBAR_MENU_VIEWPORT_PADDING = 8;export const SIDEBAR_FLOATING_MENU_MAX_HEIGHT = 360;-/** Keep a floating sidebar menu inside the viewport with room for its full height. */-export function clampSidebarFloatingMenuTop(- anchorTop: number,+const SIDEBAR_MENU_ANCHOR_GAP = 4;++export type SidebarFloatingMenuAnchor = {+ top: number;+ bottom: number;+};++/** Place a floating sidebar menu near its anchor, inside the viewport. */+export function placeSidebarFloatingMenuTop(+ anchor: SidebarFloatingMenuAnchor,+ menuHeight: number,viewportHeight: number,): number {- return Math.max(- SIDEBAR_MENU_VIEWPORT_PADDING,- Math.min(- anchorTop,- viewportHeight - SIDEBAR_FLOATING_MENU_MAX_HEIGHT - SIDEBAR_MENU_VIEWPORT_PADDING,- ),+ const availableHeight = Math.max(+ 0,+ viewportHeight - 2 * SIDEBAR_MENU_VIEWPORT_PADDING,+ );+ const height = Math.min(+ Math.max(0, menuHeight),+ SIDEBAR_FLOATING_MENU_MAX_HEIGHT,+ availableHeight,);+ const minTop = SIDEBAR_MENU_VIEWPORT_PADDING;+ const maxTop = Math.max(+ minTop,+ viewportHeight - height - SIDEBAR_MENU_VIEWPORT_PADDING,+ );+ const belowTop = anchor.bottom + SIDEBAR_MENU_ANCHOR_GAP;+ const aboveTop = anchor.top - height - SIDEBAR_MENU_ANCHOR_GAP;+ const clampTop = (top: number) => Math.min(maxTop, Math.max(minTop, top));++ if (belowTop <= maxTop) return clampTop(belowTop);+ if (aboveTop >= minTop) return clampTop(aboveTop);++ const availableAbove = anchor.top - minTop - SIDEBAR_MENU_ANCHOR_GAP;+ const availableBelow =+ viewportHeight -+ SIDEBAR_MENU_VIEWPORT_PADDING -+ anchor.bottom -+ SIDEBAR_MENU_ANCHOR_GAP;+ return clampTop(availableAbove > availableBelow ? aboveTop : belowTop);}diff --git a/apps/desktop/test/sidebar-floating-menu.test.mjs b/apps/desktop/test/sidebar-floating-menu.test.mjsindex 12793f26c..6800953a4 100644--- a/apps/desktop/test/sidebar-floating-menu.test.mjs+++ b/apps/desktop/test/sidebar-floating-menu.test.mjs@@ -5,22 +5,53 @@ import test from "node:test";register(new URL("./helpers/ts-import-hooks.mjs", import.meta.url));const {- clampSidebarFloatingMenuTop,- SIDEBAR_FLOATING_MENU_MAX_HEIGHT,+ placeSidebarFloatingMenuTop,SIDEBAR_MENU_VIEWPORT_PADDING,} = await import("../src/lib/sidebar-floating-menu.ts");-test("sidebar floating menu stays within the viewport at the lower edge", () => {- const top = clampSidebarFloatingMenuTop(850, 900);+test("sidebar floating menu opens above a bottom-edge project row", () => {+ const top = placeSidebarFloatingMenuTop(+ { top: 720, bottom: 752 },+ 200,+ 900,+ );- assert.equal(top, 900 - SIDEBAR_FLOATING_MENU_MAX_HEIGHT - SIDEBAR_MENU_VIEWPORT_PADDING);- assert.equal(top + SIDEBAR_FLOATING_MENU_MAX_HEIGHT + SIDEBAR_MENU_VIEWPORT_PADDING, 900);+ assert.equal(top, 720 - 200 - 4);});-test("sidebar floating menu keeps its anchor position when there is room", () => {- assert.equal(clampSidebarFloatingMenuTop(240, 900), 240);+test("sidebar floating menu stays below its anchor when the actual height fits", () => {+ const top = placeSidebarFloatingMenuTop(+ { top: 480, bottom: 512 },+ 200,+ 900,+ );++ assert.equal(top, 512 + 4);});-test("sidebar floating menu uses viewport padding in a short window", () => {- assert.equal(clampSidebarFloatingMenuTop(240, 300), SIDEBAR_MENU_VIEWPORT_PADDING);+test("sidebar floating menu opens above a pointer near the viewport bottom", () => {+ const pointerY = 840;+ const menuHeight = 220;+ const top = placeSidebarFloatingMenuTop(+ { top: pointerY, bottom: pointerY },+ menuHeight,+ 900,+ );++ assert.equal(top, pointerY - menuHeight - 4);+});++test("sidebar floating menu stays within viewport padding in a short window", () => {+ const viewportHeight = 300;+ const top = placeSidebarFloatingMenuTop(+ { top: 260, bottom: 280 },+ 500,+ viewportHeight,+ );++ assert.equal(top, SIDEBAR_MENU_VIEWPORT_PADDING);+ assert.equal(+ top + viewportHeight - 2 * SIDEBAR_MENU_VIEWPORT_PADDING,+ viewportHeight - SIDEBAR_MENU_VIEWPORT_PADDING,+ );});diff --git a/apps/desktop/test/sidebar-navigation.test.mjs b/apps/desktop/test/sidebar-navigation.test.mjsindex b52c7d455..0bad450de 100644--- a/apps/desktop/test/sidebar-navigation.test.mjs+++ b/apps/desktop/test/sidebar-navigation.test.mjs@@ -175,7 +175,7 @@ test("sidebar section toolbars open create actions from context menus", () => {assert.match(sidebarSource, /addEventListener\("pointerdown"/);});-test("sidebar floating menus open to the anchor's right", () => {+test("sidebar floating menus stay anchored to triggers and pointer positions", () => {const triggerPlacement = sidebarSource.match(/const placeMenu = useCallback\([\s\S]*?\n }, \[\]\);/,)?.[0] ?? "";@@ -183,16 +183,17 @@ test("sidebar floating menus open to the anchor's right", () => {/const placeMenuAtPoint = useCallback\([\s\S]*?\n }, \[\]\);/,)?.[0] ?? "";+ assert.match(triggerPlacement, /const anchor = \{ top: rect\.top, bottom: rect\.bottom \}/);+ assert.match(triggerPlacement, /placeSidebarFloatingMenuTop\(/);assert.match(triggerPlacement, /left:\s*Math\.max\(/);assert.match(triggerPlacement, /rect\.right \+ 4/);- assert.match(triggerPlacement, /top:\s*clampSidebarFloatingMenuTop\(rect\.bottom \+ 4, window\.innerHeight\)/);- assert.doesNotMatch(triggerPlacement, /window\.innerWidth/);- assert.doesNotMatch(triggerPlacement, /right:\s*Math\.max/);- assert.match(pointPlacement, /left:\s*Math\.max\(/);+ assert.match(pointPlacement, /const anchor = \{ top: y, bottom: y \}/);+ assert.match(pointPlacement, /placeSidebarFloatingMenuTop\(/);assert.match(pointPlacement, /x \+ 4/);- assert.match(pointPlacement, /top:\s*clampSidebarFloatingMenuTop\(y \+ 4, window\.innerHeight\)/);- assert.doesNotMatch(pointPlacement, /window\.innerWidth/);assert.match(sidebarSource, /placeMenuAtPoint\(event\.clientX, event\.clientY\)/);+ assert.match(sidebarSource, /menu\.getBoundingClientRect\(\)\.height/);+ assert.match(sidebarSource, /new ResizeObserver\(reposition\)/);+ assert.equal((sidebarSource.match(/ref=\{floatingMenuRef\}/g) ?? []).length, 3);assert.match(sidebarSource, /left: menuPosition\.left/);assert.doesNotMatch(sidebarSource, /right: menuPosition\.right/);});diff --git a/docs/spec/06-delivery/04-e2e-test-plan.md b/docs/spec/06-delivery/04-e2e-test-plan.mdindex 5ec28d771..68b7a1dc3 100644--- a/docs/spec/06-delivery/04-e2e-test-plan.md+++ b/docs/spec/06-delivery/04-e2e-test-plan.md@@ -3016,6 +3016,16 @@ identify the platform validation still needed.- **Status**: Unit-covered (`session-scratch-path.test.mjs`); desktop journeyDraft (run only in a capable environment when this surface changes)+#### E2E-021c: Bottom-edge project menus stay beside their anchor++- **Preconditions**: The expanded Sidebar shows a retained project in its lowest visible row, with insufficient room below it for the project menu.+- **Steps**: 1) Right-click the project row and inspect the menu. 2) Close it, open the row's overflow button, and inspect the menu again. 3) Verify every action remains inside the viewport.+- **Expected**: Both entry points place the menu immediately above the row when it cannot fit below, using the rendered menu height. When there is enough room, the menu opens below its anchor. No menu is displaced to a distant viewport edge or clipped.+- **Specs linked**: `04-ux/08-component-spec.md`, `04-ux/09-interaction-patterns.md`+- **Acceptance**: Quality (sidebar interaction)+- **Milestone**: M2+- **Status**: Unit-covered (`sidebar-floating-menu.test.mjs`, `sidebar-navigation.test.mjs`); rendered viewport scenario Draft+#### E2E-036: Settings session-import destination retired- **Expected**: Settings has no session-import tab or scan panel. Plugin session@@ -9807,6 +9817,7 @@ must keep splitting are covered by `markdown-blocks.test.mjs`.| H — Diagnostics | E2E-027, E2E-031, E2E-034, E2E-042, E2E-096, E2E-098, E2E-104, E2E-107, E2E-108, E2E-109, E2E-110, E2E-113, E2E-115, E2E-116, E2E-118, E2E-121, E2E-146, E2E-146a, E2E-155, E2E-159, E2E-176, E2E-194, E2E-195 || Security | E2E-SETTINGS-inline-capability-imports, E2E-028, E2E-029, E2E-030, E2E-024J, E2E-024K, E2E-024M, E2E-049, E2E-068, E2E-086, E2E-102c, E2E-102d, E2E-102e, E2E-105, E2E-106, E2E-107, E2E-108, E2E-109, E2E-110, E2E-112, E2E-113, E2E-115, E2E-116, E2E-117, E2E-119, E2E-121, E2E-122, E2E-123, E2E-142, E2E-148, E2E-151, E2E-153, E2E-158, E2E-187, E2E-196c, E2E-196b, E2E-196, E2E-PROVIDER-custom-endpoint-no-api-key, E2E-PLUGIN-fs-root-follows-the-calling-session, E2E-PLUGIN-provider-catalog-add-service || Quality | E2E-SETTINGS-inline-capability-imports, E2E-CHAT-long-history-stream-keeps-responsive, E2E-CHAT-running-status-survives-output-pauses, E2E-032, E2E-033, E2E-039, E2E-043, E2E-044, E2E-045, E2E-046, E2E-047, E2E-048, E2E-048A, E2E-049, E2E-050, E2E-053, E2E-055, E2E-056, E2E-057, E2E-058, E2E-059, E2E-060, E2E-061, E2E-062, E2E-063, E2E-064, E2E-065, E2E-066, E2E-067, E2E-068, E2E-069, E2E-070, E2E-071, E2E-072, E2E-073, E2E-074, E2E-075, E2E-076, E2E-077, E2E-078, E2E-079, E2E-080, E2E-081, E2E-082, E2E-083, E2E-084, E2E-085, E2E-086, E2E-092, E2E-093, E2E-094, E2E-095, E2E-096, E2E-097, E2E-098, E2E-099, E2E-100, E2E-101, E2E-102, E2E-102a, E2E-102b, E2E-102c, E2E-102d, E2E-102e, E2E-103, E2E-AGENTS-001, E2E-021a, E2E-024N, E2E-059a, E2E-060b, E2E-060c, E2E-061a, E2E-073a, E2E-111, E2E-114, E2E-117, E2E-118, E2E-119, E2E-120, E2E-122, E2E-123, E2E-142, E2E-143, E2E-144, E2E-145, E2E-146, E2E-147, E2E-148, E2E-150, E2E-151, E2E-153, E2E-155, E2E-158, E2E-159, E2E-160, E2E-161, E2E-162, E2E-163, E2E-168, E2E-172, E2E-173, E2E-174, E2E-011g, E2E-176, E2E-177, E2E-178, E2E-179, E2E-180, E2E-181, E2E-182, E2E-183, E2E-186, E2E-187, E2E-194, E2E-195, E2E-196a, E2E-196b, E2E-196c, E2E-198, E2E-199, E2E-200, E2E-196, E2E-201, E2E-204, E2E-202, E2E-203, E2E-205, E2E-206, E2E-207, E2E-208, E2E-209, E2E-210, E2E-UPDATE-preference-and-once-only-reminder, E2E-218, E2E-259, E2E-219, E2E-250, E2E-252, E2E-102i, E2E-SUBAGENT-settlement-updates-before-parent-poll, E2E-PLUGIN-imported-pi-package-skills, E2E-PLUGIN-fs-root-follows-the-calling-session, E2E-SUBAGENT-resume-a-settled-delegation, E2E-PLUGIN-provider-catalog-add-service |+| Quality (sidebar menu placement) | E2E-021c || Quality (project ordering) | E2E-253 || C — Conversation & stream (IME slash alias) | E2E-255 || E — Tools & permissions (Skill residency) | E2E-254 |@@ -9855,6 +9866,7 @@ must keep splitting are covered by `markdown-blocks.test.mjs`.| Post-MVP experimental interaction maintenance | E2E-LIVE-VOICE-four-stage-ui || M1 | E2E-001, E2E-002, E2E-003, E2E-028, E2E-029 || M2 | E2E-004, E2E-005, E2E-006, E2E-007, E2E-008, E2E-008d, E2E-008e, E2E-009, E2E-010, E2E-011, E2E-011a, E2E-011b, E2E-011d, E2E-011e, E2E-011g, E2E-020, E2E-021, E2E-021a, E2E-027, E2E-031, E2E-042, E2E-087, E2E-088, E2E-088b, E2E-089, E2E-090, E2E-COMPOSER-narrow-controls, E2E-144, E2E-005J, E2E-201, E2E-202, E2E-207, E2E-206 |+| M2 (sidebar menu placement) | E2E-021c || M3 | E2E-012, E2E-013, E2E-014, E2E-015, E2E-016, E2E-017, E2E-018, E2E-019, E2E-040 || M4 | E2E-022, E2E-023, E2E-024, E2E-025, E2E-026, E2E-030, E2E-038 || M5 | E2E-CHAT-long-history-stream-keeps-responsive, E2E-CHAT-running-status-survives-output-pauses, E2E-008a, E2E-032, E2E-033, E2E-034, E2E-039, E2E-043, E2E-044, E2E-045, E2E-046, E2E-047, E2E-048, E2E-048A, E2E-049, E2E-050, E2E-051, E2E-052, E2E-053, E2E-054, E2E-055, E2E-056, E2E-057, E2E-058, E2E-059, E2E-060, E2E-061, E2E-062, E2E-063, E2E-064, E2E-065, E2E-066, E2E-067, E2E-068, E2E-069, E2E-070, E2E-071, E2E-072, E2E-073, E2E-074, E2E-075, E2E-076, E2E-077, E2E-078, E2E-079, E2E-080, E2E-081, E2E-082, E2E-083, E2E-084, E2E-085, E2E-086, E2E-092, E2E-093, E2E-096, E2E-097, E2E-098, E2E-099, E2E-100, E2E-101, E2E-102, E2E-102a, E2E-102b, E2E-102c, E2E-102d, E2E-102e, E2E-AGENTS-001, E2E-059a, E2E-060b, E2E-060c, E2E-061a, E2E-073a, E2E-094, E2E-095, E2E-143, E2E-145, E2E-146, E2E-146a, E2E-147, E2E-177, E2E-178, E2E-180, E2E-181, E2E-182, E2E-183, E2E-186, E2E-187, E2E-194, E2E-195, E2E-204, E2E-208, E2E-CHAT-content-width-handles, E2E-250, E2E-252, E2E-102i, E2E-BROWSER-capture-resize |diff --git a/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md b/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.mdindex 4c17cbb59..6214b6d8a 100644--- a/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md+++ b/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md@@ -1219,6 +1219,16 @@ task-candidate E2E 从请求工作树运行,但使用主工作区已经准备- **状态**:单元测试覆盖(`sidebar-floating-menu.test.mjs`、`sidebar-navigation.test.mjs`);视口交互场景仍为草案+#### E2E-021c:底部项目菜单贴近锚点显示++- **先决条件**:展开的侧边栏中,最底部可见项目行下方空间不足以容纳项目菜单。+- **步骤**:1) 右键该项目行并查看菜单。2) 关闭菜单,再打开该行的溢出按钮菜单。3) 确认所有操作都处于视口内。+- **预期**:两种入口在下方空间不足时,都会按菜单实际高度紧贴项目行上方显示;空间足够时则显示在锚点下方。菜单不会跳到远离项目的位置或被裁切。+- **链接规格**:`04-ux/08-component-spec.md`、`04-ux/09-interaction-patterns.md`+- **接受**:品质(侧边栏交互)+- **里程碑**:M2+- **状态**:单元测试覆盖(`sidebar-floating-menu.test.mjs`、`sidebar-navigation.test.mjs`);视口交互场景仍为草案+#### E2E-036:设置会话导入目的地已移除- **预期**:设置中没有会话导入选项卡或扫描面板。插件仍可通过宿主拥有的会话 API 导入会话,相关边界由 E2E-214 / E2E-215 / E2E-216 覆盖。旧本地会话扫描器只由导入器单元测试覆盖。@@ -5666,6 +5676,7 @@ eleven-tool-round desktop paths are verified by| H——诊断 | E2E-027、E2E-031、E2E-034、E2E-042、E2E-096、E2E-098、E2E-104、E2E-107、E2E-108、E2E-109、E2E-110、E2E-113、E2E-115、E2E-116、 E2E-118、E2E-121、E2E-146、E2E-194、E2E-195 || 安全性 | E2E-SETTINGS-inline-capability-imports、E2E-028、E2E-029、E2E-030、E2E-024J、E2E-024K、E2E-024M、E2E-049、E2E-068、E2E-086、E2E-105、E2E-106、E2E-107、E2E-108、E2E-109、 E2E-110、E2E-112、E2E-113、E2E-115、E2E-116、E2E-117、E2E-119、E2E-121、E2E-122、E2E-123、E2E-142、E2E-148、E2E-151、E2E-153 || 品质 | E2E-SETTINGS-inline-capability-imports、E2E-CHAT-running-status-survives-output-pauses、E2E-032、E2E-033、E2E-039、E2E-043、E2E-044、E2E-045、E2E-046、E2E-047、E2E-048、E2E-048c、E2E-048A、E2E-049、E2E-050、E2E-053、E2E-055、 E2E-056、E2E-057、E2E-058、E2E-059、E2E-060、E2E-061、E2E-062、E2E-063、E2E-064、E2E-065、E2E-066、E2E-067、E2E-068、E2E-069、 E2E-070、E2E-071、E2E-072、E2E-073、E2E-074、E2E-075、E2E-076、E2E-077、E2E-078、E2E-079、E2E-080、E2E-081、E2E-082、E2E-083、 E2E-084、E2E-085、E2E-086、E2E-092、E2E-093、E2E-094、E2E-095、E2E-096、E2E-097、E2E-098、E2E-099、E2E-100、E2E-101、E2E-102、 E2E-102a、E2E-102b、E2E-103、E2E-AGENTS-001、E2E-024N、E2E-024O、E2E-059a、E2E-060b、E2E-060c、E2E-060d、E2E-061a、E2E-073a、E2E-111、 E2E-114、E2E-117、E2E-118、E2E-119、E2E-120、E2E-122、E2E-123、E2E-142、E2E-143、E2E-144、E2E-145、E2E-146、E2E-147、E2E-148、E2E-150、E2E-151、E2E-153、E2E-194、E2E-195、E2E-199、E2E-200、E2E-201、E2E-202、E2E-203、E2E-204、E2E-209、E2E-210、E2E-UPDATE-preference-and-once-only-reminder、E2E-250、E2E-PLUGIN-imported-pi-package-skills、E2E-SUBAGENT-resume-a-settled-delegation |+| 品质(侧边栏菜单定位) | E2E-021c || 品质(项目排序) | E2E-253 || C — 对话和直播(输入法斜杠别名) | E2E-255 || E——工具和权限(Skill 常驻) | E2E-254 |@@ -5714,6 +5725,7 @@ eleven-tool-round desktop paths are verified by| MVP 后实验性交互维护 | E2E-LIVE-VOICE-four-stage-ui || M1 | E2E-001、E2E-002、E2E-003、E2E-028、E2E-029 || M2 | E2E-004、E2E-005、E2E-006、E2E-007、E2E-008、E2E-008d、E2E-009、E2E-010、E2E-011、E2E-011a、E2E-011b、E2E-020、E2E-021、E2E-027、E2E-031、E2E-042、E2E-087、E2E-088、E2E-088b、E2E-089、E2E-090、E2E-144、E2E-005J、E2E-201 |+| M2(侧边栏菜单定位) | E2E-021c || M3 | E2E-012、E2E-013、E2E-014、E2E-015、E2E-016、E2E-017、E2E-018、E2E-019、E2E-040 || M4 | E2E-022、E2E-023、E2E-024、E2E-025、E2E-026、E2E-030、E2E-038 || M5 | E2E-CHAT-running-status-survives-output-pauses、E2E-008a、E2E-032、E2E-033、E2E-034、E2E-039、E2E-043、E2E-044、E2E-045、E2E-046、E2E-047、E2E-048、E2E-048c、E2E-048A、E2E-049、E2E-050、 E2E-051、E2E-052、E2E-053、E2E-054、E2E-055、E2E-056、E2E-057、E2E-058、E2E-059、E2E-060、E2E-061、E2E-062、E2E-063、E2E-064、 E2E-065、E2E-066、E2E-067、E2E-068、E2E-069、E2E-070、E2E-071、E2E-072、E2E-073、E2E-074、E2E-075、E2E-076、E2E-077、E2E-078、 E2E-079、E2E-080、E2E-081、E2E-082、E2E-083、E2E-084、E2E-085、E2E-086、E2E-092、E2E-093、E2E-096、E2E-097、E2E-098、E2E-099、 E2E-100、E2E-101、E2E-102、E2E-102a、E2E-102b、E2E-AGENTS-001、E2E-059a、E2E-060b、E2E-060c、E2E-061a、E2E-073a、E2E-094、E2E-095、E2E-143、E2E-145、E2E-146、E2E-147、E2E-194、E2E-195、E2E-204、E2E-250 |diff --git a/scripts/e2e/sidebar-row-states.mjs b/scripts/e2e/sidebar-row-states.mjsindex 5803f7b5e..ddfb586fa 100644--- a/scripts/e2e/sidebar-row-states.mjs+++ b/scripts/e2e/sidebar-row-states.mjs@@ -214,6 +214,77 @@ export async function checkSidebarRowStates({ cdp, check, waitFor, seed }) {`${theme} returning from settings restores conversation selection and independent workspace context`,);}+ const bottomProjectKey = await cdp.evaluate(`(() => {+ const headers = [...document.querySelectorAll(".project-group > .sidebar-session-group-header")];+ const header = headers.at(-1);+ if (!header) return null;+ header.scrollIntoView({ block: "end" });+ return header.closest(".project-group")?.getAttribute("data-sidebar-project-group") ?? null;+ })()`);+ if (!bottomProjectKey) throw new Error("Missing bottom project row");+ const bottomProjectGroup = group(bottomProjectKey);+ const bottomProjectHeader = `${bottomProjectGroup} .sidebar-session-group-header`;+ const projectMenuSelector = ".sidebar-row-menu.sidebar-floating-menu:not(.sidebar-section-menu)";+ const measureProjectMenu = () => cdp.evaluate(`(() => {+ const menu = document.querySelector(${JSON.stringify(projectMenuSelector)});+ if (!menu) return null;+ const rect = menu.getBoundingClientRect();+ return { top: rect.top, bottom: rect.bottom, viewportHeight: window.innerHeight };+ })()`);+ const assertMenuAboveAnchor = (bounds, anchorY, label) => {+ const gap = anchorY - bounds.bottom;+ check(+ bounds.top >= 8 && bounds.bottom <= bounds.viewportHeight - 8 && gap >= 3 && gap <= 5,+ label,+ JSON.stringify({ bounds, anchorY, gap }),+ );+ };++ const rightClickTarget = await point(bottomProjectHeader);+ await cdp.send("Input.dispatchMouseEvent", {+ type: "mousePressed", x: rightClickTarget.x, y: rightClickTarget.y,+ button: "right", buttons: 2, clickCount: 1,+ });+ await cdp.send("Input.dispatchMouseEvent", {+ type: "mouseReleased", x: rightClickTarget.x, y: rightClickTarget.y,+ button: "right", buttons: 0, clickCount: 1,+ });+ const contextMenu = await waitFor(+ () => measureProjectMenu(),+ "bottom project context menu opens",+ );+ assertMenuAboveAnchor(contextMenu, rightClickTarget.y, "right-click menu stays beside the bottom project row");+ await cdp.send("Input.dispatchKeyEvent", {+ type: "keyDown", key: "Escape", code: "Escape", windowsVirtualKeyCode: 27,+ });+ await cdp.send("Input.dispatchKeyEvent", {+ type: "keyUp", key: "Escape", code: "Escape", windowsVirtualKeyCode: 27,+ });+ await waitFor(async () => !(await measureProjectMenu()), "project context menu closes");++ const projectMenuTrigger = `${bottomProjectGroup} .project-more`;+ await hover(bottomProjectHeader);+ await waitFor(+ () => cdp.evaluate(`getComputedStyle(document.querySelector(${JSON.stringify(projectMenuTrigger)})).pointerEvents === "auto"`),+ "bottom project overflow button is revealed",+ );+ await click(projectMenuTrigger);+ const overflowMenu = await waitFor(+ () => measureProjectMenu(),+ "bottom project overflow menu opens",+ );+ const triggerTop = await cdp.evaluate(+ `document.querySelector(${JSON.stringify(projectMenuTrigger)}).getBoundingClientRect().top`,+ );+ assertMenuAboveAnchor(overflowMenu, triggerTop, "overflow menu stays beside the bottom project row");++ await cdp.send("Input.dispatchKeyEvent", {+ type: "keyDown", key: "Escape", code: "Escape", windowsVirtualKeyCode: 27,+ });+ await cdp.send("Input.dispatchKeyEvent", {+ type: "keyUp", key: "Escape", code: "Escape", windowsVirtualKeyCode: 27,+ });+ await waitFor(async () => !(await measureProjectMenu()), "project overflow menu closes");await cdp.send("Emulation.setEmulatedMedia", {features: [{ name: "prefers-reduced-motion", value: "reduce" }],});