Skip to content

fix: 修复微信渠道保存按钮冗余、成员表溢出与零值时间、Bot切换器跳动及选择器截断 - #1808

Merged
qqqqqf-q merged 2 commits into
felinics:mainfrom
qqqqqf-q:fix/memoh-304-channels-people-bots-select
Nov 19, 2026
Merged

qqqqqf-q merged 2 commits into
felinics:mainfrom
qqqqqf-q:fix/memoh-304-channels-people-bots-select

Conversation

@qqqqqf-q

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

Copy link
Copy Markdown
Member

Author

  • Human
  • Agent

Type

  • bug
  • feat
  • test

Summary

修复 5 项设置、侧栏导航与选择器的视觉及交互功能缺陷(均为全站 UX/UI 盲测确认的非无障碍真实问题,纯无障碍条目另行单独修复):

  1. 微信渠道隐藏无效保存按钮(B-05):apps/web/src/pages/bots/components/channel-settings-panel.vue 在 channelItem.meta.type === 'weixin' 时隐藏“保存设置”按钮与未保存提示(保留编辑态启用/禁用切换),避免扫码配对渠道出现不可用保存按钮。
  2. 成员表桌面端溢出与 Go 零值时间兜底(B-06):
    • apps/web/src/utils/date-time.ts:识别 0001-01-01T00:00:00Z 等 UTCFullYear <= 1 的 Go 零值时间为未设置状态,返回 options.fallback 而非格式化成 1/1/1(保留非法日期字符串的 invalidFallback 行为)。
    • apps/web/src/pages/people/index.vue:使用 PageShell width="lg"、限制成员身份列 max-w-64 截断并传入当前 locale,保证 1440x900 桌面端 5 列完整可见、无横向裁切,且未登录成员正常显示本地化“从未登录 / Never”。
  3. Bot 切换器加载跳动、菜单宽度对齐与缩写统一(B-08 视觉部分):apps/web/src/components/sidebar/bot-switcher.vue 仅在列表尚无数据时展示底部加载指示器(isLoading && displayBots.length === 0),避免后台刷新造成菜单高度跳动;使菜单宽度随触发器宽度自适应对齐(min-w-60 + --reka-dropdown-menu-trigger-width);并统一复用 avatarInitials 两位缩写规则。
  4. 悬停操作按钮触屏与聚焦可见性(B-10 触屏与聚焦部分):
    • apps/web/src/pages/bots/detail.vue、apps/web/src/pages/bots/new.vue、apps/web/src/components/sidebar/files-pane.vue:为原本仅 :hover 可见的头像编辑、Bot 名称编辑及工作区 文件 面板顶栏操作按钮补充 focus-visible:opacity-100 / group-focus-within:opacity-100 与 pointer-coarse:opacity-100,保障键盘聚焦与触屏环境可见可用。
    • 按评审结论保留左侧 Bot 卡片作为头像与显示名的唯一编辑入口,Bot 设置 → 通用 不再重复添加第二份身份卡片(已撤回早先 bot-settings.vue 的重复入口)。
  5. 模型/选项选择器单行截断与孤儿 UUID 兜底(B-12 视觉部分):apps/web/src/components/searchable-select-popover/index.vue、apps/web/src/pages/bots/components/model-select.vue 与 apps/web/src/i18n/locales/{en,zh,ja}.json 将触发器文本由 line-clamp-1 改为 min-w-0 flex-1 truncate text-left,并在选中值已不在候选列表中或为孤儿 UUID 时回显本地化“不可用 / Unavailable / 利用不可”提示文案。

Related Issues

Validation

以下均在最新提交工作树通过实际运行验证(非真人人工 QA):

  • 最新提交后检查(wt-pr1808):
    • node scripts/check-ui-contract.mjs: 通过(✓ UI contract OK (3 warning(s)),均与本次改动无关)
    • pnpm --filter @memohai/web typecheck && pnpm --filter @memohai/desktop typecheck: 通过(0 错误)
    • pnpm --filter @memohai/web exec eslint(本 PR 修改的 .vue / .ts 文件): 通过(0 错误)
    • pnpm --filter @memohai/web exec vitest run src/pages/bots/components/bot-isolation-and-guards.test.ts src/utils/date-time.test.ts src/components/sidebar/bot-switcher-list.test.ts src/pages/bots/components/channel-settings-panel.test.ts: 通过(4 个测试文件,33 个用例全部通过)
    • git commit pre-commit hook(eslint --fix)通过
  • 合并预览环境复核(http://127.0.0.1:8096 代理本地 OSS 后端 18080/18081):确认 Bot 设置 → 通用 顶部仅保留 URL Name 与 Timezone,无重复身份卡片。
  • 初版全量验证记录(origin/main 909d96a56 基线):mise run lint:settings-rows(327 components)、全量 pnpm vitest run(304 files, 2863 passed | 1 skipped)及 BotSwitcher、微信扫码页、团队成员表与 Files 顶栏触屏/聚焦浏览器验证均通过。

Screenshots / Recordings

Bot 切换器统一两位缩写并消除后台重取高度跳动

微信渠道扫码配对页隐藏无效保存设置按钮

团队成员表 5 列完整可见且零值登录时间显示从未登录

工作区文件面板顶栏操作在键盘聚焦与粗指针下可见

Human QA

  • Human QA passed

…e, polish bot switcher, identity settings, and selects
@chatgpt-codex-connector

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

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T08:21:27.719463Z 7f115bc 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.

@github-actions github-actions Bot added bug Fixes a bug or unexpected behavior change:web Changes web frontend or shared frontend packages needs:format Description needs template corrections; removed automatically once fixed size:S PR size uses the larger of added or deleted lines, excluding generated files labels Nov 18, 2026
@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Format check passed; removed needs:format.

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

@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: 7f115bc1a7

ℹ️ 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".

Comment on lines +527 to +529
await putBotsById({
path: { id: targetBotId },
body: { avatar_url: nextUrl.trim() || undefined },

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 Serialize avatar updates with the existing profile autosaves

If a display-name or timezone autosave is still pending when the avatar dialog is confirmed, this watcher starts another profile PUT outside useAutosaveQueue. prepareUpdateParams in internal/bots/service.go reads the existing profile and builds a whole-profile update, so overlapping requests can read the same old row and overwrite each other's changes despite both succeeding. The queue explicitly serializes saves to prevent this. Route the new avatar updates through the same serialization mechanism.

Useful? React with 👍 / 👎.

Comment on lines 750 to 751
if (savedKeys.has('name') || savedKeys.has('display_name') || savedKeys.has('timezone')) {
queryCache.invalidateQueries({ key: ['bot', targetBotId] })

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 Invalidate slug-keyed bot queries after saving the display name

When settings are opened through a bot card, the route uses the bot's slug, and detail.vue subscribes to ['bot', slug]; this tab instead receives the canonical UUID. Consequently, this invalidation refreshes the tab's UUID-keyed query but leaves the parent identity header displaying the old name, even while the settings field, sidebar, and breadcrumb show the saved name. chatStore.refreshBots() only refreshes its list and does not repair that query. Invalidate both target aliases or the ['bot'] prefix, consistent with the M3 affected-cache invalidation rule required by apps/web/AGENTS.md.

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

Useful? React with 👍 / 👎.

Comment on lines +218 to 220
const isUnavailableSelection = computed(() =>
Boolean(selected.value && !selectedOption.value && (props.options.length > 0 || UUID_RE.test(selected.value))),
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve valid timezones missing from the option catalog

For accounts using the default UTC timezone, this condition now makes the profile timezone selector display “Unavailable” instead of UTC. TimezoneSelect builds its options from Intl.supportedValuesOf('timeZone') in utils/timezones.ts, which omits UTC and valid aliases such as Etc/UTC even though they are accepted timezone values. The shared selector cannot assume every options array is exhaustive; preserve valid current timezone values in that owner or make unavailable-state handling opt-in for exhaustive catalogs.

Useful? React with 👍 / 👎.

Comment on lines +670 to +672
registerBotBreadcrumbName(targetBotId, targetDisplayName)
const routeBot = String(route.params.botName ?? '').trim()
if (routeBot) registerBotBreadcrumbName(routeBot, targetDisplayName)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Capture the target route before awaiting the rename

If bot A's display-name autosave completes after the user has navigated to bot B, route.params.botName now identifies B. This callback consequently registers A's new name under B's breadcrumb key, making B's breadcrumb/back label show A's name. The request correctly captures targetBotId, but these post-save side effects read the mutable current route. Capture the target route identifier before starting the request and update only aliases belonging to that target.

Useful? React with 👍 / 👎.

@qqqqqf-q
qqqqqf-q merged commit d712148 into felinics:main Nov 19, 2026
15 checks passed
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