Skip to content

Commit d794beb

Browse files
hottaigerzhangshuo12
andauthored
fix: 优化看板产物预览体验 (#312)
* fix(dashboard): improve artifact preview * docs(comet): archive dashboard preview ux * docs(comet): record dashboard build verification * fix(lint): ignore ZCode generated files --------- Co-authored-by: zhangshuo12 <zhangshuo12@guazi.com>
1 parent 9410e28 commit d794beb

10 files changed

Lines changed: 525 additions & 7 deletions

File tree

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Outcome
2+
3+
Dashboard 产物预览在抽屉和全屏模式下保持清晰、可读和可操作。
4+
5+
# Scope
6+
7+
- 修复 Markdown、YAML、JSON 预览表格表头在窄列中逐字折行的问题,不改变表格正文的换行策略。
8+
- 调整全屏预览目录的尺寸与字号。
9+
- 为全屏预览提供 Esc 关闭整个预览的键盘交互。
10+
- 对齐文件路径复制按钮与路径文本的垂直视觉中心。
11+
12+
# Non-goals
13+
14+
- 不改变预览内容的解析、目录条目生成或文件复制语义。
15+
- 不改变普通抽屉预览的 Esc 行为。
16+
17+
# Acceptance examples
18+
19+
- A1:预览中的表头始终单行显示;仅当表头无法在可用宽度内显示时,预览可横向滚动查看完整表头;正文保持原有换行规则。
20+
- A2:全屏预览目录栏宽度为 250px;“目录”标题为 14px,目录链接为 16px。
21+
- A3:全屏预览打开时按 Esc 关闭整个产物预览;非全屏抽屉不会注册该快捷键。
22+
- A4:预览头部复制路径按钮与相邻路径文本在同一垂直中心线上;路径文本不保留段落默认上下外边距。
23+
24+
# Constraints and invariants
25+
26+
- 保持现有全屏目录仅在全屏状态显示的规则。
27+
- 继续使用当前共享 Markdown 预览渲染管线。
28+
29+
# Decisions
30+
31+
- 仅表格表头不折行;不强制表格按正文内容扩张宽度,正文保持原有换行规则。
32+
- 全屏目录使用 250px 宽度、14px 标题和 16px 链接。
33+
- Esc 仅在全屏预览期间生效,并关闭整个预览弹窗。
34+
- 路径文本显式清除段落外边距,避免样式基线变化导致与复制按钮错位。
35+
36+
# Open questions
37+
38+
- [blocking] CONFIRM: 确认以上目标、范围、关键决定、验收项和非目标。
39+
40+
# Verification expectations
41+
42+
- 更新 Dashboard Web 源码契约测试;执行相关 Vitest 测试与构建检查。
Lines changed: 297 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,297 @@
1+
schema: comet.native.v4
2+
name: dashboard-preview-ux
3+
language: zh-CN
4+
phase: archive
5+
status: done
6+
state_version: 25
7+
brief: brief.md
8+
spec_changes:
9+
- capability: dashboard-artifact-preview
10+
operation: create
11+
source: specs/dashboard-artifact-preview/spec.md
12+
workspace:
13+
isolation: branch
14+
change_branch: comet/dashboard-preview-ux
15+
target_branch: master
16+
finish: keep
17+
loop:
18+
stage: done
19+
goal_cycle: 2
20+
iteration: 4
21+
attempt: 1
22+
retry_epoch: 0
23+
failed_iteration_count: 0
24+
no_progress_count: 0
25+
execution_failure_count: 0
26+
previous_unresolved_ids: []
27+
next_action: null
28+
acceptance:
29+
- id: A1
30+
source: brief.md
31+
text: A1:预览中的表头始终单行显示;仅当表头无法在可用宽度内显示时,预览可横向滚动查看完整表头;正文保持原有换行规则。
32+
result: passed
33+
reason:
34+
text: 表头不折行。
35+
truncated: false
36+
- id: A2
37+
source: brief.md
38+
text: A2:全屏预览目录栏宽度为 250px;“目录”标题为 14px,目录链接为 16px。
39+
result: passed
40+
reason:
41+
text: 窄宽度可横向查看完整表头。
42+
truncated: false
43+
- id: A3
44+
source: brief.md
45+
text: A3:全屏预览打开时按 Esc 关闭整个产物预览;非全屏抽屉不会注册该快捷键。
46+
result: passed
47+
reason:
48+
text: 仅表头新增不换行,正文行为保持不变。
49+
truncated: false
50+
- id: A4
51+
source: brief.md
52+
text: A4:预览头部复制路径按钮与相邻路径文本在同一垂直中心线上;路径文本不保留段落默认上下外边距。
53+
result: passed
54+
reason:
55+
text: 目录栏为 250px。
56+
truncated: false
57+
- id: A5
58+
source: specs/dashboard-artifact-preview/spec.md
59+
text: Dashboard displays artifact content in a side drawer and supports an
60+
expanded fullscreen reading mode.
61+
result: passed
62+
reason:
63+
text: 目录标题为 14px。
64+
truncated: false
65+
- id: A6
66+
source: specs/dashboard-artifact-preview/spec.md
67+
text: Rendered Markdown, YAML, and JSON preview tables keep header labels on one
68+
line. When a header needs more horizontal space than its container, the
69+
preview provides horizontal scrolling instead of wrapping the header
70+
label. This does not change the existing wrapping behavior of table body
71+
cells or force a table to expand to the width of its body content.
72+
result: passed
73+
reason:
74+
text: 各层目录链接为 16px。
75+
truncated: false
76+
- id: A7
77+
source: specs/dashboard-artifact-preview/spec.md
78+
text: The table of contents is visible only while an artifact preview is
79+
fullscreen and has headings. Its sidebar is 250px wide. The directory
80+
label uses a 14px font size and each directory link uses a 16px font size.
81+
result: passed
82+
reason:
83+
text: 全屏时 Escape 关闭整个预览。
84+
truncated: false
85+
- id: A8
86+
source: specs/dashboard-artifact-preview/spec.md
87+
text: While fullscreen artifact preview is active, pressing Escape closes the
88+
artifact preview. The side-drawer preview does not install this Escape
89+
shortcut.
90+
result: passed
91+
reason:
92+
text: 非全屏不注册 Escape,目录仅全屏显示。
93+
truncated: false
94+
- id: A9
95+
source: specs/dashboard-artifact-preview/spec.md
96+
text: When a preview path is available, its copy button and path text share a
97+
vertically centered layout in the preview header. The path text has no
98+
paragraph margins that could displace it from the copy button.
99+
result: passed
100+
reason:
101+
text: 路径行垂直居中,专用样式覆盖 AntD 段落外边距。
102+
truncated: false
103+
builder_handoff:
104+
candidate_id: e5f35db6-59f0-44d4-8014-47492a4932ce
105+
identity_provider: skill-coordinated
106+
builder_execution_ref: skill-coordinated:builder:bf21628d-6ee3-450e-98a4-4e1dc4d91dab
107+
iteration: 4
108+
summary:
109+
text: 按用户要求移除 0.4.0-beta.19 版本与 Changelog;保留已完成人工视觉验收的看板预览修复。
110+
truncated: false
111+
addressed_acceptance_ids:
112+
- A1
113+
- A2
114+
- A3
115+
- A4
116+
- A5
117+
- A6
118+
- A7
119+
- A8
120+
- A9
121+
checks:
122+
- name:
123+
text: pnpm build
124+
truncated: false
125+
result: passed
126+
note:
127+
text: Passed with Node 22.22.3 via Corepack pnpm 10.18.3 after archive.
128+
truncated: false
129+
- name:
130+
text: npx vitest run test/domains/dashboard/web-source.test.ts
131+
truncated: false
132+
result: passed
133+
note:
134+
text: 16 tests passed
135+
truncated: false
136+
- name:
137+
text: npx prettier --check domains/dashboard/web/src/main.jsx
138+
domains/dashboard/web/src/styles.css
139+
test/domains/dashboard/web-source.test.ts
140+
truncated: false
141+
result: passed
142+
note:
143+
text: All changed source files are formatted
144+
truncated: false
145+
- name:
146+
text: git diff --check
147+
truncated: false
148+
result: passed
149+
note:
150+
text: No whitespace errors
151+
truncated: false
152+
checks_truncated: false
153+
known_limits: []
154+
known_limits_truncated: false
155+
submitted_at: 2026-08-13T13:14:31.103Z
156+
blockers: []
157+
verification:
158+
candidate_id: e5f35db6-59f0-44d4-8014-47492a4932ce
159+
identity_provider: skill-coordinated
160+
verifier_execution_ref: skill-coordinated:verifier:513b026a-29e8-4b8e-8b3c-c813a94d3d4e
161+
iteration: 4
162+
attempt: 1
163+
assurance: skill-coordinated
164+
verdict: pass
165+
checks:
166+
- id: dashboard-web-source
167+
name:
168+
text: npx vitest run test/domains/dashboard/web-source.test.ts
169+
truncated: false
170+
argv_display:
171+
- text: vitest
172+
truncated: false
173+
- text: run
174+
truncated: false
175+
- text: test/domains/dashboard/web-source.test.ts
176+
truncated: false
177+
argv_truncated: false
178+
cwd_ref: .
179+
status: passed
180+
exit_code: 0
181+
duration_ms: 27418
182+
- id: supported-toolchain-build
183+
name:
184+
text: pnpm build
185+
truncated: false
186+
argv_display:
187+
- text: pnpm
188+
truncated: false
189+
- text: build
190+
truncated: false
191+
argv_truncated: false
192+
cwd_ref: .
193+
status: passed
194+
exit_code: 0
195+
duration_ms: 11595
196+
summary:
197+
text: A1-A9 均通过;Node 22.22.3 与 Corepack pnpm 10.18.3 已完成 pnpm build;未新增 beta.19 版本或 Changelog。
198+
truncated: false
199+
risks: []
200+
risks_truncated: false
201+
completed_at: 2026-08-13T13:27:49.000Z
202+
history:
203+
- goal_cycle: 1
204+
iteration: 1
205+
attempt: 1
206+
outcome: pass
207+
unresolved_ids: []
208+
summary:
209+
text: 独立 Verifier 确认 A1-A9 全部通过;Runtime 已执行 Dashboard Web 源码契约测试。
210+
truncated: false
211+
completed_at: 2026-08-13T12:18:52.477Z
212+
- goal_cycle: 1
213+
iteration: 1
214+
attempt: 1
215+
outcome: recovery
216+
unresolved_ids: []
217+
summary:
218+
text: 需求收窄为仅禁止表格表头换行,不改变表格正文或整体表格宽度策略。
219+
truncated: false
220+
completed_at: 2026-08-13T12:23:37.486Z
221+
- goal_cycle: 1
222+
iteration: 2
223+
attempt: 0
224+
outcome: recovery
225+
unresolved_ids: []
226+
summary:
227+
text: Native confirmed acceptance criteria changed
228+
truncated: false
229+
completed_at: 2026-08-13T12:24:59.818Z
230+
- goal_cycle: 2
231+
iteration: 1
232+
attempt: 1
233+
outcome: pass
234+
unresolved_ids: []
235+
summary:
236+
text: 独立 Verifier 确认 A1-A9 全部通过。
237+
truncated: false
238+
completed_at: 2026-08-13T12:33:25.334Z
239+
- goal_cycle: 2
240+
iteration: 1
241+
attempt: 1
242+
outcome: recovery
243+
unresolved_ids: []
244+
summary:
245+
text: 实际样式中未分层 p 规则覆盖 Tailwind m-0;改用项目样式高优先级选择器显式清除路径段落外边距。
246+
truncated: false
247+
completed_at: 2026-08-13T12:44:12.470Z
248+
- goal_cycle: 2
249+
iteration: 2
250+
attempt: 1
251+
outcome: pass
252+
unresolved_ids: []
253+
summary:
254+
text: A1-A9 均符合当前 brief 与 spec。
255+
truncated: false
256+
completed_at: 2026-08-13T12:49:04.976Z
257+
- goal_cycle: 2
258+
iteration: 2
259+
attempt: 1
260+
outcome: recovery
261+
unresolved_ids: []
262+
summary:
263+
text: 补充已发布看板缺陷修复的版本与 Changelog 元数据。
264+
truncated: false
265+
completed_at: 2026-08-13T13:13:08.246Z
266+
- goal_cycle: 2
267+
iteration: 3
268+
attempt: 0
269+
outcome: recovery
270+
unresolved_ids: []
271+
summary:
272+
text: 按用户要求不新增 0.4.0-beta.19 版本或 Changelog。
273+
truncated: false
274+
completed_at: 2026-08-13T13:13:53.623Z
275+
- goal_cycle: 2
276+
iteration: 4
277+
attempt: 1
278+
outcome: pass
279+
unresolved_ids: []
280+
summary:
281+
text: A1-A9 均通过;未新增 beta.19 版本或 Changelog。
282+
truncated: false
283+
completed_at: 2026-08-13T13:16:12.432Z
284+
history_overflow:
285+
dropped_entries: 0
286+
first_dropped_at: null
287+
last_dropped_at: null
288+
outcome_counts:
289+
pass: 0
290+
fail: 0
291+
blocked: 0
292+
execution-error: 0
293+
recovery: 0
294+
verification_result: pass
295+
verification_report: verification.md
296+
archived: true
297+
created_at: 2026-08-13T12:05:30.984Z
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Dashboard artifact preview
2+
3+
## Purpose
4+
5+
Dashboard displays artifact content in a side drawer and supports an expanded fullscreen reading mode.
6+
7+
## Preview tables
8+
9+
Rendered Markdown, YAML, and JSON preview tables keep header labels on one line. When a header needs more horizontal space than its container, the preview provides horizontal scrolling instead of wrapping the header label. This does not change the existing wrapping behavior of table body cells or force a table to expand to the width of its body content.
10+
11+
## Fullscreen table of contents
12+
13+
The table of contents is visible only while an artifact preview is fullscreen and has headings. Its sidebar is 250px wide. The directory label uses a 14px font size and each directory link uses a 16px font size.
14+
15+
## Keyboard closing
16+
17+
While fullscreen artifact preview is active, pressing Escape closes the artifact preview. The side-drawer preview does not install this Escape shortcut.
18+
19+
## Header alignment
20+
21+
When a preview path is available, its copy button and path text share a vertically centered layout in the preview header. The path text has no paragraph margins that could displace it from the copy button.

0 commit comments

Comments
 (0)