Skip to content

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

fix(composer): fade the transcript instead of painting an opaque dock band (#1015)

TioitWang100d4d976211
diff --git a/apps/desktop/src/styles/chat-shell.css b/apps/desktop/src/styles/chat-shell.css
index 31c530f08..2858c6f68 100644
--- a/apps/desktop/src/styles/chat-shell.css
+++ b/apps/desktop/src/styles/chat-shell.css
@@ -205,6 +205,26 @@
scrollbar-gutter: stable;
/* Pinned-follow drives the scroll position; native anchoring fights it. */
overflow-anchor: none;
+ /* Hide the transcript across the Composer reserve instead of covering it with
+ * an opaque dock band (issue #728, revised by D624). The gradient resolves
+ * against this scrollport's own box, so it stays anchored to the pane while
+ * the rows move through it. `- 16px` is exactly the trailing reserve
+ * `.thread-content` adds below the Composer's measured height, so a
+ * transcript pinned to its end keeps its last row fully opaque and only the
+ * rows crossing the boundary fade.
+ * The mask belongs here rather than on `.thread-wrap`: its other children -
+ * the minimap rail, the jump-to-latest button, the settle veil, and the
+ * navigation status - must stay fully painted. */
+ -webkit-mask-image: linear-gradient(
+ to bottom,
+ #000 calc(100% - var(--composer-dock-height, 168px) - 16px),
+ transparent calc(100% - var(--composer-dock-height, 168px) + 2px)
+ );
+ mask-image: linear-gradient(
+ to bottom,
+ #000 calc(100% - var(--composer-dock-height, 168px) - 16px),
+ transparent calc(100% - var(--composer-dock-height, 168px) + 2px)
+ );
}
/* Floats above the docked composer fade when the user scrolls away from latest */
diff --git a/apps/desktop/src/styles/composer-menus.css b/apps/desktop/src/styles/composer-menus.css
index 0d3045666..75e5b5952 100644
--- a/apps/desktop/src/styles/composer-menus.css
+++ b/apps/desktop/src/styles/composer-menus.css
@@ -120,7 +120,7 @@
border-radius: var(--radius-full) !important;
color: var(--ds-text-secondary) !important;
font-size: var(--text-sm);
- line-height: 1;
+ line-height: var(--leading-none);
overflow: hidden;
transition:
background var(--motion-duration-fast) var(--motion-ease-out),
@@ -493,10 +493,7 @@
background: var(--ds-bg-elevated-opaque);
backdrop-filter: none;
-webkit-backdrop-filter: none;
- box-shadow:
- 0 0 0 0.5px color-mix(in oklab, #1a1c1f 10%, transparent),
- 0 8px 32px rgba(0, 0, 0, 0.1),
- 0 2px 8px rgba(0, 0, 0, 0.06);
+ box-shadow: var(--ds-shadow-model-menu);
}
:root[data-theme="light"] .composer-model-group-label {
diff --git a/apps/desktop/src/styles/composer.css b/apps/desktop/src/styles/composer.css
index 778ce52b2..ed8301eec 100644
--- a/apps/desktop/src/styles/composer.css
+++ b/apps/desktop/src/styles/composer.css
@@ -12,14 +12,17 @@
}
/* Thread mode: floating bottom dock. The transcript reserves the composer's
- * measured height for scrolling, while this solid workspace-coloured band
- * clips transcript paint before it can remain visible below the shell. */
+ * measured height for scrolling and fades its own paint out across that
+ * reserve (see `.thread-scroll` in chat-shell.css), so the dock paints no
+ * backing at all. Painting an opaque `--ds-bg-primary` band here did clip that
+ * paint, but it also hid whatever a theme had drawn on the conversation pane
+ * behind it (issue #728, D603, revised by D624). */
.composer-dock-docked {
position: absolute;
inset-inline: 0;
bottom: 0;
padding: 0 24px 16px;
- background: var(--ds-bg-primary);
+ background: transparent;
}
/* Home mode: the shell is owned by the bottom-reserved home composer region. */
diff --git a/apps/desktop/src/styles/tokens.css b/apps/desktop/src/styles/tokens.css
index c25ddbc58..574a54548 100644
--- a/apps/desktop/src/styles/tokens.css
+++ b/apps/desktop/src/styles/tokens.css
@@ -145,6 +145,7 @@
--ds-info: var(--gray-300);
--ds-purple: #c27aff;
--ds-shadow-dialog: 0 16px 48px rgba(0, 0, 0, 0.55);
+ --ds-shadow-model-menu: var(--ds-shadow-dialog);
/* Codex --elevation-prominent (same stroke+lift in dark and light) */
--ds-elevation-stroke: 0 0 0 0.5px color-mix(in oklab, var(--gray-0) 12%, transparent);
/* D297: the composer lifts by shadow alone; the hairline stroke is gone. */
@@ -281,6 +282,10 @@
--ds-info: #5d5d5d;
--ds-purple: #7c3aed;
--ds-shadow-dialog: 0 16px 48px rgba(0, 0, 0, 0.12);
+ --ds-shadow-model-menu:
+ 0 0 0 0.5px color-mix(in oklab, #1a1c1f 10%, transparent),
+ 0 8px 32px rgba(0, 0, 0, 0.1),
+ 0 2px 8px rgba(0, 0, 0, 0.06);
--ds-elevation-stroke: 0 0 0 0.5px color-mix(in oklab, #1a1c1f 12%, transparent);
/* Codex elevation-prominent exact (same dark/light formula). */
--ds-shadow-composer: 0 3px 7.5px #0000000a, 0 0 20px #0000000d;
diff --git a/apps/desktop/src/styles/work-panel.css b/apps/desktop/src/styles/work-panel.css
index 03042ff33..64581ba8e 100644
--- a/apps/desktop/src/styles/work-panel.css
+++ b/apps/desktop/src/styles/work-panel.css
@@ -408,7 +408,7 @@
}
.subagent-transcript-jump {
- bottom: 76px;
+ bottom: calc(var(--st-composer-dock-height, 68px) + 8px);
z-index: 6;
}
diff --git a/docs/spec/04-ux/08-component-spec.md b/docs/spec/04-ux/08-component-spec.md
index e64afe93d..b2e4619c7 100644
--- a/docs/spec/04-ux/08-component-spec.md
+++ b/docs/spec/04-ux/08-component-spec.md
@@ -2749,9 +2749,12 @@ reasoning-level control.
`.composer-toolbar` spacing, minimum heights, theme surfaces, and controls.
Only the parent placement and the localized placeholder copy differ between
the empty home and a recorded conversation. In a recorded conversation,
- `.composer-dock-docked` paints the primary workspace background across its
- full width. This occlusion band prevents transcript rows from remaining
- visible beneath the floating shell or through its rounded outer corners.
+ `.composer-dock-docked` paints no backing of its own: `.thread-scroll` masks
+ its own content out across the trailing reserve the transcript holds below
+ the Composer's measured height, so rows fade at the Composer boundary instead
+ of remaining visible beneath the floating shell or through its rounded outer
+ corners, and the conversation pane's own surface stays visible behind the
+ dock (issue #728, D624).
- Empty draft height: `.composer-input` uses `min-height: 3lh`, so an idle
composer shows three lines of input before it grows with the draft.
- Scroll stability: The thread scrollport reserves one stable trailing gutter,
diff --git a/docs/spec/06-delivery/04-e2e-test-plan.md b/docs/spec/06-delivery/04-e2e-test-plan.md
index 54fde409f..0069e9baa 100644
--- a/docs/spec/06-delivery/04-e2e-test-plan.md
+++ b/docs/spec/06-delivery/04-e2e-test-plan.md
@@ -6167,15 +6167,19 @@ must keep splitting are covered by `markdown-blocks.test.mjs`.
- **Covers**: C, Quality / floating composer and retry surfaces
- **Preconditions**: Renderer CSS is the production source under `apps/desktop/src/styles`.
- **Steps**:
- 1. Inspect the computed background of `.composer-dock-docked` in both built-in themes and a custom theme.
- 2. Scroll a long transcript until a row passes beneath the floating Composer.
+ 1. Inspect the computed background of `.composer-dock-docked` (fully transparent) and the `.thread-scroll` mask with two different `--composer-dock-height` values, in both built-in themes and a custom theme.
+ 2. Scroll a long transcript until a row crosses the Composer boundary.
3. Inspect `.plan-approval-bar` in the composer dock styles.
4. Inspect `.run-activity-error-popover.message-error` in the transcript styles.
5. Hover or focus a retrying active-turn row in a live session.
- **Expected**:
- - The dock paints the opaque `--ds-bg-primary` workspace surface across its
- full width. Transcript text disappears at the Composer boundary and cannot
- remain visible below the shell or around its rounded corners.
+ - The dock paints no backing surface. Transcript text fades out across the
+ `.thread-scroll` mask at the Composer boundary and cannot remain visible
+ below the shell or around its rounded corners. The mask's two stops sit
+ `--composer-dock-height + 16px` and `--composer-dock-height - 2px` above the
+ scrollport's bottom edge, so a transcript pinned to its end keeps its last
+ row fully opaque and the conversation pane's own surface - including a
+ contributed theme's background - stays visible behind the dock.
- The Plan/Goal approval bar paints `--ds-bg-composer` with `--ds-shadow-composer` rather than the in-flow `--ds-tile` wash, so it remains a readable plate over the transparent composer dock.
- The retry hover tooltip mixes the error tint over `--ds-bg-elevated-opaque`, so transcript text does not show through.
- The retry tooltip is capped to the room above the tail status row and
diff --git a/docs/spec/08-meta/decisions-log.md b/docs/spec/08-meta/decisions-log.md
index 1983106c5..23d429bff 100644
--- a/docs/spec/08-meta/decisions-log.md
+++ b/docs/spec/08-meta/decisions-log.md
@@ -7037,3 +7037,33 @@ must keep splitting are covered by `markdown-blocks.test.mjs`.
before an extensionless Git-Bash `npx` shim.
- Secrets still do not cross (D018). Command names stay bare. See ADR 0038
and `07-plugins/04-plugin-security.md`.
+
+## 2026-09-24 — The transcript occludes itself instead of the dock painting a band (D624, issue #728)
+
+- The opaque `--ds-bg-primary` band added for issue #728 kept transcript rows
+ from showing below the Composer, but it also covered whatever a contributed
+ theme had drawn on the conversation pane. A theme that fills `.main-pane` or
+ `.thread-scroll` (the theme studio's `main` / `thread` regions) got a
+ hard-edged rectangle of the built-in workspace colour across the bottom of the
+ chat. No theme region could reach that band: the only lever was
+ `--ds-bg-primary` itself, which every other primary surface follows.
+- `.composer-dock-docked` now paints nothing, and `.thread-scroll` masks its own
+ content out with `linear-gradient(to bottom, #000 calc(100% -
+ var(--composer-dock-height) - 16px), transparent calc(100% -
+ var(--composer-dock-height) + 2px))`. The gradient resolves against the
+ scrollport's own box, so it stays anchored to the pane while rows move through
+ it. `- 16px` is exactly the trailing reserve `.thread-content` adds below the
+ measured Composer height, so a transcript pinned to its end keeps its last row
+ fully opaque and only the rows crossing the boundary fade.
+- The mask belongs on the scroller rather than on `.thread-wrap`: the minimap
+ rail, the jump-to-latest button, the settle veil, and the navigation status
+ are `.thread-wrap` children that must stay fully painted. The dock's own
+ stacked plates (`.asktool-card`, `.plan-approval-bar`, queued prompts, the
+ shell) were already opaque and are siblings of `.thread-wrap`, so they are
+ unaffected. The scrollport's last 18px of scrollbar now fades instead of being
+ covered by the band.
+- Renderer CSS and the theme surface regression change only. The theme surface
+ probe pins the dock to fully transparent and asserts the mask tracks
+ `--composer-dock-height`. There is no scroll state, protocol, persistence,
+ theme schema, or permission change. See `04-ux/08-component-spec.md` and
+ E2E-CHAT-opaque-floating-decision-and-retry-surfaces.
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 9f481cc97..132bfe680 100644
--- a/docs/zh-CN/spec/04-ux/08-component-spec.md
+++ b/docs/zh-CN/spec/04-ux/08-component-spec.md
@@ -1954,8 +1954,10 @@ MainChat 底部的输入区域,用于撰写和发送提示。支持多行输
在主模式或线程对接模式下保留在外壳上方 (D095)
- 背景:一个坚实的语义输入框表面;无内部梯度,
背景图像,或装饰水洗
-- 会话中的 `.composer-dock-docked` 使用主工作区背景绘制整条停靠区域,
- 遮住滚到悬浮输入框下方以及圆角外侧的正文;首页模式不绘制这条遮罩。
+- 会话中的 `.composer-dock-docked` 自身不绘制任何底衬:由 `.thread-scroll`
+ 在正文预留区(Composer 实测高度下方的尾部留白)内把自身内容渐隐,
+ 因此正文在 Composer 边界处淡出,而不是留在悬浮输入框下方或圆角外侧,
+ 会话面板自己的表面(含主题铺的背景)在停靠区后面保持可见(issue #728、D624)。
- 仰角:20px半径,只有克制的柔和阴影;细线描边已在 D297 移除;
停靠的文字淡入淡出位于输入框外壳之外
- solid/near-opaque 表面不使用 `backdrop-filter`; focus-within 添加了一个
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 e80d1659f..bf6c1154f 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
@@ -3988,14 +3988,17 @@ eleven-tool-round desktop paths are verified by
- **覆盖**:C、品质 / 浮动 Composer 与重试表面
- **先决条件**:渲染器 CSS 为 `apps/desktop/src/styles` 下的生产源。
- **步骤**:
- 1. 在两套内置主题和一套自定义主题中检查 `.composer-dock-docked` 的计算背景。
- 2. 滚动长会话,让一行正文经过悬浮 Composer 下方。
+ 1. 用两个不同的 `--composer-dock-height` 值检查 `.composer-dock-docked` 的计算背景(应完全透明)与 `.thread-scroll` 的遮罩,覆盖两套内置主题与一套自定义主题。
+ 2. 滚动长会话,让一行正文越过 Composer 边界。
3. 检查 Composer 停靠栏样式中的 `.plan-approval-bar`。
4. 检查记录样式中的 `.run-activity-error-popover.message-error`。
5. 在实时会话中悬停或聚焦正在重试的活动行。
- **预期**:
- - 停靠区横跨整个宽度绘制不透明的 `--ds-bg-primary` 工作区表面;正文在
- Composer 边界处消失,不会留在输入框下方或圆角外侧。
+ - 停靠区不绘制任何底衬。正文在 Composer 边界处经 `.thread-scroll` 的遮罩
+ 淡出,不会留在输入框下方或圆角外侧;遮罩的两个色标分别位于滚动容器底边
+ 之上 `--composer-dock-height + 16px` 与 `--composer-dock-height - 2px`,
+ 因此滚到底时最后一行保持完全不透明,会话面板自己的表面(含主题铺的背景)
+ 在停靠区后面保持可见。
- Plan/Goal 审批条使用 `--ds-bg-composer` 加 `--ds-shadow-composer`,而不是正文流里的 `--ds-tile` 薄洗,因此在透明停靠栏上仍可读。
- 重试 hover tooltip 把错误色混在 `--ds-bg-elevated-opaque` 上,记录正文不会透出。
- 重试 tooltip 的高度被限制在尾部状态行上方的可用空间内,其余部分可滚动,
diff --git a/docs/zh-CN/spec/08-meta/decisions-log.md b/docs/zh-CN/spec/08-meta/decisions-log.md
index 6938cca4a..f1446cddb 100644
--- a/docs/zh-CN/spec/08-meta/decisions-log.md
+++ b/docs/zh-CN/spec/08-meta/decisions-log.md
@@ -4973,3 +4973,27 @@ Markdown 源码,不是 `text/html` 负载;对禁用行内 HTML 的外部编
的 Git-Bash `npx` 脚本。
- 密钥仍不穿越(D018)。命令名保持裸名。见 ADR 0038 与
`07-plugins/04-plugin-security.md`。
+
+## 2026-09-24 — 由正文自己遮挡,而不是停靠区画一条色带(D624,issue #728)
+
+- 为 issue #728 加在 `.composer-dock-docked` 上的不透明 `--ds-bg-primary`
+ 色带确实挡住了正文漏到 Composer 下方,但它同时盖住了主题画在会话面板上的
+ 东西:主题填充 `.main-pane` 或 `.thread-scroll`(主题工坊的 `main` /
+ `thread` 区域)时,聊天底部会出现一块内置工作区色的硬边矩形。这条色带不
+ 属于任何主题区域,唯一可用的杠杆是 `--ds-bg-primary` 本身,而所有其它主
+ 表面都跟着它走。
+- `.composer-dock-docked` 现在不绘制任何底衬,改由 `.thread-scroll` 用
+ `linear-gradient(to bottom, #000 calc(100% - var(--composer-dock-height)
+ - 16px), transparent calc(100% - var(--composer-dock-height) + 2px))`
+ 遮掉自身内容。渐变按滚动容器自己的盒子解析,因此正文移动时它仍锚在面板
+ 上;`- 16px` 正好是 `.thread-content` 在 Composer 实测高度之下留出的尾部
+ 预留,所以滚到底时最后一行保持完全不透明,只有越过边界的行会淡出。
+- 遮罩挂在滚动容器而不是 `.thread-wrap`:缩略导航轨道、跳到最新按钮、骨架
+ 遮罩和导航状态都是 `.thread-wrap` 的子节点,必须保持完全绘制。停靠区自己
+ 堆叠的面板(`.asktool-card`、`.plan-approval-bar`、排队提示、输入胶囊)
+ 本来就是不透明的,且是 `.thread-wrap` 的兄弟节点,因此不受影响。滚动条
+ 最后 18px 由「被色带盖住」改为「淡出」。
+- 仅改渲染器 CSS 与主题表面回归用例。主题表面探针把停靠区固定为全透明,并
+ 断言遮罩跟随 `--composer-dock-height`。滚动状态、协议、持久化、主题
+ schema、权限都没有变化。见 `04-ux/08-component-spec.md` 与
+ E2E-CHAT-opaque-floating-decision-and-retry-surfaces。
diff --git a/scripts/e2e-theme-surfaces.mjs b/scripts/e2e-theme-surfaces.mjs
index 2cd2c9839..c9f4bc558 100644
--- a/scripts/e2e-theme-surfaces.mjs
+++ b/scripts/e2e-theme-surfaces.mjs
@@ -24,7 +24,7 @@ try {
await cp(join(renderer, "assets"), join(temp, "assets"), { recursive: true });
await writeFile(join(temp, "index.html"), `<!doctype html><meta charset="utf-8"><meta http-equiv="Content-Security-Policy" content="default-src 'self'; style-src 'self' 'unsafe-inline'; font-src 'self' data:"><title>Theme surface regression</title>${css.map((path) => `<link rel="stylesheet" href="${path}">`).join("")}<style>body { padding: 32px; display: flex; gap: 32px; align-items: flex-start; } .fixture-controls { width: 420px; display: grid; gap: 24px; } .fixture-prose { width: 420px; display: grid; gap: 12px; } .settings-shell-full { width: 275px; height: 340px; } .settings-toggle { margin: 20px; } /* Fixed/absolute app layers stay in flow here so they do not cover other fixtures. Only position changes, never paint. */ .fixture-controls .overlay, .fixture-controls .plugins-modal-backdrop, .fixture-controls .composer-dock-docked { position: static; inset: auto; padding: 12px; animation: none; }</style><body>
<section class="settings-shell-full"><nav class="settings-nav sidebar-surface"><div class="settings-nav-top"><input class="settings-search" placeholder="Search settings"></div><div class="settings-nav-scroll"><button class="settings-nav-item active">General</button><button class="settings-nav-item">Appearance</button><button class="settings-toggle on" aria-label="Enabled"><span class="settings-toggle-thumb"></span></button></div></nav></section>
- <section class="fixture-controls"><div class="composer-shell">Composer surface</div><div class="composer-dock composer-dock-docked">Transcript occlusion band</div><input class="plugins-search" placeholder="Search plugins"><div class="agent-capability-search-wrap"><input class="agent-capability-search" placeholder="Search capabilities"></div><div class="overlay">Dialog scrim</div><div class="plugins-modal-backdrop">Permission veil</div></section>
+ <section class="fixture-controls"><div class="composer-shell">Composer surface</div><div class="composer-dock composer-dock-docked">Transparent composer dock</div><div class="thread-scroll">Transcript scroller</div><input class="plugins-search" placeholder="Search plugins"><div class="agent-capability-search-wrap"><input class="agent-capability-search" placeholder="Search capabilities"></div><div class="overlay">Dialog scrim</div><div class="plugins-modal-backdrop">Permission veil</div></section>
<section class="fixture-controls"><div class="composer-stack"><section class="asktool-card"><div class="asktool-card-header"><span class="asktool-card-title">Question</span></div><button class="asktool-option">Blue</button><button class="asktool-option selected">Green</button><input class="asktool-custom-input" placeholder="Other" aria-label="Other"></section></div></section>
<section class="fixture-prose"><div class="prose-chat"><p>Answer prose with a <kbd>K</kbd> keycap and an <code>inline chip</code>.</p></div><div class="thinking-prose"><code>thinking code</code></div><div class="code-block-head">Code card head band</div><div class="mermaid-block-body">Mermaid canvas</div><button class="send-btn" disabled>Send</button></section>
<section class="fixture-tools"><div class="tool-row-content">Tool output</div><div class="tool-block is-plain"><div class="tool-row-content">Plain tool output</div></div><div class="tool-row-content is-error">Error tool output</div></section>
diff --git a/scripts/e2e/theme-surfaces.js b/scripts/e2e/theme-surfaces.js
index 98df79809..4a8a4d506 100644
--- a/scripts/e2e/theme-surfaces.js
+++ b/scripts/e2e/theme-surfaces.js
@@ -34,20 +34,25 @@ const surfaces = {
kbd: [".prose-chat kbd", "--ds-prose-kbd-fg", "ink"],
asktoolCard: [".composer-stack > .asktool-card", "--ds-bg-composer"],
asktoolOption: [".asktool-option", "--ds-tile-deep"],
- dockMask: [".composer-dock-docked", "--ds-bg-primary"],
+ // D624: the dock paints no backing band at all - the transcript masks its own
+ // paint out across the Composer reserve - so this surface is pinned to
+ // "paints nothing" instead of following a token.
+ dockMask: [".composer-dock-docked", null, "pinned"],
};
// Issue #360: the dock question card rides the composer plate and its option
-// rows are inlaid on it. Sampled the same way as the table above.
+// rows are inlaid on it. D624: the dock itself paints nothing (see `dockMask`),
+// so its built-in paint is pinned to fully transparent rather than to a token.
+// Sampled the same way as the table above.
Object.assign(DEFAULT_RGBA.light, {
asktoolCard: [255, 255, 255, 255],
asktoolOption: [26, 26, 26, 20],
- dockMask: [255, 255, 255, 255],
+ dockMask: [0, 0, 0, 0],
});
Object.assign(DEFAULT_RGBA.dark, {
asktoolCard: [33, 33, 33, 245],
asktoolOption: [255, 255, 255, 20],
- dockMask: [24, 24, 24, 255],
+ dockMask: [0, 0, 0, 0],
});
const COMPOSER_SHADOW = "rgba(0, 0, 0, 0.04) 0px 3px 7.5px 0px, rgba(0, 0, 0, 0.05) 0px 0px 20px 0px";
Object.assign(DEFAULT_SHADOWS.light, { asktoolCard: COMPOSER_SHADOW });
@@ -151,17 +156,38 @@ globalThis.themeSurfacesProbe = async (theme, custom) => {
elevatedRgba: rgba(getComputedStyle(document.documentElement).getPropertyValue("--ds-bg-elevated-primary").trim()) };
};
-// This mode still isolates the Composer occlusion regression from the keyboard
-// checks: the driver enables Chromium focus emulation for :focus-visible, and
-// this probe only needs the token-driven paint of the dock mask.
+// D624 replaced the opaque dock band with a mask on the transcript scrollport,
+// so this mode asserts the occlusion regression from both ends and needs
+// neither the theme-surface table nor the keyboard-focus checks: the dock must
+// paint nothing, and `.thread-scroll` must fade its content out across the
+// reserve `.thread-content` holds below the Composer's measured height.
globalThis.themeDockMaskProbe = async (theme, custom) => {
- const result = await globalThis.themeSurfacesProbe(theme, custom);
- const dock = result.values.dockMask;
- const expected = rgba(
- getComputedStyle(document.documentElement).getPropertyValue("--ds-bg-primary").trim(),
- );
const failures = [];
- if (String(dock.rgba) !== String(expected)) failures.push("dock mask ignores --ds-bg-primary");
- if (dock.rgba[3] !== 255) failures.push("dock mask is not opaque");
- return { ok: failures.length === 0, theme, custom, dock, expected, failures };
+ const root = document.documentElement;
+ const dock = sample(".composer-dock-docked");
+ if (dock.rgba[3] !== 0) failures.push("dock paints a backing band again");
+ const scroller = document.querySelector(".thread-scroll");
+ const previous = root.style.getPropertyValue("--composer-dock-height");
+ const masks = [];
+ for (const height of [120, 200]) {
+ root.style.setProperty("--composer-dock-height", `${height}px`);
+ await settle();
+ const style = getComputedStyle(scroller);
+ const image = style.maskImage !== "none" ? style.maskImage : style.webkitMaskImage;
+ // Stop positions are authored as `calc(100% - <height>px - 16px)`; read how
+ // far each one sits above the scrollport's bottom edge.
+ const offsets = [...image.matchAll(/calc\(100%((?:\s*[+-]\s*[\d.]+px)+)\)/g)].map((match) =>
+ -[...match[1].matchAll(/([+-])\s*([\d.]+)px/g)].reduce(
+ (total, [, sign, value]) => total + (sign === "-" ? -1 : 1) * Number(value),
+ 0,
+ ),
+ );
+ masks.push({ height, image, offsets });
+ if (offsets.length !== 2) failures.push(`transcript mask is not a two-stop fade at ${height}px: ${image}`);
+ else if (String(offsets) !== String([height + 16, height - 2]))
+ failures.push(`transcript mask ignores --composer-dock-height at ${height}px: ${offsets}`);
+ }
+ if (previous) root.style.setProperty("--composer-dock-height", previous);
+ else root.style.removeProperty("--composer-dock-height");
+ return { ok: failures.length === 0, theme, custom, dock, masks, failures };
};