data-page返回键重做(评审:独立成行的「←首页」crumb白占一行垂直空间):改为标题行内嵌28px圆形「‹」返回键——table塞进card的.hd(h1加flex:1撑开,新增钮仍居右),dashboard/kanban加.page-hd flex行包h1(h1的textContent更新逻辑不受影响,crumb是兄弟节点);base.css换.crumb规则(圆形/hover淡蓝底/不占额外行高)并新增.page-hd;单页守卫不变(副本即index时querySelector移除crumb,标题行自然回落为h1);SKILL.md步骤5口径同步;测试会话手工刷模板(index导航副本不碰)

This commit is contained in:
2026-09-24 10:17:51 +08:00
parent e3ada6d513
commit 1a49544d95
5 changed files with 21 additions and 13 deletions
+2 -2
View File
@@ -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 就够。模板无法覆盖需求时,才走自定义路径(见「自定义页面」一节)。
+7 -3
View File
@@ -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; }
/* ── 卡片 ─────────────────────────────────────────────── */
+5 -3
View File
@@ -11,8 +11,10 @@
</head>
<body>
<div class="container">
<a class="crumb" href="./">← 首页</a>
<h1 id="title">数据看板</h1>
<div class="page-hd">
<a class="crumb" href="./" title="返回导航">‹</a>
<h1 id="title">数据看板</h1>
</div>
<div class="stats" id="stats"></div>
<div class="card card-pad">
<h2 id="chartTitle">分布</h2>
@@ -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();
+4 -2
View File
@@ -11,8 +11,10 @@
</head>
<body>
<div class="container">
<a class="crumb" href="./">← 首页</a>
<div class="page-hd">
<a class="crumb" href="./" title="返回导航">‹</a>
<h1 id="title">看板</h1>
</div>
<div class="board-outer" id="outer"><div class="msg">加载中…</div></div>
</div>
@@ -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();
+3 -3
View File
@@ -8,9 +8,9 @@
</head>
<body>
<div class="container">
<a class="crumb" href="./">← 首页</a>
<div class="card">
<div class="hd">
<a class="crumb" href="./" title="返回导航">‹</a>
<h1 id="title">数据表格</h1>
<button class="btn" id="addBtn">+ 新增</button>
</div>
@@ -39,7 +39,7 @@
<style>
/* 表格页面特有样式 */
.hd { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.hd h1 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.hd h1 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; flex: 1; }
.tb { padding: 10px 18px; border-bottom: 1px solid var(--border); }
</style>
@@ -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();