diff --git a/.gitattributes b/.gitattributes index 3e6ec76..c0e33d2 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,10 +1,21 @@ -# 第三方库原样保存:不做行尾转换 +# 行尾规则(2026-10-03) # -# 为什么要写这个:本机 core.autocrlf 开着,`.min.js` 这类文本文件被 Git 检出时 -# 会被转成 CRLF(`git add` 时会警告"LF will be replaced by CRLF")。 -# 对第三方库这是**无谓的改写** —— 一来哈希与上游不一致, -# 二来部署包里带的就是改写后的版本,将来想核对「是不是原版」就没了基准。 -# 标记成 binary(-text)后 Git 原样存、原样取。 -assets/vendor/** -text -*.min.js -text -*.min.css -text \ No newline at end of file +# 🔴 默认:所有文本文件一律 **LF**,且**检出/还原时也不许转成 CRLF**。 +# +# 为什么必须写死:本机 `core.autocrlf=true`。不写这条的话,任何一次 git 检出/还原 +# (`git stash pop`、`git checkout`、`git restore`…)都会把源码变成 CRLF。 +# 而部署打包取的是**工作树**,于是包里带着 CRLF 上去,部署脚本里那些 +# `grep -qxF '<整行 CSS 选择器>'` 的校验在 Linux 上一条都匹配不到 —— +# 症状是「本地全绿、部署却卡在一条莫名其妙的 CSS 断言上」,代码本身完全没问题。 +# (本轮实测踩到:一次 git stash 往返就把 6 个文件全变成了 CRLF。) +* text=auto eol=lf + +# 第三方库原样保存:不做任何行尾转换(字节与上游一致,便于日后核对是否原版)。 +# ⚠️ 这几条**必须排在 `*` 之后** —— gitattributes 是"后面的规则覆盖前面的", +# 写在前面会被上面那条 `* text=auto eol=lf` 顶掉(本轮当场抓到一次)。 +# ⚠️ 除了 -text 还要**显式 unset eol**:-text 只关掉"文本规范化", +# 上面那条 `*` 里设的 `eol=lf` 仍会挂着(`git check-attr` 可见), +# 换行策略由哪个属性说了算会变得含糊。 +assets/vendor/** -text -eol +*.min.js -text -eol +*.min.css -text -eol \ No newline at end of file diff --git a/assets/css/app.css b/assets/css/app.css index ade8a8c..1237968 100644 --- a/assets/css/app.css +++ b/assets/css/app.css @@ -1007,6 +1007,10 @@ textarea.input { min-height: 76px; resize: vertical; } .share-wrap > summary { list-style: none; cursor: pointer; display: inline-block; } .share-wrap > summary::-webkit-details-marker { display: none; } .share-wrap .inline-form { margin-top: 10px; } +/* 分享改用弹窗选人组件后,里面的 chips + 按钮要能在这个窄条里排开; + 组件默认按"整页宽"设计(.pp-chips 自带 flex-wrap),这里给它一个合理上限, + 免得点开"分享他的名片给…"时弹窗按钮被挤成半行。 */ +.share-wrap .share-to { flex: 1 1 220px; min-width: 0; } /* ---------------- 「从家里已有的人里挑」 ---------------- */ .pick-list { list-style: none; margin: 0 0 4px; padding: 0; display: grid; gap: 8px; } diff --git a/templates/_person_picker.php b/templates/_person_picker.php index c29d55b..3db3adb 100644 --- a/templates/_person_picker.php +++ b/templates/_person_picker.php @@ -32,10 +32,15 @@ $ppTitle = $ppTitle ?? '选择'; $ppEmptyText = $ppEmptyText ?? '未选择'; $ppAllowEmpty = !empty($ppAllowEmpty); -// 同一页多个实例要各有一套 id,否则 document.getElementById 全抓到第一个 -static $ppSeq = 0; -$ppSeq++; -$ppId = 'pp' . $ppSeq; +// 同一页多个实例要各有一套 id,否则 document.getElementById 全抓到第一个。 +// +// ⚠️⚠️ 别用文件顶层的 `static $ppSeq` 做这个计数 —— PHP 里**被 include 的文件**顶层的 +// `static` 初值会**每次 include 都重新绑定**(与函数体内的 static 不同,那个才跨调用)。 +// 实测:同一页 include 三次,拿到的都是 pp1。资源页今天就有两处(归属人 + 共享给谁), +// DOM 里两套 pp1 撞在一起,getElementById / `