Repository navigation
fix: 修复微信渠道保存按钮冗余、成员表溢出与零值时间、Bot切换器跳动及选择器截断 - #1808
Conversation
…e, polish bot switcher, identity settings, and selects
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Format check passed; removed |
There was a problem hiding this comment.
💡 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".
| await putBotsById({ | ||
| path: { id: targetBotId }, | ||
| body: { avatar_url: nextUrl.trim() || undefined }, |
There was a problem hiding this comment.
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 👍 / 👎.
| if (savedKeys.has('name') || savedKeys.has('display_name') || savedKeys.has('timezone')) { | ||
| queryCache.invalidateQueries({ key: ['bot', targetBotId] }) |
There was a problem hiding this comment.
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 👍 / 👎.
| const isUnavailableSelection = computed(() => | ||
| Boolean(selected.value && !selectedOption.value && (props.options.length > 0 || UUID_RE.test(selected.value))), | ||
| ) |
There was a problem hiding this comment.
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 👍 / 👎.
| registerBotBreadcrumbName(targetBotId, targetDisplayName) | ||
| const routeBot = String(route.params.botName ?? '').trim() | ||
| if (routeBot) registerBotBreadcrumbName(routeBot, targetDisplayName) |
There was a problem hiding this comment.
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 👍 / 👎.
Author
Type
Summary
修复 5 项设置、侧栏导航与选择器的视觉及交互功能缺陷(均为全站 UX/UI 盲测确认的非无障碍真实问题,纯无障碍条目另行单独修复):
apps/web/src/pages/bots/components/channel-settings-panel.vue在channelItem.meta.type === 'weixin'时隐藏“保存设置”按钮与未保存提示(保留编辑态启用/禁用切换),避免扫码配对渠道出现不可用保存按钮。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”。apps/web/src/components/sidebar/bot-switcher.vue仅在列表尚无数据时展示底部加载指示器(isLoading && displayBots.length === 0),避免后台刷新造成菜单高度跳动;使菜单宽度随触发器宽度自适应对齐(min-w-60+--reka-dropdown-menu-trigger-width);并统一复用avatarInitials两位缩写规则。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-settings.vue的重复入口)。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 commitpre-commit hook(eslint --fix)通过http://127.0.0.1:8096代理本地 OSS 后端18080/18081):确认Bot 设置 → 通用顶部仅保留URL Name与Timezone,无重复身份卡片。origin/main909d96a56基线):mise run lint:settings-rows(327 components)、全量pnpm vitest run(304 files, 2863 passed | 1 skipped)及BotSwitcher、微信扫码页、团队成员表与Files顶栏触屏/聚焦浏览器验证均通过。Screenshots / Recordings
Human QA