Skip to content

Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins

fix(desktop): keep toasts clear of the work panel

Tonyf30a994d0f03
diff --git a/apps/desktop/src/components/Toast.tsx b/apps/desktop/src/components/Toast.tsx
index 86473710f..a668673ee 100644
--- a/apps/desktop/src/components/Toast.tsx
+++ b/apps/desktop/src/components/Toast.tsx
@@ -1,4 +1,12 @@
-import { useCallback, useEffect, useRef, useState, type AnimationEvent } from "react";
+import {
+ useCallback,
+ useEffect,
+ useLayoutEffect,
+ useRef,
+ useState,
+ type AnimationEvent,
+ type CSSProperties,
+} from "react";
import { createPortal } from "react-dom";
import { useTranslation } from "react-i18next";
import { useAppStore, type ToastItem, type ToastVariant } from "../stores/app-store";
@@ -132,12 +140,70 @@ function useToastHost(): HTMLElement | null {
}, []);
return host;
}
+type ToastViewportBounds = {
+ center: number;
+ width: number;
+};
+
+function useToastViewportBounds(
+ anchorElement?: HTMLElement | null,
+): ToastViewportBounds | null {
+ const [bounds, setBounds] = useState<ToastViewportBounds | null>(null);
+
+ useLayoutEffect(() => {
+ const anchor = anchorElement;
+ if (!anchor) {
+ setBounds(null);
+ return;
+ }
+ const update = () => {
+ const rect = anchor.getBoundingClientRect();
+ const next = { center: rect.left + rect.width / 2, width: rect.width };
+ setBounds((current) =>
+ current?.center === next.center && current.width === next.width ? current : next,
+ );
+ };
+ const observer = new ResizeObserver(update);
+ const layoutRoot = anchor.parentElement;
+ const observeLayout = () => {
+ observer.disconnect();
+ observer.observe(anchor);
+ for (const sibling of layoutRoot?.children ?? []) {
+ if (sibling !== anchor) observer.observe(sibling);
+ }
+ update();
+ };
+ const mutationObserver = new MutationObserver(observeLayout);
+ if (layoutRoot) mutationObserver.observe(layoutRoot, { childList: true });
+ observeLayout();
+ window.addEventListener("resize", update);
+ return () => {
+ mutationObserver.disconnect();
+ observer.disconnect();
+ window.removeEventListener("resize", update);
+ };
+ }, [anchorElement]);
+
+ return bounds;
+}
+
+type ToastHostProps = {
+ /** Optional viewport region whose top center owns the toast stack. */
+ anchorElement?: HTMLElement | null;
+};
/** Global toast stack — mount once per shell, above dialogs (z-toast). */
-export function ToastHost() {
+export function ToastHost({ anchorElement }: ToastHostProps = {}) {
const toasts = useAppStore((s) => s.toasts);
const visibleToastIds = useRef<Set<number>>(new Set());
const host = useToastHost();
+ const bounds = useToastViewportBounds(anchorElement);
+ const viewportStyle = bounds
+ ? ({
+ "--toast-viewport-center": `${bounds.center}px`,
+ "--toast-viewport-width": `${Math.max(0, bounds.width - 32)}px`,
+ } as CSSProperties)
+ : undefined;
useEffect(() => {
const nextVisibleIds = new Set<number>();
@@ -154,7 +220,7 @@ export function ToastHost() {
// nothing rather than mounting the stack inside the shell it must outrank.
if (!host) return null;
return createPortal(
- <div className="toast-viewport" aria-live="polite">
+ <div className="toast-viewport" aria-live="polite" style={viewportStyle}>
{toasts.map((item) => (
<ToastCard key={item.id} item={item} />
))}
diff --git a/apps/desktop/src/features/app/AppShell.tsx b/apps/desktop/src/features/app/AppShell.tsx
index a9f72172a..87deac2c8 100644
--- a/apps/desktop/src/features/app/AppShell.tsx
+++ b/apps/desktop/src/features/app/AppShell.tsx
@@ -1,4 +1,11 @@
-import { type CSSProperties, lazy, type ReactNode, Suspense, useEffect } from "react";
+import {
+ type CSSProperties,
+ lazy,
+ type ReactNode,
+ Suspense,
+ useEffect,
+ useState,
+} from "react";
import { ConversationTopbar } from "../../components/ConversationTopbar";
import { ExtensionPromptHost } from "../../components/ExtensionPromptDialog";
import { PluginRendererHost } from "../../plugins/renderer-host/PluginRendererHost";
@@ -94,6 +101,7 @@ export function AppShell() {
workPanelToggleTooltip,
requestedWorkPanelWidth,
} = useAppShellRuntime();
+ const [toastAnchor, setToastAnchor] = useState<HTMLElement | null>(null);
useCopyTex();
useEffect(() => {
@@ -188,7 +196,7 @@ export function AppShell() {
)}
{!workPanelMaximized && (
- <section className="main-pane">
+ <section ref={setToastAnchor} className="main-pane">
{page === "chat" ? (
<ConversationTopbar
sidebarCollapsed={sidebarCollapsed}
@@ -344,7 +352,7 @@ export function AppShell() {
</Suspense>
) : null}
<SearchDialog open={searchOpen} onClose={() => setSearchOpen(false)} />
- <ToastHost />
+ <ToastHost anchorElement={page === "settings" ? null : toastAnchor} />
<LiveVoiceStatusHost />
<PluginRendererHost />
<ExtensionPromptHost />
diff --git a/apps/desktop/src/styles/overlays.css b/apps/desktop/src/styles/overlays.css
index 0a959305b..7855deca5 100644
--- a/apps/desktop/src/styles/overlays.css
+++ b/apps/desktop/src/styles/overlays.css
@@ -186,13 +186,13 @@
.toast-viewport {
position: fixed;
top: 16px;
- left: 50%;
+ left: var(--toast-viewport-center, 50%);
z-index: 50; /* z-toast */
display: flex;
flex-direction: column-reverse;
align-items: center;
gap: 8px;
- width: min(360px, calc(100vw - 32px));
+ width: min(360px, var(--toast-viewport-width, calc(100vw - 32px)));
transform: translateX(-50%);
pointer-events: none;
}
diff --git a/docs/spec/04-ux/01-ui-ia.md b/docs/spec/04-ux/01-ui-ia.md
index 5ac86219d..a940d74e9 100644
--- a/docs/spec/04-ux/01-ui-ia.md
+++ b/docs/spec/04-ux/01-ui-ia.md
@@ -443,7 +443,7 @@ shared capability contract:
| Model menu | Composer-right model × reasoning chip | configured provider/model choices + settings entry (D091) |
| Profile menu | sidebar footer | Settings / Logs / Theme cycle (D041) |
| Notification inbox | sidebar footer bell | All/Unread views, task failure rows only (successful completions are hidden, D295), mark-all-read and clear actions (D130/D117) |
-| Toasts | events (plugin toast, backend restored, copy) | top-center; 4s default, 8s for errors |
+| Toasts | events (plugin toast, backend restored, copy) | top-center of the live main-content safe area; viewport fallback; 4s default, 8s for errors |
| Project switcher | empty-home underlined project name | sidebar open projects + search + clone git project + open project |
## 5. Navigation model
diff --git a/docs/spec/04-ux/07-ui-design-system.md b/docs/spec/04-ux/07-ui-design-system.md
index 0048d643f..92769704f 100644
--- a/docs/spec/04-ux/07-ui-design-system.md
+++ b/docs/spec/04-ux/07-ui-design-system.md
@@ -1247,7 +1247,7 @@ Full component contract and usage rules: [08-component-spec.md §17](08-componen
| Property | Value |
|---|---|
-| Position | top-center viewport, 16px from the top edge, `width: min(360px, 100vw − 32px)` |
+| Position | 16px from the top edge; centered in the main-content safe area when the in-flow shell is visible, falling back to the viewport when no main-content anchor exists; `width: min(360px, safe area − 32px)` |
| Surface | `bg-elevated-opaque` + 1px `border-subtle` + `shadow-dialog` (same family as floating menus) |
| Radius | radius-md-plus |
| Font | text-md, leading-compact-plus |
diff --git a/docs/spec/04-ux/08-component-spec.md b/docs/spec/04-ux/08-component-spec.md
index c0cabe228..a7e244fd4 100644
--- a/docs/spec/04-ux/08-component-spec.md
+++ b/docs/spec/04-ux/08-component-spec.md
@@ -3870,7 +3870,7 @@ Transient, non-blocking feedback for completed actions and failures that have no
### 17.2 Anatomy
```text
- ┌ toast-viewport (fixed top-center, z-toast) ┐
+ ┌ toast-viewport (fixed safe-area top-center, z-toast) ┐
│ ┌──────────────────────────────────────┐ │
newest, at anchor → │ │ (✓) Provider saved ✕ │ │
│ ├──────────────────────────────────────┤ │
@@ -3882,6 +3882,11 @@ Transient, non-blocking feedback for completed actions and failures that have no
- `ToastHost` (in `components/Toast.tsx`) renders the stack; mounted once per shell branch in `App.tsx`
- Each card: 16px variant icon (semantic tint) · message · X dismiss button
- Surface: `bg-elevated-opaque` + 1px `border-subtle` + `shadow-dialog`, radius-md-plus — same floating family as menus; metrics in [07-ui-design-system.md §11.8](07-ui-design-system.md#118-toast)
+- The host remains portaled to `document.body` for global stacking, but AppShell
+ anchors its horizontal center and width to the live `.main-pane` bounds. A
+ docked or resized work panel and a reopened sidebar therefore cannot be
+ covered by the toast stack. Settings and any shell without a main-content
+ anchor retain viewport-centered fallback placement.
### 17.3 API
@@ -3911,7 +3916,7 @@ dismissToast(id: number); // ToastHost internal / tests
- Auto-dismiss 4s (error 8s, `duration: 0` sticky); hovering a card pauses its timer, leaving resumes with remaining time
- Stack caps at 4 — oldest drops first; re-raising an identical message+variant restarts the existing toast instead of stacking a twin
-- Newest toast enters at the top-center anchor (slide-down 200ms ease-out) pushing older cards down; exit is a 150ms ease-in fade
+- Newest toast enters at the main-content safe area's top-center anchor (slide-down 200ms ease-out) pushing older cards down; exit is a 150ms ease-in fade
- Dismiss X always available; every card is an explicit non-drag pointer target
so hover pause and dismissal remain interactive where the top-center stack
overlaps frameless titlebar drag chrome
diff --git a/docs/spec/04-ux/09-interaction-patterns.md b/docs/spec/04-ux/09-interaction-patterns.md
index 413560afa..d496f3ef9 100644
--- a/docs/spec/04-ux/09-interaction-patterns.md
+++ b/docs/spec/04-ux/09-interaction-patterns.md
@@ -1115,7 +1115,7 @@ Running turns and pending approvals continue to gate the controls.
`aria-expanded` / `aria-controls`; it is open on first render so the provider
response is immediately discoverable, and supports copying the redacted text
- Never use inline error for transient background operations (plugin load, connection test)
-- Toasts stack vertically, newest on top, at top-center
+- Toasts stack vertically, newest on top, at the top-center of the live main-content safe area; they follow sidebar/work-panel width changes and fall back to viewport center when that anchor is absent
- Error toasts require manual dismiss or timeout at 8s (longer than success)
- Success toasts auto-dismiss at 4s
- One-off results of an explicit action (save, import, probe, sign-in, connection
diff --git a/docs/spec/06-delivery/04-e2e-test-plan.md b/docs/spec/06-delivery/04-e2e-test-plan.md
index 433e758e5..ab26d2bb1 100644
--- a/docs/spec/06-delivery/04-e2e-test-plan.md
+++ b/docs/spec/06-delivery/04-e2e-test-plan.md
@@ -11357,7 +11357,10 @@ This test plan spec is accepted when:
localized title and the first question in its toast; generated session-title
text never replaces that title. Background sessions retain the existing
native notification policy. Exactly one soft chime plays for the ask; the
- toast and native banner do not double it.
+ toast and native banner do not double it. With a right-docked work panel,
+ the toast stays horizontally centered within the main-content safe area and
+ never intersects the panel tab strip, browser navigation controls, or URL
+ field. It follows both safe-area resize and same-width horizontal shifts.
Clicking the question toast (including from New task or Settings) opens its
originating conversation and project, shows the pending card, and permits
submitting an answer for that request. Enter and Space activate the focused
@@ -11375,8 +11378,9 @@ This test plan spec is accepted when:
component in Electron and covers long-prompt scrolling, keyboard reachability,
visible header actions, and scroll reset on Next.
`pnpm test:e2e:question-notification` exercises real renderer event handling,
- toast creation, session/project navigation, and answer submission in isolated
- Electron with only the IPC boundary stubbed, plus native keyboard input.
+ safe-area geometry under resize and horizontal shift, toast creation,
+ session/project navigation, and answer submission in isolated Electron with
+ only the IPC boundary stubbed, plus native keyboard input.
- **Status**: Partially automated (component paths and long-prompt behavior are
covered; full application journey pending)
diff --git a/docs/zh-CN/spec/04-ux/01-ui-ia.md b/docs/zh-CN/spec/04-ux/01-ui-ia.md
index b48419d05..ae5bc8845 100644
--- a/docs/zh-CN/spec/04-ux/01-ui-ia.md
+++ b/docs/zh-CN/spec/04-ux/01-ui-ia.md
@@ -294,7 +294,7 @@ MCP、技能和子代理不再是扩展页的选项卡或区块。
| 模型菜单 | Composer 右侧模型 × 推理芯片 | 配置的 provider/model 选择 + 设置条目 (D091) |
| 个人资料菜单 | 侧边栏页脚 | 设置/日志/主题循环 (D041) |
| 通知收件箱 | 侧边栏页脚响铃 | All/Unread 视图、仅任务 failure 行(顺利完成的不显示,D295)、标记为全部读取和清除操作 (D130/D117) |
-| Toast | 事件(插件 toast、后端恢复、复制) | 顶部中心;默认 4 秒,错误 8 秒 |
+| Toast | 事件(插件 toast、后端恢复、复制) | 实时主内容安全区顶部居中;无锚点时回退到整个视口;默认 4 秒,错误 8 秒 |
| 项目切换菜单 | 空首页带下划线的项目名 | 侧边栏已打开项目 + 搜索 + 克隆 Git 项目 + 打开项目 |
## 5. 导航模型
diff --git a/docs/zh-CN/spec/04-ux/07-ui-design-system.md b/docs/zh-CN/spec/04-ux/07-ui-design-system.md
index 0e5655114..49ffc124f 100644
--- a/docs/zh-CN/spec/04-ux/07-ui-design-system.md
+++ b/docs/zh-CN/spec/04-ux/07-ui-design-system.md
@@ -1068,7 +1068,7 @@ Linux 保留淡入淡出和滑动退出。
| 财产 | 价值 |
|---|---|
-| 职位 | 顶部中心视口,距顶部边缘 16 像素,`width: min(360px, 100vw − 32px)` |
+| 位置 | 距顶部边缘 16px;流式 shell 可见时在主内容安全区内居中,没有主内容锚点时回退到整个视口;`width: min(360px, 安全区 − 32px)` |
| 表面 | `bg-elevated-opaque` + 1px `border-subtle` + `shadow-dialog`(与浮动菜单同族) |
| 半径 | 半径 md 加 |
| 字体 | 文本 md、前导紧凑加 |
diff --git a/docs/zh-CN/spec/04-ux/08-component-spec.md b/docs/zh-CN/spec/04-ux/08-component-spec.md
index 1f66f179e..f281a0655 100644
--- a/docs/zh-CN/spec/04-ux/08-component-spec.md
+++ b/docs/zh-CN/spec/04-ux/08-component-spec.md
@@ -2593,7 +2593,7 @@ Live Voice 受现有开发者模式和开发构建门控约束,包含四种展
### 17.2 解剖学
```text
- ┌ toast-viewport (fixed top-center, z-toast) ┐
+ ┌ toast-viewport (fixed safe-area top-center, z-toast) ┐
│ ┌──────────────────────────────────────┐ │
newest, at anchor → │ │ (✓) Provider saved ✕ │ │
│ ├──────────────────────────────────────┤ │
@@ -2605,6 +2605,10 @@ Live Voice 受现有开发者模式和开发构建门控约束,包含四种展
- `ToastHost`(在 `components/Toast.tsx` 中)渲染堆栈;在 `App.tsx` 中的每个 shell 分支安装一次
- 每张卡片:16px 变体图标(语义色调)·消息·X 关闭按钮
- Surface:`bg-elevated-opaque` + 1px `border-subtle` + `shadow-dialog`,radius-md-plus — 与菜单相同的浮动系列; [07-ui-design-system.md §11.8](/zh-CN/spec/04-ux/07-ui-design-system#_11-8-toast) 中的指标
+- Host 仍通过 portal 挂在 `document.body` 以维持全局层级,但 AppShell 会把
+ 水平中心和宽度锚定到实时 `.main-pane` 边界。停靠或调整工作面板、重新打开
+ 侧栏时,Toast 堆栈都不会覆盖这些区域。设置页和没有主内容锚点的 shell
+ 保留以整个视口为中心的回退位置。
### 17.3 API
@@ -2634,7 +2638,7 @@ dismissToast(id: number); // ToastHost internal / tests
- 自动关闭 4 秒(错误 8 秒,`duration: 0` 粘性);悬停卡片会暂停其计时器,离开悬停后从剩余时间继续
- 堆叠上限为 4 — 最旧的掉落优先;重新引发相同的消息+变体会重新启动现有的 toast,而不是堆叠一个双胞胎
-- 最新的 toast 进入顶部中心锚点(向下滑动 200 毫秒缓出),将旧卡向下推;退出是 150 毫秒的渐入淡出
+- 最新 Toast 从主内容安全区的顶部中心锚点进入(向下滑动 200ms 缓出),将旧卡向下推;退出为 150ms 淡出
- 关闭 X 始终可用;每张卡都是明确的非拖动指针目标
因此,悬停暂停和关闭保持交互,其中顶部中心堆栈
重叠无框标题栏拖动镶边
diff --git a/docs/zh-CN/spec/04-ux/09-interaction-patterns.md b/docs/zh-CN/spec/04-ux/09-interaction-patterns.md
index 6adca77b9..c91ff8930 100644
--- a/docs/zh-CN/spec/04-ux/09-interaction-patterns.md
+++ b/docs/zh-CN/spec/04-ux/09-interaction-patterns.md
@@ -871,7 +871,7 @@ Mode/provider/model/permission/shell 配置和新提示仍然存在
`aria-expanded` / `aria-controls`;它在第一次渲染时打开,因此提供商
响应可立即发现,并支持复制编辑文本
- 切勿将内联错误用于瞬态后台操作(插件加载、连接测试)
-- Toast 垂直堆叠,最新的位于顶部中央
+- Toast 垂直堆叠,最新的位于实时主内容安全区顶部中央;侧栏或工作面板改变宽度时同步移动,没有该锚点时回退到整个视口中心
- 错误 toast 需要手动关闭或超时 8 秒(比成功长)
- 成功祝酒在 4 秒后自动关闭
- 明确动作的一次性结果(保存、导入、探测、登录、连接测试)走 toast;来源界面保留其
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.md
index d6b118154..a5d5a1e47 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
@@ -6724,14 +6724,16 @@ eleven-tool-round desktop paths are verified by
倒计时。过长的问题正文在卡片内滚动(`min(208px, 24dvh)`,并有 `24vh` 回退),可通过键盘聚焦且显示焦点环;标题栏上的
Decline、Skip 和 Next/Submit 留在该滚动区域之外。切换问题后正文从顶部开始。工具输出排序为 `question:answer`,使用 `、`
多个答案之间和问题之间的 `\n---\n` 之间,并保持
- `question:` 用于跳过的问题。拒绝所有产生空
- 每个问题的占位符,仍然完成工具调用。
+ `question:` 用于跳过的问题。拒绝所有会产生空的
+ 每个问题占位符,但仍然完成工具调用。右侧工作面板打开时,问题 Toast 在
+ 主内容安全区内水平居中,不与面板标签栏、浏览器导航控件或地址栏相交;安全区
+ 缩放或同宽平移时 Toast 同步跟随。
- **链接规格**:`03-runtime/17-asktool-questions.md`,
`04-ux/11-asktool-question-card.md`、ADR 0077
- **验收**:E(交互式工具输出)、C(内联卡)
- **里程碑**:M5
-- **自动化覆盖**:`pnpm test:e2e:asktool-card` 在 Electron 中挂载生产组件,覆盖长问题滚动、键盘可达性、标题栏动作可见性和点击 Next 后的滚动重置。
-- **状态**:部分自动化(组件路径和长问题行为已覆盖;完整应用桌面旅程仍待完成)
+- **自动化覆盖**:`pnpm test:e2e:asktool-card` 在 Electron 中挂载生产组件,覆盖长问题滚动、键盘可达性、标题栏动作可见性和点击 Next 后的滚动重置。`pnpm test:e2e:question-notification` 覆盖安全区缩放与水平平移、Toast 创建、会话/项目导航、答案提交和原生键盘输入。
+- **状态**:部分自动化(组件路径、长问题行为和通知安全区已覆盖;完整应用桌面旅程仍待完成)
- **请求切换回归**:在聊天 B 留下一个单题请求。在聊天 A 将双题请求推进到第二题,
再切换到 B。B 应显示自己的第一题、空白答案和可用输入框,不应出现应用错误页。
diff --git a/scripts/e2e/question-notification.tsx b/scripts/e2e/question-notification.tsx
index 8499b2b9b..122e404e3 100644
--- a/scripts/e2e/question-notification.tsx
+++ b/scripts/e2e/question-notification.tsx
@@ -1,3 +1,4 @@
+import { useState } from "react";
import { createRoot } from "react-dom/client";
import { flushSync } from "react-dom";
import i18n from "i18next";
@@ -46,14 +47,23 @@ function until(predicate: () => boolean, message: string): Promise<void> {
});
}
function Surface() {
+ const [toastAnchor, setToastAnchor] = useState<HTMLDivElement | null>(null);
const active = useAppStore((state) => state.activeSessionId);
const page = useAppStore((state) => state.page);
const pending = useAppStore((state) => state.pendingAsks);
const request = active ? headAsk(pending, active) : undefined;
return <>
+ <div
+ aria-hidden
+ style={{ position: "fixed", inset: 0, display: "flex", pointerEvents: "none" }}
+ >
+ <div id="toast-left-rail" style={{ flex: "0 0 0" }} />
+ <div ref={setToastAnchor} id="toast-safe-area" style={{ flex: "0 0 640px" }} />
+ <div style={{ flex: 1 }} />
+ </div>
<output id="active-chat">{page}:{active ?? "home"}</output>
{request && <AskToolCard key={request.requestId} request={request} />}
- <ToastHost />
+ <ToastHost anchorElement={toastAnchor} />
</>;
}
function reset(page: "chat" | "settings" = "chat", activeSessionId?: string) {
@@ -92,6 +102,18 @@ async function selected(sessionId: string) {
assert(useAppStore.getState().activeProjectPath === `C:/fixture/${sessionId}`, "Project did not follow the chat");
assert(useAppStore.getState().messages[0]?.content === `Transcript ${sessionId}`, "Wrong conversation transcript");
}
+function toastFollowsSafeArea(): boolean {
+ const safeArea = document.getElementById("toast-safe-area");
+ const viewport = document.querySelector<HTMLElement>(".toast-viewport");
+ if (!safeArea || !viewport) return false;
+ const safeRect = safeArea.getBoundingClientRect();
+ const toastRect = viewport.getBoundingClientRect();
+ const safeCenter = safeRect.left + safeRect.width / 2;
+ const toastCenter = toastRect.left + toastRect.width / 2;
+ return toastRect.left >= safeRect.left - 0.5 &&
+ toastRect.right <= safeRect.right + 0.5 &&
+ Math.abs(toastCenter - safeCenter) <= 0.5;
+}
declare global {
var questionNotificationProbe: () => Promise<unknown>;
@@ -145,6 +167,15 @@ globalThis.questionNotificationProbe = async () => {
reset();
const request = ask("B");
const originalToastId = useAppStore.getState().toasts[0]?.id;
+ await until(toastFollowsSafeArea, "question toast stays inside the main-content safe area");
+ const safeArea = document.getElementById("toast-safe-area");
+ assert(safeArea, "Missing toast safe area");
+ safeArea.style.flexBasis = "520px";
+ await until(toastFollowsSafeArea, "question toast follows the resized main-content safe area");
+ const leftRail = document.getElementById("toast-left-rail");
+ assert(leftRail, "Missing toast safe-area left rail");
+ leftRail.style.flexBasis = "120px";
+ await until(toastFollowsSafeArea, "question toast follows a shifted main-content safe area");
assert(useAppStore.getState().activeSessionId === undefined, "Receipt must not navigate automatically");
action("B").click();
assert(useAppStore.getState().toasts.some((item) => item.id === originalToastId),
@@ -255,6 +286,8 @@ globalThis.questionNotificationProbe = async () => {
await selected("B");
assert(unexpected.length === 0, `Unexpected IPC: ${unexpected}`);
};
- return { ok: true, home: true, crossProject: true, answered: true, distinctTargets: true,
- dismiss: true, textSelection: true, focusTimer: true, ordinaryToast: true, errorFeedback: true, retry: true };
+ return { ok: true, home: true, safeArea: true, safeAreaResize: true,
+ safeAreaShift: true, crossProject: true, answered: true, distinctTargets: true,
+ dismiss: true, textSelection: true, focusTimer: true, ordinaryToast: true,
+ errorFeedback: true, retry: true };
};