Skip to content

feat(composer): 新聊天沿用上次模型并优先显示最近三项 - #1412

Merged
vastsa merged 4 commits into
vastsa:mainfrom
zszz3:codex/feat-recent-model-selection
Oct 4, 2026
Merged

vastsa merged 4 commits into
vastsa:mainfrom
zszz3:codex/feat-recent-model-selection

Conversation

@zszz3

@zszz3 zszz3 commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

新聊天沿用上次实际发送消息时使用的可用模型,已有聊天保留自己的模型。打开旧聊天、只切换模型或调整推理等级不会更新记录;消息提交被接受后才更新,提交失败不更新。

模型菜单顶部直接搜索全部可用模型,下面显示最近使用的 3 项,其他模型按服务商原地展开。最近项不会在展开列表里重复出现,没有历史时直接展示全部模型。设置页的聊天默认模型选择器和“设为默认”入口移除,图片模型设置保持独立。

记录保存在本机,重启后恢复,不参与跨设备同步。失效模型会被跳过;首次使用先沿用有效的兼容默认配置,否则选第一个可用聊天模型。兼容默认字段仍供定时任务等消费者使用,无数据库迁移。

验证:

  • 行为提交 4a0c4991500c 包含主线 abfeeb21852e,桌面 3,515 项测试、i18n 29 项测试、类型检查、生产构建及静态检查通过。
  • 真实 store 流程覆盖选模型但不发送、提交成功与失败、打开旧聊天、旧聊天发送、新聊天继承和重启后恢复。
  • 隔离 Electron E2E 覆盖最近三项、直接搜索和回车选择、原地展开去重、无历史列表及推理等级保留。
  • 字体修正 4c9efb3fd 的 Electron 检查确认最近项与展开项字号、字重一致;修复前分别为 13px 和 12px,修复后均为 12px。
  • 焦点修正 50b0e9c46 通过 32 项相关测试及 Electron 回归:鼠标移到其他模型、搜索失焦时清除旧键盘高亮,方向键选择仍可用。
  • 本地应用已完整重启,确认新版菜单可见;自动测试未调用真实模型 API。

类型为 feat。仓库当前外部贡献范围限于 fix / perf,此功能是否接受需由维护者决定。

zszz3 added 3 commits October 5, 2026 01:56
Keep the latest usable model selection across new chats and restarts,
while preserving each existing conversation binding. Expose three recent
provider/model pairs directly in the composer menu.

Remove the fixed chat-default settings controls without changing legacy
settings used by scheduled jobs or the independent image model selection.
Cover persistence, unavailable bindings and model menu interactions.
Only accepted messages update model history, so opening an old chat or
browsing model choices cannot change the next chat's inherited model.
Keep search and recent choices together, with other models expanded inline.
Recent entries missed the shared model group styles and rendered larger
than the expanded catalog. Reuse that group and check computed typography
in the Electron interaction test.
Comment thread apps/desktop/src/stores/slices/session-slice.ts Outdated
Pointer hover must not leave a model marked as the keyboard target after
moving to the inline disclosure. Clear the keyboard cursor on pointer
movement and when search loses focus, preserving native hover feedback.
@vastsa
vastsa merged commit 9eebc66 into vastsa:main Oct 4, 2026
4 checks passed
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