diff --git a/skills/data-page/SKILL.md b/skills/data-page/SKILL.md index b61d259..1194fbb 100644 --- a/skills/data-page/SKILL.md +++ b/skills/data-page/SKILL.md @@ -83,8 +83,8 @@ const taskId = location.pathname.split('/').filter(Boolean)[1]; 3. **初始化**:调用 `skill(name="data-page", op="run")`。 4. **为每个要生成的页面写 config 文件**(见下一节)。**不要读也不要改模板本身**。 5. **选定入口页 `.app/index.html`**(index 是副本,允许编辑;模板本体不动): - - **用到 ≥2 个模板页** → `cp .app/nav.html .app/index.html`,改标题为业务名,并把未启用页面的卡片删掉(没配过的页点开会报 no such table)。子页顶部的「← 首页」链回此导航页。 - - **只用 1 个模板** → `cp .app/<模板>.html .app/index.html`(同目录复制,引用路径不变)。副本指向自身时「← 首页」会被页面脚本自动隐藏,无需处理。 + - **用到 ≥2 个模板页** → `cp .app/nav.html .app/index.html`,改标题为业务名,并把未启用页面的卡片删掉(没配过的页点开会报 no such table)。子页标题左侧的「‹」返回键链回此导航页。 + - **只用 1 个模板** → `cp .app/<模板>.html .app/index.html`(同目录复制,引用路径不变)。副本指向自身时「‹」返回键会被页面脚本自动移除,无需处理。 6. **告知用户**:把 run 输出末尾「访问地址」那行的完整 URL 发给用户,再简要说明页面功能。 默认只写 config 就够。模板无法覆盖需求时,才走自定义路径(见「自定义页面」一节)。 diff --git a/skills/data-page/templates/base.css b/skills/data-page/templates/base.css index 6399444..3dd0e48 100644 --- a/skills/data-page/templates/base.css +++ b/skills/data-page/templates/base.css @@ -19,9 +19,13 @@ body { padding: 16px; padding-bottom: calc(72px + env(safe-area-inset-bottom)); } .container { max-width: 1200px; margin: 0 auto; } -/* 子页→首页面包屑(单页场景脚本会自动移除,见各模板尾部守卫) */ -.crumb { display: inline-block; color: var(--text-2); text-decoration: none; font-size: 13px; margin: 0 0 8px; } -.crumb:hover { color: var(--accent); } +/* 子页→首页返回键:贴在标题同一行,不占额外行高(单页场景脚本自动移除,见各模板尾部守卫) */ +.crumb { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; + width: 28px; height: 28px; margin-left: -6px; border-radius: 50%; + color: var(--text-2); text-decoration: none; font-size: 20px; line-height: 1; } +.crumb:hover { color: var(--accent); background: rgba(0,113,227,0.08); } +.page-hd { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; } +.page-hd h1 { margin: 0; } h1 { font-size: 20px; margin: 4px 0 20px; letter-spacing: -0.02em; } /* ── 卡片 ─────────────────────────────────────────────── */ diff --git a/skills/data-page/templates/dashboard.html b/skills/data-page/templates/dashboard.html index bf35b74..a291062 100644 --- a/skills/data-page/templates/dashboard.html +++ b/skills/data-page/templates/dashboard.html @@ -11,8 +11,10 @@
- ← 首页 -

数据看板

+
+ ‹ +

数据看板

+

分布

@@ -105,7 +107,7 @@ function backToApp() { location.href = id ? '/?s=' + encodeURIComponent(id) : '/'; } -// 单页场景:本页的副本就是 index.html,「← 首页」指向自身 → 移除(多页导航不受影响) +// 单页场景:本页的副本就是 index.html,标题行返回键指向自身 → 移除(多页导航不受影响) if (/\/(index\.html)?$/.test(location.pathname)) { const c = document.querySelector('.crumb'); if (c) c.remove(); } init(); diff --git a/skills/data-page/templates/kanban.html b/skills/data-page/templates/kanban.html index d151b26..dd3b32f 100644 --- a/skills/data-page/templates/kanban.html +++ b/skills/data-page/templates/kanban.html @@ -11,8 +11,10 @@
-← 首页 +
+‹

看板

+
加载中…
@@ -118,7 +120,7 @@ function backToApp() { location.href = id ? '/?s=' + encodeURIComponent(id) : '/'; } -// 单页场景:本页的副本就是 index.html,「← 首页」指向自身 → 移除(多页导航不受影响) +// 单页场景:本页的副本就是 index.html,标题行返回键指向自身 → 移除(多页导航不受影响) if (/\/(index\.html)?$/.test(location.pathname)) { const c = document.querySelector('.crumb'); if (c) c.remove(); } load(); diff --git a/skills/data-page/templates/table.html b/skills/data-page/templates/table.html index 5b7f61b..c4ba61e 100644 --- a/skills/data-page/templates/table.html +++ b/skills/data-page/templates/table.html @@ -8,9 +8,9 @@
- ← 首页
+ ‹

数据表格

@@ -39,7 +39,7 @@ @@ -241,7 +241,7 @@ function backToApp() { location.href = id ? '/?s=' + encodeURIComponent(id) : '/'; } -// 单页场景:本页的副本就是 index.html,「← 首页」指向自身 → 移除(多页导航不受影响) +// 单页场景:本页的副本就是 index.html,标题行返回键指向自身 → 移除(多页导航不受影响) if (/\/(index\.html)?$/.test(location.pathname)) { const c = document.querySelector('.crumb'); if (c) c.remove(); } load();