Skip to content

fix(ui): 修复拾色主题下非首屏单行输入框文字偏底未居中问题 - #250

Merged
greyoak111 merged 1 commit into
mainfrom
fix/shise-input-vertical-center
Nov 21, 2026
Merged

greyoak111 merged 1 commit into
mainfrom
fix/shise-input-vertical-center

Conversation

@greyoak111

Copy link
Copy Markdown
Owner

现象与原因

在「拾色(shise)」皮肤的对话页(非首屏 html.wel)下:

  • #composer-inner 使用 align-items: flex-end,行高由 40px 的 #btn-send 决定;
  • .mini-btn(32px + margin-block: 4px × 2 = 40px)和 #btn-interject(34px + margin-block: 3px × 2 = 40px)已补齐至 40px 与发送键垂直居中;
  • 但 #input 漏补了高度,仍沿用基础样式 line-height: 24px; padding: 4px 0(总高仅 32px),在 flex-end 容器里贴底排列,单行占位文字与光标比左右按钮中心低了 4px。
  • 另外,切皮肤或改字号时 autoGrow() 未重新触发,行内残留的旧 style.height(如 32px)也会继续压住单行高度。

修复内容

  1. gateway/web/style.css:新增 html[data-skin="shise"]:not(.wel) #input{padding:8px 0},将非首屏单行 #input 总高补至 24 + 8×2 = 40px,与 40px 的 + / 插话 / 发送按钮完全垂直居中;多行输入时按钮仍与末行居中对齐;:not(.wel) 不影响首屏双行独立排布。
  2. gateway/web/app/05-composer.js:在 autoGrow() 下方监听 document.documentElement 的 data-skin / data-fs 变化并重算高度,避免切皮肤或切字号后行内旧高度导致偏底或裁切。
  3. gateway/tests/ui-skin-contrast.test.mjs:补齐样式与 MutationObserver 回归守卫。

验证

  • app.js 拼接语法校验通过。
  • node scripts/test.mjs 跑过 ui-skin-contrast、stab-f-composer-input、stab-b-client、a0610-f1-frontend、a0610-f3-frontend 全部通过。
  • node scripts/pr-guard.mjs origin/main HEAD 通过(高 0 项、中 0 项)。

@github-actions

Copy link
Copy Markdown

PR 安全初筛 / Safety pre-check

改动 3 个文件;高 0 项、中 0 项。

没发现需要特别留意的地方。自动初筛只能挡明显的,合并前仍需人工看过。

@greyoak111
greyoak111 merged commit a9f95c7 into main Nov 21, 2026
3 checks passed

This branch was successfully deployed

1 active deployment
apk-ci — 5b7d240b Deployed Nov 21, 2026 by greyoak111 via build #320
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants