Skip to content

refactor: 设置卡片缩进与行节奏改由外壳和列表负责 - #1749

Merged
qqqqqf-q merged 5 commits into
felinics:mainfrom
qqqqqf-q:refactor/memoh-269-settings-card-responsibilities
Nov 6, 2026
Merged

qqqqqf-q merged 5 commits into
felinics:mainfrom
qqqqqf-q:refactor/memoh-269-settings-card-responsibilities

Conversation

@qqqqqf-q

@qqqqqf-q qqqqqf-q commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Author

  • Human
  • Agent

Type

  • bug
  • feat
  • test

Summary

问题:外观设置 → Advanced 弹窗里,"Examples in sidebar" 比下面的 "Code highlight" 和弹窗标题多缩进了 16px;Bot 网络和渠道设置的 Advanced 弹窗也一样。

原因:设置卡片本身不留边,左右 16px 缩进写在每一行上。行放进弹窗时就会多出这 16px,而调用方写的 mx-0 覆盖在 Tailwind v4 下按样式表顺序被静默吃掉了。卡片里的非行内容(段落、表格、图表、分页条)只能各自手写 px-4,全仓约 30 处。

做法:配合 felinics/ui#44 按层划分职责——卡片外壳统一提供左右留白,列表提供行节奏,行只排内容,需要贴边的内容用 SettingsBleed 声明。本 PR 更新 packages/ui 子模块并迁移页面:

  • 删除卡片内约 30 处手写的 px-4 / mx-4,p-N 改为 py-N。
  • 外观 Advanced 弹窗:去掉不生效的 mx-0 min-h-0 py-0 覆盖。
  • Bot 网络 Advanced 弹窗:各组行改用 SettingsList,只拿行节奏,不再多缩进。
  • 压缩日志表格与分页、模型列表分页、记忆图谱画布:改用 SettingsBleed 贴到卡片边缘,外观不变。
  • 视频服务商模型区:手写标题 + SurfaceCard 改为 SettingsSection,与语音、转写、模型服务商的模型区一致。
  • 渠道设置 Advanced 弹窗:选填字段行包进 SettingsList,与 Bot 网络弹窗一致。
  • App 详情依赖列表:手写容器改为 SettingsSection。
  • 卡片内残留的手写缩进一并去掉:MCP 服务器需手填 OAuth 凭据时的输入区、服务商 OAuth 设备码面板及其首次加载占位。
  • 新手引导第 3 步的模型行不在设置卡片里,由调用处保留原来的左右 16px,外观不变。
  • 转写服务商:去掉自包的工具区包装,改由 SettingsSection #actions 统一处理。
  • About 身份卡:抽成页面私有组件 about-identity-card.vue,外壳改用 SurfaceCard,四边 20px 不变。它是自由排版的内容,不套设置列表的行缩进。UI 契约守卫的遗留计数随代码转到新文件,总量不变。
  • 窄屏 provider-configuration 规则改按 data-settings-row 匹配行。
  • 组件墙新增 SettingsList / SettingsBleed 示例。

可见变化(其余页面改动前后逐像素一致):

位置 变化
外观 → Advanced 弹窗 "Examples in sidebar" 与 "Code highlight"、弹窗标题左对齐
Bot 网络 → Advanced 弹窗 各组行与弹窗标题左对齐
渠道设置 → Advanced 弹窗 选填字段行与弹窗标题左对齐(未截图,结构与 Bot 网络弹窗相同)
Bot 详情左上角 Bot 卡片 左右内边距 12px → 16px,与其他卡片统一
视频服务商模型区标题 14px → 13px,与其他模型区标题一致
语音服务商模型区 Import Models 回到右侧,与 Add Model 并排(原来夹在标题和 Add Model 中间)
App 详情依赖列表 改为标准卡片:深色下为卡片底色、无描边;浅色下底色由浅灰变为白、圆角 10px → 12px,差别细微;"未知依赖"回退行与正常依赖行同高
Supermarket 依赖加载失败时的 Retry 从左侧移到右侧(只在出错时出现,未截图验证)

合并顺序:felinics/ui#44 已合并,本 PR 的子模块指针已更新到 felinics/ui main 上的合并提交 13b5a16。

Related Issues

Validation

以下为 Agent 自检,不是真人 QA。

  • 环境:OSS dev 栈(server 18080 / channel 18081)。改动版和基线(main 86ae1db1b,ui 8be0fdd)各起一个宿主机 vite,接同一个后端。
  • 截图对比:Playwright,1440×2400,浅色、深色各一遍,pixelmatch 逐像素对比。覆盖:
    • 设置各页:外观、账户、About、快捷键、用量、Runtimes;Providers 四个 tab 及模型、语音、转写、视频、搜索、抓取服务商详情;
    • Bot 详情全部标签页、App 详情、新建 MCP(含 Advanced Settings 展开)、添加平台、Telegram 平台设置;
    • 压缩日志弹窗、网络 Advanced 弹窗(只在表单里临时打开私有网络开关,未保存);
    • 组件墙上的 SettingsSection/SettingsRow、Appearance 复合行、ExpandableSettingsRow 三个旧示例(前后逐像素一致)和两个新示例。
  • 结果:差异只出现在上表所列位置,以及实时数据(CPU/内存读数、更新时间)。About 页抽组件后前后逐像素一致。
  • 静态检查:scripts/check-ui-contract.mjs 通过,3 条警告改动前已存在;web vue-tsc 与 ui vue-tsc --build 通过;提交钩子的 eslint 通过。
  • 单元测试:apps/web vitest 有 13 个文件、93 个用例失败,与 main 基线完全相同,属于本机环境问题,与本 PR 无关;About 页测试通过。
  • 独立审查:另开一个 Agent 从零审查两个 PR,发现渠道 Advanced 弹窗漏套列表(字段行失去行高与分隔线)、新手引导模型行多出 16px 宽及若干文档偏差,均已在后续提交中修正。之前的自动审查指出的残留缩进同样已修正。上述修正未重新截图,类型检查、eslint、check-ui-contract 通过。
  • 未覆盖:外部 Agent 详情(测试 Bot 没有外部 Agent,无法进入);Runtimes 空状态(测试环境不为空);App 多依赖时的分割线(测试 Bot 只有一个依赖);Supermarket 依赖加载失败态。

Screenshots / Recordings

截图均来自上述运行中的 dev 环境,左为 main,右为本 PR。

外观 → Advanced 弹窗(浅色、深色):

外观 Advanced 弹窗 浅色
外观 Advanced 弹窗 深色

Bot 网络 → Advanced 弹窗:

Bot 网络 Advanced 弹窗

Bot 详情左上角 Bot 卡片(放大 2 倍):

Bot 卡片内边距

语音服务商、视频服务商模型区标题栏:

语音服务商模型区
视频服务商模型区

App 详情依赖列表(深色):

App 依赖列表 深色

组件墙上的 SettingsList / SettingsBleed 示例(浅色、深色):

新原语示例

Human QA

  • Human QA passed

配合 @felinic/ui 的职责拆分(卡片外壳提供左右缩进,列表提供行节奏,行只排
内容),更新 packages/ui 子模块并迁移页面:

- 删除卡片内约 30 处手写的 px-4 / mx-4,p-N 改为 py-N,左右留白交给卡片;
- 外观 Advanced 弹窗去掉不生效的 mx-0 min-h-0 py-0 覆盖,修复
  "Examples in sidebar" 比 "Code highlight" 多缩进 16px;
- Bot 网络 Advanced 弹窗改用 SettingsList,修复同类的多缩进;
- 压缩日志表格与分页、模型列表分页、记忆图谱画布改用 SettingsBleed 贴边;
- 视频服务商模型区、App 详情依赖列表改用 SettingsSection,后者顺带去掉
  一处双分割线;
- 转写服务商去掉自包的工具区包装,由 SettingsSection #actions 统一处理;
- 窄屏 provider-configuration 规则改按 data-settings-row 匹配行;
- 组件墙新增 SettingsList / SettingsBleed 示例。

Linear: MEMOH-269
About 身份卡是自由排版的内容而不是设置行列表,不应套用设置卡片的行缩进
(左右 16px 加自身上下 20px 会四边不等距)。抽成页面私有组件
about-identity-card.vue,外壳改用 SurfaceCard 自带的四边 20px 内边距,外观与
改动前一致。

模板原样搬移,仅 displayVersion 改为 prop version,资源链接数据随组件迁移。
UI 契约守卫的遗留计数按文件记录,随代码一并转到新文件(px 8 → 页面 2 +
组件 6,alpha 2 → 1 + 1),总量不变。

Linear: MEMOH-269
@github-actions github-actions Bot added bug Fixes a bug or unexpected behavior change:web Changes web frontend or shared frontend packages size:S PR size uses the larger of added or deleted lines, excluding generated files labels Nov 5, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-05T08:10:50.780866Z cd67ed2 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cd67ed26bd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

<div
v-if="oauthStatusLoading && !oauthStatus"
class="mx-4 flex min-h-[3.75rem] items-center justify-center py-3"
class="flex min-h-[3.75rem] items-center justify-center py-3"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Complete the OAuth block inset migration

When a saved remote MCP server requires manually supplied OAuth credentials, the block at mcp-server-detail.vue:340 still has mx-4. Since the updated SettingsSection supplies the horizontal inset itself, those fields now receive twice the inset of the authorization row above them, reducing their available width and breaking alignment. The pending device-code block in providers/components/provider-form.vue:338 retains the same obsolete margin. Remove these remaining margins as part of the migration so the card remains the single spacing owner, consistent with M2 in the frontend rules required by apps/web/AGENTS.md.

AGENTS.md reference: apps/web/AGENTS.md:L9-L9

Useful? React with 👍 / 👎.

@github-actions github-actions Bot added the needs:format Description needs template corrections; removed automatically once fixed label Nov 5, 2026
@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Format check passed; removed needs:format.

卡片外壳已统一提供左右缩进,这三处仍手写 mx-4,会比上下行多缩进 16px。
同步更新两条仍描述旧缩进来源的注释。
@github-actions github-actions Bot removed the needs:format Description needs template corrections; removed automatically once fixed label Nov 5, 2026
渠道设置的高级弹窗把字段行直接放在弹窗正文里,行节奏改由列表提供后,
这些行失去行高、上下留白和分隔线;与 Bot 网络高级弹窗一样包进 SettingsList。
新手引导第 3 步的模型行放在普通网格里,没有卡片外壳提供缩进,由调用处保留
原来的左右 16px。子模块指针更新到包含文档更正的提交。
@qqqqqf-q
qqqqqf-q merged commit 2af6050 into felinics:main Nov 6, 2026
22 checks passed
@qqqqqf-q qqqqqf-q mentioned this pull request Nov 12, 2026
2 of 6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Fixes a bug or unexpected behavior change:web Changes web frontend or shared frontend packages size:S PR size uses the larger of added or deleted lines, excluding generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant