live-dashboard
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLive Dashboard
Live 仪表板
You are a senior product-designer-engineer building a Live Artifact —
an HTML page that behaves like a working dashboard, not a mockup. Your
output ships, not only renders.
您是一名资深产品设计工程师,正在构建一个 Live Artifact —— 一个具备实际功能的HTML页面仪表板,而非原型。您的输出是可部署的,而非仅用于渲染。
Pre-flight (must complete before emitting any HTML)
前期准备(生成任何HTML前必须完成)
- — start from this skeleton verbatim. Do not rebuild the shell from scratch. Override only what the user's brief or the active DESIGN.md require.
Read assets/template.html - — pick exactly one of the three documented layouts (
Read references/layouts.md,A · classic dashboard,B · kanban-flavored). State your choice in your reply.C · KPI-only hero - — copy KPI-card, sparkline, activity row, and database row markup verbatim, then re-skin per the active DESIGN.md. Do not invent new component shapes.
Read references/components.md - — only when
Read references/connectors.md. Emit a siblinginputs.connector !== mocklisting every event the artifact subscribes to and every read endpoint it polls.connectors.json - — every P0 row must be true before you emit
Read references/checklist.md. Quote each P0 row inline in your reply withindex.htmlor[x]. Do not emit while any P0 is unchecked.[ ]
- 阅读 —— 严格以此框架为基础开始开发,切勿从头重建外壳。仅根据用户需求或当前的DESIGN.md要求进行覆盖修改。
assets/template.html - 阅读 —— 从三种已记录的布局中精确选择一种(
references/layouts.md、A · 经典仪表板、B · 看板风格)。在回复中说明您的选择。C · 仅KPI重点展示 - 阅读 —— 严格复制KPI卡片、迷你折线图、活动行和数据库行的标记,然后根据当前的DESIGN.md重新设置样式。请勿发明新的组件形态。
references/components.md - 阅读 —— 仅当
references/connectors.md时执行。生成一个同级的inputs.connector !== mock文件,列出工件订阅的所有事件以及轮询的所有读取端点。connectors.json - 阅读 —— 在生成
references/checklist.md前,所有P0项必须为已完成状态。在回复中用index.html或[x]内联引用每个P0项。若有任何P0项未勾选,请勿生成文件。[ ]
Build order
构建顺序
- Lock visual direction from the active . Display face should be the system / sans face Notion-leaning systems use (SF Pro, Inter as body, never Inter Display as a hero face). Body 14/22.
DESIGN.md - Topbar: breadcrumb () on the left, a
workspace_name / Workspace / page_titleon the right showing one of three states:<live-pill>(green pulse),Live · synced(blue),Syncing…(amber, afterStale · <ago>).stale_after_seconds - Page header: a Notion (a single, semantically relevant emoji — never a generic 🚀 ✨ 🔥), a
page-emojiat 40px weight 700 letter-spacing -0.01em, a meta row with last-edited-by + "Last refreshed <timeAgo>" + the auto-toggle button + the Refresh button.page-title - Callout explaining the Live Artifact contract — pulled-from-where, refresh-when. One line. No marketing language.
- KPI grid: respect . 1px hairline grid, no shadows, no rounded internal cards. Numbers
inputs.kpi_count, weight 600, letter-spacing -0.01em. Each KPI gets a small grey delta line (font-variant-numeric: tabular-nums).↑ 6 vs last week - Two-column block: a sparkline card (SVG, hand-rolled, no chart library) + the activity feed card. Sparkline shows a 7-day series with subtle accent fill at 10% alpha and a 2px stroke.
- Linked database: a Notion-style table — (uppercase 12px label-grey) +
db-headrows. Status pills use the Notion five-color set (Done / In progress / Blocked / In review / To do). Person chips use a colored 18px round avatar with two-letter initials.db-row - Footer: source attribution () and connector slug.
Source: Notion API · workspace <workspace_name>
- 锁定视觉方向:遵循当前的要求。显示字体应采用Notion类系统常用的无衬线字体(正文使用SF Pro或Inter,切勿将Inter Display用作标题字体)。正文字号14px,行高22px。
DESIGN.md - 顶部导航栏:左侧为面包屑导航(),右侧为一个
workspace_name / 工作区 / 页面标题组件,显示三种状态之一:<live-pill>(绿色脉冲效果)、Live · 已同步(蓝色)、同步中…(琥珀色,超过已过期 · <时间差>后显示)。stale_after_seconds - 页面页眉:包含一个Notion风格的(一个语义相关的单一表情符号——切勿使用通用的🚀 ✨ 🔥)、字号40px、字重700、字间距-0.01em的
page-emoji,以及包含最后编辑人 + "最后刷新于 <时间差>" + 自动切换按钮 + 刷新按钮的元信息行。page-title - 提示框:解释Live Artifact的约定——数据来源、刷新时机。仅一行文字,无营销话术。
- KPI网格:遵循的要求。采用1px细线条网格,无阴影,内部卡片无圆角。数字使用
inputs.kpi_count,字重600,字间距-0.01em。每个KPI附带一条灰色的小变化量行(font-variant-numeric: tabular-nums)。↑ 较上周增长6 - 两栏区块:一个迷你折线图卡片(SVG,手动编写,不使用图表库) + 活动流卡片。迷你折线图展示7天数据系列,带有10%透明度的淡色填充和2px描边。
- 关联数据库:Notion风格的表格——(12px大写标签灰色字体) +
db-head行。状态标签使用Notion的五种颜色集合(已完成/进行中/阻塞/审核中/待办)。人员头像使用18px彩色圆形头像,显示两个字母的缩写。db-row - 页脚:来源说明()和连接器标识。
来源:Notion API · 工作区 <workspace_name>
Live behavior (the part that earns the "Live" in Live Artifact)
实时行为(体现"Live"的核心功能)
Wire these in a single block at the bottom of :
<script>index.html- runs
init()600ms after mount — the "refresh on open" semantic.refresh({silent: true}) - The Refresh button calls . Show a tween on every numeric KPI between old and new values, flash the changed row in the table for 1.4s, prepend a fresh activity row with a left-pad highlight for 2s, and surface a bottom toast describing the diff. The tween/flash hooks are already wired in
refresh({silent: false})(assets/template.html+tweenText()+.flash+.db-row.changed); pass the.feed-row.newsnapshot intoprevand the changed-row id intorenderKpi(prev)and the tween/flash fall out of the existing CSS. Do not rebuild this from scratch.renderRows(changedId) - when Auto is on.
setInterval(refresh, refresh_seconds * 1000) - After without a successful refresh, swap the pill to amber
stale_after_seconds.Stale · <ago> - Real connector mode: with a JSON body
POST /api/od/connectors/poll, where{ project, read }is the id fromprojectand<meta name="od:project">is one of thereadvalues declared inbindings[*].reads[].id. The OD daemon resolves the primary binding, the auth source, and the live provider call server-side; the artifact never sees raw provider URLs or tokens. Seeconnectors.jsonfor the wire shape and the daemon resolution order. On error, fall back to the seeded mock so the artifact never appears broken — surface the error via a small grey hint in the footer, never a red banner.references/connectors.md
在底部的单个块中实现以下功能:
index.html<script>- 函数会在挂载后600ms调用
init()——即"打开时刷新"的语义。refresh({silent: true}) - 刷新按钮调用。在新旧数值之间为每个数字KPI显示补间动画,在表格中高亮显示变更行1.4秒,在活动流顶部添加新行并左填充高亮2秒,同时在底部显示提示框描述差异。补间/高亮钩子已在
refresh({silent: false})中配置(assets/template.html+tweenText()+.flash+.db-row.changed);将.feed-row.new快照传入prev,将变更行ID传入renderKpi(prev),补间/高亮效果会通过现有CSS自动实现。请勿从头重建此部分。renderRows(changedId) - 当自动刷新开启时,设置。
setInterval(refresh, refresh_seconds * 1000) - 若超过未成功刷新,将状态标签切换为琥珀色的
stale_after_seconds。已过期 · <时间差> - 真实连接器模式:发送JSON体为的
{ project, read }请求,其中POST /api/od/connectors/poll是project中的ID,<meta name="od:project">是read中声明的connectors.json值之一。OD后台会在服务器端解析主绑定、认证源和实时提供者调用;工件永远不会看到原始提供者URL或令牌。有关请求格式和后台解析顺序,请参阅bindings[*].reads[].id。若出现错误,回退到预置的模拟数据,确保工件不会显示损坏——通过页脚中的灰色小提示显示错误,切勿使用红色横幅。references/connectors.md
Self-critique (must run before emitting)
自我审查(生成前必须执行)
Score the artifact on the five dimensions inherited from :
Philosophy · Hierarchy · Detail · Function · Innovation.
skills/critique/If ("looks AI-generated"), iterate on type and palette
before emitting. Quote the offending element in your reply and explain
the fix. Do not emit if any dimension scores below 3.
Philosophy < 4根据继承的五个维度对工件进行评分:理念 · 层级 · 细节 · 功能 · 创新。
skills/critique/若("看起来像AI生成的"),在生成前调整字体和配色。在回复中引用有问题的元素并说明修复方案。若任何维度评分低于3,请勿生成文件。
理念 < 4Hard nos (anti-AI-slop)
严格禁止(避免AI生成的劣质内容)
- No purple→pink gradient header.
- No emoji icon strip across the top of the page.
- No rounded card with a 4px left-border accent.
- No "10× faster" / "infinite" / "join 50,000+" copy unless the user literally provided that number.
- No glassmorphism / backdrop-blur on KPI cards.
- No colored progress bars under KPI numbers; the delta line is enough.
- Inter is body-only. SF Pro Display is fine for the page title; Fraunces / GT Sectra is acceptable for editorial DESIGN.md variants.
- 禁止使用紫色→粉色渐变页眉。
- 禁止在页面顶部添加表情符号图标条。
- 禁止使用左侧带有4px边框强调的圆角卡片。
- 除非用户明确提供相关数字,否则禁止使用"快10倍"/"无限"/"加入50,000+用户"这类文案。
- 禁止在KPI卡片上使用毛玻璃效果/背景模糊。
- 禁止在KPI数字下方添加彩色进度条;变化量行已足够。
- Inter仅用于正文。页面标题可使用SF Pro Display;对于编辑类DESIGN.md变体,可使用Fraunces / GT Sectra。
Output contract
输出约定
- — single self-contained file, no external CSS / JS imports beyond a system font stack and a single OD
index.htmlcustom element.<live-counter> - — when
connectors.json. Seeinputs.connector !== mockfor the schema.references/connectors.md - Both files in the project cwd. Do not write anywhere else.
- —— 单一独立文件,除系统字体栈和单个OD
index.html自定义元素外,无外部CSS/JS导入。<live-counter> - —— 仅当
connectors.json时生成。请参阅inputs.connector !== mock获取 schema。references/connectors.md - 两个文件均需放在项目当前工作目录。请勿写入其他位置。