Skip to content

test(#616): cover the failed open state in the floating assistant panel - #1

Open
HugoXK wants to merge 89 commits into
mainfrom
lp/dev-4/616-floating-failure-state
Open

HugoXK wants to merge 89 commits into
mainfrom
lp/dev-4/616-floating-failure-state

Conversation

@HugoXK

@HugoXK HugoXK commented Nov 18, 2026

Copy link
Copy Markdown
Owner

Written-by: LaunchPad Dev-4
Claim-Id: 6976637109

Refs agent-CI-Infra#616。本单验收第 3 条要求「浮动面板与全页行为一致」。agent-CI-Infra#1038 只覆盖了全页形态(其正文写明「浮动面板形态不在本次范围……另开处理」),这一支补上浮动面板形态的覆盖。

结论先说:浮动面板形态本来就已经一致,这一支不加生产代码

失败卡、单次原因、重试 / 查看项目列表 / 查看身份与权限、新建会话 / 快捷操作 的禁用与 aria-describedby,全部出自同一处共享状态渲染(static/management/conversation.js:75-91 的 showAccessError)。浮动面板只是同一 DOM 的另一种呈现(.management-window:not(.management-page)),所以 agent-CI-Infra#1038 的修复在它身上同样生效。

因此本 PR 只加覆盖用例,不为造红去改行为:此前这个形态没有任何 e2e 覆盖,test/e2e/management/management-failure-state.spec.mjs 的用例全部走 #/management 全页路由,浮动面板从没有被失败态覆盖过。

加了什么

新文件 test/e2e/management/management-floating-failure-state.spec.mjs,3 条:

  1. 短屏与桌面的失败态(390×640 / 390×568 / 320×568 / 1440×900):用手机底栏「助手」与宽屏 launcher 打开浮动面板(每档先收起再重开,避免量到上一档的尺寸),断言面板在视口内且底边不越过 #console-mobile-nav 的 top;原因只出现一次、.management-status 为空;三个恢复控件在卡片自己的滚动槽内可达且 elementFromPoint 命中自身;页面自身不滚动;管理消息 与 发送 都隐藏;两个 header 控件 disabled 且带 aria-describedby;390×844 与 1440 不需要内滚动。
  2. 浮动面板里的「新建会话」失败:快捷操作抽屉收起、输入区消失、两个控件 disabled —— fix(#616): state a failed management open once, above a composer that is not offered agent-CI-Infra/bot#1038 的第二条场景此前也只有全页版。
  3. 一致性度量:同一视口下浮动面板的内滚动需求 ≤ 全页。

红先说明(按实际写,不造红)

这一支在 base 23c1c591 上没有可红的断言:按「为造红去改行为」是被禁止的,所以改为实测记录。base 上同一套读数(现读 tip 构建,#/projects → 底栏助手 → 无已启动项目的 fixture):

视口 浮动面板 [left, top, right, bottom] 底栏 top 卡片槽 client / scroll 卡片高 三条控件(重试 / 查看项目列表 / 查看身份与权限)
390×640 [10, 190, 380, 566] 576 290 / 321 313 前两条 scrollTop=0 即矩形与中心点都在槽内;第三条槽内滚 10px 后同样成立
390×568 [10, 190, 380, 494] 504 218 / 321 313 逐条滚 10 / 22 / 103px(103 = 该槽的全部滚动需求)后三条矩形与中心点都在槽内
320×568 [10, 190, 310, 494] 504 178 / 344 336 逐条滚至 103 / 103 / 145px(槽上限 166)后三条矩形与中心点都在槽内
390×844 [10, 190, 380, 770] 780 397 / 397 313 无内滚动,三条首屏全命中
768×1024 [264, 260, 744, 1000] — 597 / 597 361 无内滚动
1440×900 [936, 136, 1416, 876] — 597 / 597 361 无内滚动

滚动只发生在卡片自己的槽里(.management-access-state),页面 scrollTop 全程为 0;可达判据是「矩形在槽内 ±1px」且「中心点 elementFromPoint 命中控件自身」,不用 toBeInViewport({ratio: 1})(390×640 会因 0.28px 的亚像素差报 0.9946)。

内滚动需求对比(浮动 / 全页):390×640 = 31 / 56,390×568 = 103 / 128,320×568 = 166 / 201 —— 浮动面板每一档都比全页更省,这就是「一致」的可度量含义,也是第 3 条断言。

绿

  • npx playwright test -c test/e2e/playwright.config.mjs test/e2e/management/management-floating-failure-state.spec.mjs --workers=1 → 3 passed (8.9s)
  • 与既有 management-failure-state.spec.mjs 同跑 → 5 passed (11.8s)
  • 新文件加 --repeat-each=2 → 6 passed (17.3s)
  • npm run check → Runtime JavaScript syntax checks passed (726 files)
  • npm run build → ✓ built in 1.30s

UI 证据(before / after)

before 用 main 23c1c591 构建,after 用本支构建,同一夹具、同一路由、fullPage: true,画面里没有 token / cookie / 审批链接。落盘尺寸按 PNG 头实测:floating-390-* = 390×876,floating-1440-* = 1440×900。

形态 before after
390 浮动面板失败态(fullPage 390×876) 390 before 390 after
1440 浮动面板失败态(fullPage 1440×900) 1440 before 1440 after

两对 before/after 的 sha256 完全相同(390 档 69d7f00072287c444029c2eeb0f6aab081067cc428bd04c8d0365b124d70ffd8,1440 档 6581dc27859bda2c39c85789ff183d7bb08f7c5720cfc49537f91333ab3feffb):本支只加测试,渲染没有变,这是实测结论而不是省事。

与 open PR 的文件自查

用连接器逐个读了当前 open PR 的改动文件(#1071 14 files、#1067 11、#1061 3、#1003 2、#957 4、#915 7、#888 3、#582 12、#581 15、#577 19、#490 3、#443 7):没有一个改动 test/e2e/management/ 或 static/management*,与本切片零重叠。#581 里的 e2e/management.spec.mjs 是目录迁移前的老路径(现树已无此文件),不算重叠。

没做的

  • 不碰 F5(生效范围换行):那条反转了已合入的行为且 triage 标了需要人决定。
  • 不改 consoleState、static/app/states.js、static/settings/page.js、#481/#496 导航。
  • 没有生产代码改动,因此没有 无 UI 面 的声明必要——UI 证据照旧给了。

zhaozhaozz and others added 30 commits November 17, 2026 06:26
…llipsize, at desktop widths

The 门禁 and 看板 columns of the settings project table are narrower than
their state sentences, and the table's own white-space:nowrap (a ≥1280
rule) let the shared ellipsis cut「发布检查未完成」to「发布检…」. The spec
drives #/settings/projects with one unconfigured gate and one collecting
board per row, then reads both chips at 1280 and 1440: every rendered
text line must lie inside the chip's own box on both axes (read from the
line rects, because a wrapped flex chip can keep a ~2px scrollable
extent while all its glyphs stay visible), the row keeps its 84px floor
while growing with the wrapped chip, and the page does not scroll
sideways. Below the 1280 breakpoint the card layout already fits every
chip, and the spec holds it to that too.
… ellipsizing

The settings project table scoped white-space:nowrap to its status
chips at ≥1280, but its 门禁 (66–96px) and 看板 (next to the row switch)
columns are narrower than the state sentences, so the shared ellipsis
rule cut「发布检查未完成」to「发布检…」— the table now wraps: the chip
folds to another line and the row grows with it. The base .status rule
keeps nowrap for everywhere else, so #/projects chips (laid out in
.project-features) and the below-1280 card layout are unchanged.
…er a one-character column

The agent-CI-Infra#1011 review measured the 看板 switch — a 96px pill sharing the
cell under the table's nowrap — parked on top of three of the folded
chip's five characters: every line rect stayed inside the chip's box
and this spec stayed green while the sentence was unreadable on
screen. Readability is now read the way an administrator does: the
topmost element at the centre and the quarter points of every rendered
line must be the chip or one of its descendants (elementFromPoint over
the already-computed line rects), and the 看板 chip must not fold into
a one-character-per-line column (lines <= 2 for 看板采集中).
…instead of on the chip

The 看板 cell of the settings project table also carries the row's board
switch (static/views/project-list.js:64), and the table's ≥1280
nowrap kept both on one line in a column narrower than either: the chip
folded into a one-character-per-line column while the 96px switch, unable
to shrink below its own content, parked on top of it and covered three
characters — agent-CI-Infra#1011's review measured elementFromPoint hitting the
switch for 板/采/集 at both 1280 and 1440. This one cell now wraps
instead: the chip takes the whole column on its first line and the
switch sits below it, so neither paints over the other. The rule stays
inside the @media(min-width:1280px) block that owns the nowrap it
overrides, so the below-1280 labelled card layout is untouched and the
门禁 chip keeps the table's nowrap.
…ot counted twice, and assistant-homes gets its own row
…o other row counts, and assistant-homes leaves "other"
… not already counted in known

The copy claimed every labelled volume's bytes were already inside known. Only bot-data, manager-data and the in-use
*-work volumes are; agent-tools, the *-keys, *-notes and the *-work volumes left behind by deleted projects or older
generations are excluded from the Docker row and have no known row of their own, so their bytes stay in other. Wording
only; behaviour is unchanged. Also drops assistant_homes from the spec's unmeasured patch, since it is a measured row.
zhaozhaozz and others added 30 commits November 18, 2026 05:48
…under docker/

Move all four image Dockerfiles (control-plane, manager, project-computer, tunnel), the container Chromium wrapper script, and compose.yaml / compose.build.yaml into docker/, removing the single-file top-level images/ directory while keeping .dockerignore at the repository root.

Use context: ${BOT_BUILD_CONTEXT:-..} in docker/compose.build.yaml so both direct docker compose -f docker/compose.yaml -f docker/compose.build.yaml runs and --project-directory . local deployments resolve the repository root cleanly. Update workflows, acceptance stack, Docker/unit/e2e tests, public-board About link, and deployment/development docs accordingly.

Refs agent-CI-Infra#1051
…s from GitHub's facts

The control plane gathers who is assigned, other people's open pull requests
that GitHub links to the Issue (cross-references and closing references) and the
latest comments as written. The Issue review reads them in its context and states
in its recommendation whether someone else has claimed the Issue; a published
review hands them to the Manager, whose built-in rule now asks that nobody else
has claimed the Issue instead of that nobody is assigned. Nothing matches the
text of a comment.
…ings at h2

The board hides the shared toolbar heading in board mode, so it carries its own
sr-only h1. Settings cards and the identity overview can render their title as
h2; the element name never sets the size, the card tokens style both levels.
The console-wide h2 rule would restyle a card title, so the h2 rules restate
the h3 values; the rate-limit card's nested account name becomes h3 but keeps
the h4 size and margin it rendered with.
…page, not four routes

The blocking review was right: the spec walked the four audited list routes, so CI stayed green while
#/settings/work-computers (the settings entry) and the three detail pages kept the h1 -> h3 jump.

The categories now come from the settings registry the shell itself uses (settingsSections in
static/settings/nav.js), and the detail pages come from the detail links the list cards render, so a
section or detail page added later is covered without editing this file. Every route is judged by two
rules: exactly one visible h1 first, and no level skipped between consecutive visible headings.
… h1, sub-sections are h3

card() keeps its h3 default for every page outside settings; a new settingsCard() wrapper (default h2)
is used only by the settings modules, and liveCard()/settingsList() default to h2 because nothing
outside static/settings/ calls them. Detail cards and the models project catalog promote their nested
h4s to h3, and .card-sub restates the h4 size, weight and spacing, so the outline changes and the
pixels do not. The visual rollout follows the .rate-account precedent.

Also the two non-blocking notes: test/concurrency.test.mjs reads card titles in document order instead
of all h2 then all h3, and test/console-tokens.test.mjs pins the new class/token rules.
…ettings card by its old h3

CI on 3c8b5f3 was red on exactly these: storage-retention-labels loads static/settings/page.js
without static/settings/nav.js, so settingsCard() was undefined; project-list clicks the 项目管理
card heading to dismiss a menu; public-access lists the card titles. All three now read the h2 card
title (or load the module that defines settingsCard).
…ttings outline, cover #/identity/feishu

serviceRoleCard inherited the new settings liveCard default (h2), so the same card on #/identity/feishu became h3 -> h2 -> h4.
The caller now names the level: settings passes h2, the Feishu page keeps h3, and the delete/save replacements follow it.

e2e/heading-structure no longer waits a fixed 150 ms for the settings cards, it polls until the panel heading signature is
non-empty and stable, so a slow page cannot be judged on the page title alone. e2e/channel-assistant-roles asserts the two
regressions on #/identity/feishu (no h2 on the page, role card at its container level, 新建项目角色 one level below).

Fixes agent-CI-Infra#1039
…, fail an unsettled outline

serviceRoleCreate inserted the new card with the serviceRoleCard default h3 while every other card on the settings page is h2,
so a created card read as a child of the card above it until a reload. The form now takes the same level as the card and
settings passes 'h2'; the Feishu page keeps the h3 default.

settledHeadings no longer returns its last sample when it runs out of attempts: exhaustion is a failed assertion, so a page
whose headings never settle cannot pass the outline green.

Refs agent-CI-Infra#1039
…eveloping label and one status comment

While the bot develops an Issue the control plane keeps the project's developing
label (new setting developing_label, default bot-developing, created in the
repository when missing) on it and removes it once the pull request exists or
the development stops without one. One status comment is created when the
development starts and only edited afterwards: why it started, the plan the
development agent reports with report_development_milestone (analysis,
decisions and reasons, main changes, acceptance), and how it ended (the pull
request with its key changes and tests, or why it stopped and what a person can
do). It replaces the separate "Implemented in" comment on the Issue.

Writes are kept in issue_development_progress; a failed write is retried by
the engine's sweep with growing waits, which also settles developments that end
outside a run. Onboarding plans at the develop level create the label.
…der test/

Move bot-acceptance/* to test/acceptance/*, real Docker system tests to
test/docker/<module>/, opt-in live/probe scripts to test/live/<module>/,
and test-runner orchestration files to test/framework/*.

Upgrade test/framework/test-plan.mjs to discover test/ut/**/*.test.mjs
and test/st/**/*.test.mjs recursively alongside flat test/*.test.mjs
files while rejecting duplicate implicit test-set names across tiers.
Upgrade scripts/check-runtime.mjs to syntax-check all JavaScript/ESM
files recursively across runtime, static, scripts, public-board, test,
and e2e directories in parallel.

Refs agent-CI-Infra#1051
Complete the final phase of agent-CI-Infra#1051 by organizing all remaining test assets
under test/<category>/<module>/:

- Split unit tests (test/ut/) and in-process service/integration tests
  (test/st/) into subdirectories mirroring the source tree (src/<module>/,
  manager/, runner/, static/, public-board/, docker/, workflows/, scripts/,
  framework/, acceptance/), and reject stray test/*.test.mjs files at the
  test/ root in test/framework/test-plan.mjs.
- Consolidate Playwright configuration (test/e2e/playwright.config.mjs),
  browser runtime checks (test/e2e/browser/browser-runtime.mjs), shared
  browser helpers (test/e2e/helpers/), and all 196 browser specs under
  test/e2e/<module>/, removing the top-level e2e/ directory.
- Move shared test helpers and fixtures into test/fixtures/ and move
  roadmap.live.test.mjs into test/live/tasks/.
- Document the 8-tier test/ layout in docs/development.md and update file
  paths and Playwright config arguments across package.json,
  scripts/check-runtime.mjs, static/shell.css, and docs/**/*.md.

Fixes agent-CI-Infra#1051
…dispatch system message

A Manager on Pi (or any non-native backend) dispatched events with only its
role prompt: runDispatchHarness got rolePrompt(role), so the dispatch prompt
(the rule a project_rule basis must quote), the work the event can create and
the write and merge rules never reached the model. Label-free development on
the built-in rule was refused every time, and the merge rule was missing while
the role could merge. The harness now gets the same system message as the
native loop.
… assistant panel

agent-CI-Infra#1038 fixed the page view of a failed management open and left the floating panel out of scope; acceptance 3 asks both
forms to behave the same. The card, the single statement of the reason, the two recovery links and the disabled header
controls all come from the shared conversation surface, so this adds the coverage that pins it for the panel shape: the
box on screen above the phone bar, every recovery control reachable inside the card's own scroll slot (never the page's),
nothing able to send, and the panel never needing more scroll room than the page view at the same viewport.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants