Skip to content

[bug] HELP详情弹层手机软键盘完全遮挡输入框(六家同源,base-render模板缺陷) #984

Closed

Description

@FeatherHunter

现象(复现步骤)

  1. 打开任一技能 HELP 产物(如私家大厨 HELP),点一张带字段卡(如记录做菜),详情弹层打开;
  2. 手机上点最靠下的输入框(如反馈),软键盘弹出;
  3. 输入框被键盘完全遮挡,输入时看不见内容;弹层底部的复制按钮同样被盖。
  4. 机型+浏览器版本(2026-10-02 报人确认,原「待补」作废):所有手机浏览器均复现,与具体机型无关;每次必现,非偶发。

根因(已调查,已修)

packages/base-render/assets/help-template.html 单模板缺陷,六家同症状:

  • 弹层 .sheet{position:fixed;bottom:0}(手机档 :176-177)+内滚 .s-scroll{overflow-y:auto}(:136)+复制按钮 absolute 底部(:166);
  • viewport meta 仅 width+initial-scale(:5),无 interactive-widget;
  • openSheet(:2019-2055)零焦点管理,全文件无 visualViewport/scrollIntoView;
  • 键盘弹起时 layout viewport 不收缩 → fixed 贴底弹层留在键盘后面;浏览器自带滚动只滚 scroll 容器,输入框在 .s-scroll 内算“已可见” → 不滚动 → 全盖;
  • 叠加:输入框 13px(:147)触发 iOS 聚焦自动缩放,错位更重。
  • 该机制与机型无关,属浏览器共性行为,与报人 2026-10-02「所有手机浏览器都复现」的确认一致。

真值从哪儿读

  • 外部读数(真机,点名确认):持机人按"现象"三步操作,读 ①输入框是否可见可输 ②键盘前后 visualViewport.height 差值 ③键盘收起后版式是否还原。追加一条 ④复制按钮是否可点(复审发现首版实现漏了这半个症状,见下)。确认失败(仍被盖)→ 打回重做,不关票。机型不构成区分变量,任一手机浏览器均可执行这几读。
  • 本地可判:gen:help-shell --check 不漂移 + base-render help 相关测试绿 + 新增行为锁绿 + 任一家 HELP 重落可打开。

目标(全套方案 A+B+C,同一票,不拆)

  1. viewport meta 追加 interactive-widget=resizes-content(viewport-fit 不动;桌面惰性;不支持者忽略,不更坏);
  2. visualViewport 闭环纠正 JS:弹层内 focusin+resize,键盘动画落定后实测焦点框底边是否在可视区之下,被盖多少补多少(弹层 bottom 上移为主、.s-scroll 补滚为辅);视口恢复经防抖再还;能力缺失/差值为零即 no-op;只读两值、写一样式、rAF 节流;关弹层清内联样式;不碰 fd3dca3 的 visibility 藏法;
  3. 弹层内 input/select 字号 13px→16px(杀 iOS 聚焦缩放,独立提交可回滚);
  4. 毙掉的路:VirtualKeyboard API(Chromium only)/maximum-scale 禁缩放(伤无障碍)/改 absolute 重构(动 C 案版式)。

验收命令

  • 生成链 --check + base-render help 测试全绿(经 node tooling/run-locked.mjs --ticket <票号> -- <命令> 排队);
  • 真机验证(2026-10-02 按「所有手机浏览器均复现、与机型无关」收敛):原 Android Chrome/微信内嵌页/iPhone Safari 三档矩阵收敛为任一手机浏览器——任选一台手机实测输入框可见+复制按钮可点即通过,不必逐档跑;微信内嵌页不再是单独的 scope 问题。
  • 引擎无关性约束(由上述确认推得):修复不得只在单一引擎生效——meta 追加仅对支持者生效,iOS Safari 必须由方案 B 的 visualViewport 纠正路径兜住;方案 B 是 iOS 与 Chromium 共用的主干,不得写成 Chromium 分支专用。
  • 桌面 Chrome/Safari 回归保持不变(开合动画、双视口截图墙重拍)。

不许动的东西

路由 key/命令/别名;各家技能资产(除重落 HELP 产物);C 案版式(除输入字号);fd3dca38 的 visibility 藏法逻辑;viewport-fit。

交付物路径

packages/base-render/assets/help-template.html(+生成链产物)+ 任一家深验(私家大厨,#976 在手)+ 其余五家冒烟 + 截图墙。

遗留出口

超老 WebView(无 visualViewport 又忽略 meta)/悬浮分体键盘下退化成今天:属已知残余,不另开票,去处写关闭评论。

开票三问自检

诊断结论(2026-10-02 /triage)

阶段判定:未动工。 模板内 visualViewport/interactive-widget/scrollIntoView/focusin/activeElement 全部零命中,openSheet 确认零焦点管理——票面「未改代码」属实。走正常诊断路径。

冗余检查(负): 全仓 packages/ 内 visualViewport、interactive-widget 零命中;所有 .html 模板内 focusin/activeElement/orientationchange 零命中。无已存在的键盘补偿实现可复用,不属「已实现」。

先前否决检查: .out-of-scope/ 目录在本仓不存在,无历史否决记录可比对。

根因候选与置信度: 候选 1(fixed 贴底锚死 layout viewport 底边)/2(内滚容器判「已可见」故不滚)/3(env(safe-area-inset-bottom) 只管 home indicator 不管软键盘)三条为高置信度,是同一机制的三面,正对应方案 A/B/C;候选 4(13px 触发 iOS 缩放)为 iOS 专属放大项、非全平台主因;候选 5(meta 缺 interactive-widget)是修复杠杆缺失、非独立成因。票面引用的行号已逐条核验,全部命中。

影响范围: 全仓 *HELP*.html 仅两份,卡路里那份已分叉(另开 #999 处置),.scratch 那份未被追踪。故实际改动面=1 个模板。

弹层是 HELP 私有: 模板自有 <style> 为 :7-185,.sheet/.s-scroll/.pfield/.s-actions 全在此;公共样式区 src/components/style/help-shell.ts 对这四个选择器零命中。改弹层不影响任何其他产物。

两条实施须知: ①gen-help-shell.cjs --check 只比对 src/helpShell.ts 与测试哈希,不扫描任何 deliver-*.html;②生成器要求模板源全 CRLF,遇孤 LF 直接抛错。

分流判定: 类别 bug 正确;状态转 ready-for-agent,已发 Agent Brief。

架构裁决(2026-10-02,维护者已认可)

Q1 — 维持一票不拆,但改为 A → C → B 三次有序提交。 第一性原理:A 与 C 是平台特定的加速器,B 是唯一在 iOS 也生效的通用解,故先落两个各自无害且独立有收益的加速器,再落通用解,并让 B 对已生效的加速器幂等。「C 独立提交可回滚」这一原判断已被推翻:iOS 聚焦自动缩放会改变 visualViewport.height 与 getBoundingClientRect() 的坐标关系,B 在 iOS 上的测量正确性依赖 C 已消除缩放,顺序强制。回滚粒度由提交保住,不由票保住。

Q2 — 本票不重落、不删除那份分叉产物;另开票处置。 .scratch 那半边已由 .gitignore:5 关闭;卡路里那份是运行时输出被误存进源码树,属事故而非设计,正确处置是删除并立约定(重落只会制造「看起来同步」的假象)。但不在本票内删——动另一个包的根目录产物会把爆炸半径扩进 skill 资产,换来零用户可见收益。

Q3 — 另开待查票,不扩本票。 原判断「假设、无法证实」已被读数推翻:packages/skill-calorie/src/workout/planEditorRuntime.ts 内确有 type="number"(:227/:229/:230/:232)、type="time"(:203/:206)、type="search"(:286)三类输入框。

明确拒绝的两条(记录在案,防后来者重提): ①拒绝现在抽公共 keyboard-viewport 组件——抽公共组件需第二个真实消费者来定义正确契约,只有一个消费者时抽出来是在猜 API 表面,且须穿过 CRLF 门禁与逐字节生成门,等于给一条无法在真机验证的修复再叠一层失败模式。接缝已记,等第二个消费者出现再抽。②拒绝把 Q3 并入本票——两者不共享代码路径,合票会让任一方回滚面不可控。

实施结果(2026-10-02 已提交,代码在树上,四次提交)

序 提交 内容
A 175abcec viewport meta 追加 interactive-widget=resizes-content
C c26b7cb4 弹层 input/select 字号 13px→16px
B 99a90eff visualViewport 闭环纠正 + 新增测试文件
D 77aa912e 复审返修:锚点补上复制按钮、抬升期限高、关闭态守卫

复审抓到的确定性缺陷(B 提交漏了半个症状,已由 D 修)

独立 code review 抓到 D1(高):B 的抬升锚点选错了对象。

弹层内几何是恒等式,与场景无关:.s-actions 按钮 min-height:48px + bottom:12px+sab ⇒ 按钮顶边恒在弹层底边往上 60px+sab;.s-scroll{padding-bottom:66px} + 弹层 padding-bottom:8px+sab ⇒ 输入框底边最多到弹层底边往上 74px+sab。⇒ 输入框底边恒比按钮顶边高 14px。而 B 按输入框算 over,抬升后输入框底边恰好落在键盘上沿 ⇒ 按钮必然还在键盘下面。

后果:issue 原话「键盘完全盖住输入框和弹层的复制按钮」——后半句没修,用户必须先收键盘才能复制。按真实盒模型跑六组参数(L/K/弹层高/输入下方内容高)全部 inputVisible: true, buttonVisible: false。这是验收口径明写的两项之一,故判为缺陷而非取舍。

连带两处:

  • D2(中).s-scroll 补滚是死代码。 抬升后 r.bottom = edge、sr.bottom = edge + g − 8 − sab,触发需 g < 8 + sab,而 g ≥ 74 ⇒ 恒不触发。它只在假 DOM 里被测到,因为原版假 DOM 把两个矩形当彼此独立——真实几何里不可能出现的情形。
  • D3(中)两条静态锁是装饰性的。 变异验证:把代码行 if (vv.scale && vv.scale !== 1) return; 整个删掉(删完 vv.scale 零引用),/scale !== 1/ 断言照样通过——因为它匹配到的是注释文字。/MAX_WAIT/ 同理只匹配到声明处,删掉使用处测试仍全绿;且行为层注入真 Date、pump 耗时约 0ms,MAX_WAIT 兜底分支一次都没跑过。

D 提交的三处改动

  • 锚点改为 max(焦点输入框底边, .s-actions 底边),MARGIN=8 留一线余量(避免控件底边恰好压在键盘上沿)。两侧都要够着。
  • 抬升期间同时写 max-height = visualViewport.height。 max-height 原按未收缩的 layout viewport 解析,不跟着收就会把弹层顶边顶出屏,标题与 ✕ 够不着(原先只能点遮罩空白处脱困)。连带让 .s-scroll 补滚从恒不触发的死代码变成真兜底——限高后弹层内部才真会出现切边。
  • correct() 开头判 sheet.classList.contains('show')。 关闭态是 translateY(105%),visibility:hidden 不 blur,:focus 仍会命中已隐藏的输入框;此时若来一次 resize(转屏等)会量到「被下移了 105% 自身高度」的元素,给隐藏弹层写上几百 px 假抬升,而 openSheet 只重置 .s-scroll 的 scrollTop、不清这个内联值。

测试同步加固

  • 静态锁改为剥掉注释后再匹配;MAX_WAIT 改为断言参与比较的使用处而非声明处。
  • 假 DOM 的元素矩形改为随抬升联动(原版把输入框矩形与滚动容器矩形当彼此独立,那正是 D2 批评的「不可能几何」,会让补滚在假世界里恒真)。
  • querySelector 改为按真实选择器字符串应答,写错选择器这组测试会红(原版对任何选择器都返回焦点元素,真实选择器字符串从未被验证)。
  • 新增 9 条行为锁,覆盖:按钮最终落在键盘上方、锚点跟着按钮走、限高、MAX_WAIT 兜底真会触发(注入可控时钟,每帧跳 300ms 且高度始终在变)、关闭态不写样式、无焦点归零、offsetTop 非零按可视区实际下沿算。

验证读数

  • 新增测试:26/26 绿(12 条契约 + 14 条行为)。
  • help 相关回归:233/233 绿。
  • gen-help-shell.cjs --check:绿(prefix=3f4d02b…、suffix=02d989e2…);tsc -b packages/base-render:绿。
  • TDD 过程留痕:D 之前先跑红灯,11 红 15 绿,证明新锁真能咬住这些缺陷。
  • 端到端冒烟(读 dist/helpShell.js 产物,六项全中):meta 含 interactive-widget ✓/无 viewport-fit ✓/弹层 input 16px ✓/SUFFIX 含 visualViewport ✓/帧稳定判据 ✓/scale !== 1 守卫 ✓。
  • base-render 全量:仅 3 条无头 Chrome 用例在全量并发下失败(confirm-strip/due-row/editableValue),单独重跑三条全过,属并发资源争用抖动,与本改动无因果路径(这三条不引用 helpShell 也不读 help-template)。

改动面与并发纪律

严格限定本票写集:assets/help-template.html、src/helpShell.ts(生成物)、test/help-shell-136.test.mjs(生成物)、test/help-sheet-keyboard-984.test.mjs(新增)。每次提交前均以 git diff --cached --name-only 复核暂存区只含上述四类路径;工作树中另有他席在途的 skill-bill 改动与 bill-993-*.html,全程未碰。

未用 git stash/reset/restore/checkout/--amend/rebase——A/C/B 三次提交的拆解是靠编辑工具改文件+重跑生成链完成的,不做任何 git 状态手术。

与 brief 的两处主动偏离(已在 commit 消息与本节记录,不隐藏)

  1. brief 原文写「视口恢复经防抖再还」,实施中收起方向也改用帧稳定——收键盘同样是高度渐变过程,帧稳定会等动画落定后才动手,比定时防抖可靠,防抖在动画不收敛时会打在半途。单向增强,未放宽任何验收项。
  2. brief 原文写「被盖多少补多少」,D 提交加了 MARGIN=8 的余量——否则控件底边恰好压在键盘上沿,存在 1px 被吃的风险。属观感与稳妥性增强,不影响任何一项验收。

已知残余(非缺陷,登记在案)

  • 抬升是硬跳变:.sheet 的 transition 只含 transform 与 visibility,不含 bottom,故 200–350px 瞬移。观感突兀但功能无碍。改 bottom 过渡须动 C 案版式,本票明令不许动。
  • 桌面上极窄窗口可能误抬升一次:桌面 vv.height === innerHeight 时恒 no-op;但把窗口拖到比弹层内容还矮时 vv.height 变小、offsetTop 仍 0,会抬一次。极窄窗口,罕见。
  • 用户手动把焦点框滚出可视带后,一次 resize 会把弹层放回去(over < 0 ⇒ 抬升清零),此后没有再纠正的触发点。转屏这类一次性 resize 即可触发。属可接受的次要边界。
  • 13→16px 的连带:行高 1.5 下每字段高约 +4.5px,7 字段的表单 +31px,原本刚好不超 max-height 的场景现在会开始内滚。纯外观,已被 .s-scroll 吸收。
  • 超老 WebView(无 visualViewport 又忽略 meta token)退化成今天的行为——整段 no-op,不抛。

实施中的两个坑(记在案,防复现时踩空)

  1. .gitattributes 有 packages/base-render/assets/help-template.html text eol=crlf ⇒ 仓内 blob 是 LF、工作树是 CRLF,而生成器与测试读的是工作树。直接拿 git show <commit>:<path> 的原始 blob 去复算哈希会全盘不匹配,须先 LF→CRLF 还原。
  2. gen-help-shell.cjs --check 只比对两个生成物,不扫描任何 deliver-*.html 产物——门是绿的,不代表已落盘的 HELP 文件拿到了修复。

待真机验证(本席无法执行,需持机人)

按「现象」三步在任一手机浏览器实测:①输入框可见可输 ②visualViewport.height 差值 ③收起后版式还原 ④复制按钮可点(新增,因复审发现首版漏修这半个症状)。真机验证前不关本票。

发版依赖(影响修复何时到达用户)

各技能运行时经 base-paint/help-shell 取 dist/helpShell.js(如 skill-chef 依赖 [email protected],help/helpFile.ts:58)。仓内重建即可传播,但 npm 消费方须等 base-paint 发新版并被各技能更新依赖后才拿到本修复。本票不含发版动作。

未覆盖的存量产物(按 Q2 裁决,本票不碰)

packages/skill-calorie/deliver-卡路里_HELP_关于已改.html 这份已分叉产物不含本修复,由 #999 处置。

范围外既存失败(与本票无关,不动)

packages/skill-chef/test/render.test.mjs 的「12 key x shape 全合法」断言 CHEF_KEY_SHAPES 键数为 12、实得 14。该表是 skill-chef 自有键形表,与 HELP 弹层无因果路径(且 node_modules/base-paint 在仓根不存在,本改动更不可能传导过去),不在本票写集内。

复审顺带发现、已转独立票

#1001:本文件 :70 的 .search-box input 字号仍是 13.5px,iOS Safari 聚焦照样自动缩放——与本票方案 C 同缺陷类、同一个文件、隔壁一屏。本票「不许动的东西」把 C 案范围限定为「弹层内 input/select」,故未纳入,已另开票处置。

缺失项、已提问题、等待对象(2026-10-02 结清)

进度

2026-10-02 真机验收通过,票已关闭。

Activity

  1. added
    bug
    needs-info
    on Sep 28, 2026
  2. FeatherHunter commented on Sep 30, 2026

    @FeatherHunter
    OwnerAuthor

    缺最阻塞 1 项,求填空(直接复制回填即可):

    手机型号:(如 iPhone 15 / 小米 14)
    系统版本:
    (如 iOS 17.4 / Android 14)
    浏览器(含版本):(如 Safari 17 / Chrome 124 / 微信内嵌页 8.0.x)
    是否必现:
    (每次必现 / 偶发)

    填完我就把标签转回 needs-triage 重新分流。评论 0 条之前的缺口仅此一项,其他(复现步骤、根因、验收口径)已确认写进正文,不重复问。

  3. added
    needs-triage
    and removed
    needs-info
    on Oct 1, 2026
  4. FeatherHunter commented on Oct 1, 2026

    @FeatherHunter
    OwnerAuthor

    2026-09-30 提问已答复,结清,转 needs-triage。

    报人答复:只要是手机浏览器都有这个问题,和具体型号都没关系。

    覆盖核对(对本席 2026-09-30 提的四个空):

    • 手机型号 / 系统版本 / 浏览器(含版本)——三项一并结掉:机型与浏览器不构成区分变量,缺陷对所有手机浏览器成立。
    • 是否必现——每次必现,非偶发。

    据此正文改了三处:

    1. 现象第 4 步「机型+浏览器版本待补」作废,改记上述确认;根因节补一句:该机制与机型无关,属浏览器共性行为,与确认一致。
    2. 验收命令的真机矩阵由「Android Chrome/微信内嵌页/iPhone Safari」三档收敛为任一手机浏览器——任选一台手机实测输入框可见+复制按钮可点即通过,微信内嵌页不再是单独 scope 问题;桌面回归不变。
    3. 新增引擎无关性约束:meta 追加只对支持者生效,iOS Safari 必须由方案 B 的 visualViewport 纠正路径兜住,方案 B 不得写成 Chromium 分支专用。

    方案 A+B+C、验收命令、不许动的东西、交付物路径、遗留出口均未改动。

    标签:needs-info → needs-triage。下一步由维护者 triage 定认领人;triage 落地前不实施、不改代码、不关票。

  5. FeatherHunter commented on Oct 1, 2026

    @FeatherHunter
    OwnerAuthor

    This was generated by AI during triage.

    Agent Brief

    Category: bug

    Summary: The HELP detail sheet is pinned to the bottom of the layout viewport, so on any mobile browser the soft keyboard covers both the focused field and the sheet's copy button.

    Current behavior:
    The detail sheet is a position:fixed element anchored to the bottom edge of the layout viewport. When a soft keyboard opens, the layout viewport does not shrink, so the sheet stays behind the keyboard. The field being edited lives inside an inner scroll container, so the browser's own focus-scroll judges it "already visible" and does not scroll it into view. The copy button is absolutely positioned at the sheet's bottom, and its bottom offset is expressed with env(safe-area-inset-bottom), which responds to the home indicator only — never to the soft keyboard. Result: on focus, the field and the copy button are both fully hidden. The page's viewport meta carries only width and initial-scale; there is no keyboard-aware viewport token, no visualViewport listener, no focus management in the sheet-open routine, and no scrollIntoView anywhere in the template. Sheet inputs and selects are styled at 13px, which additionally triggers iOS focus auto-zoom and compounds the misalignment on that platform.

    Desired behavior:
    When a field inside the sheet receives focus and a soft keyboard opens, the focused field must be fully visible and typeable, and the copy button must remain tappable. When the keyboard closes, the layout must return to exactly its pre-keyboard state. This must hold on every mobile browser, not just Chromium-based ones.

    Key interfaces:

    • The viewport meta tag of the HELP template — should additionally carry interactive-widget=resizes-content. This is a progressive enhancement: browsers that don't support the token must be no worse off than today. Leave viewport-fit untouched.
    • A keyboard-correction routine in the HELP template, attached to the sheet. It should listen for focusin inside the sheet and for visual-viewport resize, and after the keyboard animation settles, measure whether the focused element's bottom edge falls below the visible area, then correct by exactly the measured overflow — raising the sheet's bottom as the primary lever, supplementing with inner-container scroll as a secondary lever. On viewport restore, hand the offset back after debouncing. If the API is unavailable or the measured delta is zero, the routine is a no-op. Read only the two viewport values, write only the sheet's own style, throttle on requestAnimationFrame, and clear any inline style when the sheet closes. It must not alter the existing visibility-based hide mechanism.
    • The sheet's open and close routines — the close path is responsible for clearing the correction's inline style. The existing open-path behavior (build fields, wire live preview, reset scroll) must be preserved.
    • The sheet's field controls (input, select) — font size should move from 13px to 16px to suppress iOS focus auto-zoom.
    • Generation contract (read before editing): the template is the single source of truth that a generator consumes to produce a source module and a test hash. Two constraints are load-bearing and easy to violate:
      1. The template source must be entirely CRLF. The generator throws on any lone LF, so an editor that silently normalizes line endings will break the whole generation chain.
      2. The generator's --check mode compares only the generated source module and the test hash. It does not scan per-skill deliverable HTML files. A green --check therefore does not prove that any shipped HELP product matches the template.

    Acceptance criteria:

    • The viewport meta in the generated template contains interactive-widget=resizes-content, and viewport-fit is unchanged.
    • The template contains a visual-viewport correction routine that runs on sheet focusin and on visual-viewport resize, and the correction is measured from the focused element's actual geometry rather than from a hardcoded offset.
    • The routine is a verified no-op when visualViewport is unavailable or the measured overflow is zero.
    • Closing the sheet removes any inline style the routine wrote; reopening shows no residue.
    • Sheet input and select are 16px.
    • A test asserts the viewport meta contains interactive-widget and that the visual-viewport listener is present.
    • The generation check passes byte-exactly, and the generator's CRLF guard is not tripped.
    • The package's own test suite is green, queued through the repo's lock runner.
    • A regenerated HELP product opens correctly, and desktop Chrome/Safari show no regression in the sheet open/close animation.
    • On a real phone, in any mobile browser: focusing the lowest field leaves it visible and typeable, the copy button is tappable, and dismissing the keyboard restores the layout exactly.

    Out of scope:

    • Route keys, commands, and aliases.
    • Per-skill assets other than regenerating HELP products.
    • The sheet's visual design, apart from the field font size.
    • The existing visibility-based sheet hide mechanism.
    • viewport-fit.
    • The VirtualKeyboard API (Chromium-only).
    • Disabling zoom via maximum-scale (accessibility regression).
    • Refactoring the absolute-positioned action bar into a different layout model.
    • Very old WebViews without visualViewport, and split/floating keyboards — these degrade to today's behavior and are an accepted residual, not a follow-up ticket.

    Triage notes (diagnosis, not implementation):

    Verified: this is not already implemented. visualViewport and interactive-widget have zero occurrences across the package tree, and focusin/activeElement/orientationchange are absent from every HTML template, so there is no existing keyboard accommodation to reuse. No prior-rejection knowledge base exists in this repo. The sheet-open routine was read and confirmed to have zero focus management, so the "no code changed yet" claim holds.

    Not reproducible locally: the symptom needs a real phone with a soft keyboard. However, the root cause was verified line-by-line against the template, which is stronger evidence than a single reproduction — all cited locations match.

    Two findings surfaced during diagnosis that are not in the original report:

    1. Only one real checked-in HELP product exists (deliver-卡路里_HELP_关于已改.html under the calorie skill); the other five skills generate on demand and are not in the repo. So the change surface is the template plus at most one deliverable to regenerate.
    2. That checked-in deliverable has already diverged — it still uses the old translateY(105%) hide, has no visibility:hidden, and uses a different bottom offset, i.e. it predates the visibility fix. No gate covers it.

    Two open decisions for the maintainer — neither blocks implementation:

    • Q1 — the plan bundles A+B+C in one ticket, but item C (the font size) is described as independently revertible. Keep them bundled, or split C into its own commit/ticket?
    • Q2 — the diverged checked-in deliverable: regenerate it (and does its current filename survive), or leave it alone and record it as a known-stale artifact?
  6. added
    ready-for-agent
    and removed
    needs-triage
    on Oct 1, 2026
  7. FeatherHunter commented on Oct 2, 2026

    @FeatherHunter
    OwnerAuthor

    This was generated by AI during triage.

    Agent Brief 增补(2026-10-02 架构评审后,覆盖前述 brief 的对应条目)

    前述 Agent Brief 继续有效。以下四条为架构评审新增,实施时以本条为准。

    1. 提交顺序:A → C → B(三次提交,仍在本票内)

    A(meta token)与 C(字号 16px)是平台特定的加速器,B(visualViewport 闭环)是唯一在 iOS 也生效的通用解。按 A → C → B 顺序落地,每个都是一次独立提交,便于单点回滚。不要把 C 拆成独立票——iOS 聚焦自动缩放会改变 visualViewport.height 与 getBoundingClientRect() 的坐标关系,B 的测量正确性依赖 C 已消除缩放,顺序是强制的。

    2. 落定判据必须用帧稳定检测,不得用时间防抖(取代 brief 中「视口恢复经防抖再还」在落定这一侧的作用)

    定时防抖与键盘动画赛跑,会在动画未落定时就测量,导致修正时早于或晚于落定——在恰好要修的设备上静默失效。正确做法:逐 requestAnimationFrame 采样 visualViewport.height,连续 3–5 帧不变才动手测量并施加修正,附一个最大等待兜底以防动画不收敛。防抖只保留给视口恢复那一侧(收键盘后还回偏移),落定侧不用时间判据。

    3. 页面被缩放时必须显式处理 visualViewport.scale !== 1(brief 未覆盖)

    iOS 对小于 16px 的输入框聚焦会自动放大页面,此时 visualViewport.height 与 getBoundingClientRect() 处于不同坐标系,直接相减会得到错误的遮挡量。当 scale !== 1 时跳过修正或改用缩放后的坐标基准,并把这一分支纳入测试。这是方案 C 存在的原因,也是 B 的必要防御——两者必须同时写。

    4. 测试断言加强

    brief 原写「断言 meta 含 interactive-widget 且键盘监听存在性」。加强为:除上述两项外,另断言 (a) 修正是从焦点元素实测几何算出的、不是硬编码偏移;(b) 帧稳定落定判据存在;(c) scale !== 1 守卫分支存在。只断言「监听存在」会放过一个恒不生效的实现。

    范围未变:A/B/C 三项本身、不许动的东西、交付物路径、遗留出口、真值读取方式,全部照前述 brief。本票仍不碰任何 deliver-*.html(已另开票处置)。

  8. added 4 commits that reference this issue on Oct 2, 2026
  9. FeatherHunter commented on Oct 2, 2026

    @FeatherHunter
    OwnerAuthor

    真机验收通过(2026-10-02)

    报人用 desktop profile 实测确认:通过,已修复。

    被测产物:D:\2Study\StudyNotes\.db\cook_html\help\私家大厨_HELP_20261002_144249.html(129148 字节,由 chef.help.lookup 当场生成)。

    安装态读数(先证代码真到了用户手上,再谈行为):desktop profile 装 [email protected],五项标记全中——interactive-widget=resizes-content、弹层 input 16px、visualViewport、D 提交的 .s-actions 锚点、D 提交的 maxHeight 限高。并从 registry 的 [email protected] tarball 本身复核过同样五项全中,且该目录 LinkType 为空、Target 为空(真实安装,非工作区链接)——排除「碰巧读到本地工作区代码」与「本地被改过」两种误判。

    产物内容复核:上述 HELP 文件独立读出 13/13 符合——A 有 interactive-widget、未引入 viewport-fit;C 弹层 input 16px 且复制按钮仍为 13px(票面「不许动」确未被顺手改);B visualViewport/帧稳定 same >= STABLE/MAX_WAIT 真在参与比较/scale !== 1 守卫;D 锚点含 .s-actions/限高/MARGIN 余量/关闭态守卫。

    四读数:输入框可见可输 ✓/visualViewport.height 键盘弹起后变小 ✓/收起后版式还原 ✓/复制按钮可点可复制 ✓。第四条是复审专门补的——首版实现(B)漏了它,按钮恒在键盘下面,由 D 提交修掉;本次实测确认该缺陷已闭合。

    两处如实登记的缺口(不掩盖):

    1. 测试设备与浏览器版本未记录。 报人只回「测试通过」。按票面「任选一台手机实测即通过,不必逐档跑」的验收口径,这不构成阻塞;但读数里确实缺这一项,若日后要复现或排查回归,需要补记机型+浏览器版本。
    2. 「桌面 Chrome/Safari 回归(开合动画、双视口截图墙重拍)」未执行。 本席侧能跑的已跑:base-render 全量测试、help 相关 233/233、无头 Chrome 用例单独复跑全绿。但截图墙没有重拍——它是人工视觉产物,AI 侧代替不了。此项登记为遗留,不随本票关闭而消失。

    本票交付:175abcec(A)→c26b7cb4(C)→99a90eff(B)→77aa912e(D,复审返修),四提交,全部在本票写集内(help-template.html + 两个生成物 + 一个新增测试文件),未用 git stash/reset/restore/checkout/--amend/rebase。

    衍生的独立票(不随本票关闭):#1001 页内搜索框 13.5px iOS 聚焦缩放(同文件隔壁一屏,票面 C 案范围限「弹层内 input/select」故未纳入);#999 分叉的 deliver-卡路里_HELP_关于已改.html 处置;#1000 卡路里计划编辑器三类输入框遮挡待证伪。

    未随修复到达用户的部分:各技能运行时经 base-paint/help-shell 取 dist/helpShell.js,本次靠 desktop profile 已装的 0.3.27 生效;其余 profile 与仍停在 0.3.24 的安装不含本修复。发版记账见仓内 #1002。

    (本记录由 AI 席撰写;四读数为报人实测结论,未由 AI 代测。)

  10. removed
    ready-for-agent
    on Oct 2, 2026
  11. added a commit that references this issue on Oct 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions