Skip to content

feat(cowork): improve model setup entry and preserve draft input#1693

Open
leedalei wants to merge 3 commits into
netease-youdao:mainfrom
leedalei:codex/model-selector-settings-entry
Open

feat(cowork): improve model setup entry and preserve draft input#1693
leedalei wants to merge 3 commits into
netease-youdao:mainfrom
leedalei:codex/model-selector-settings-entry

Conversation

@leedalei

Copy link
Copy Markdown
Contributor

Summary

优化 ModelSelector 组件交互体验,并修复未配置模型时发送消息导致输入内容丢失的问题。

此前用户未配置模型时,ModelSelector 仅显示不可交互的提示文字,用户需自行寻找设置入口,路径长且不直观;同时若直接点击发送,输入内容会被意外清空,造成内容丢失。本 PR 将提示区域改为一键直达模型设置页的按钮,并修复输入丢失 bug,显著降低新用户上手门槛,避免因操作受挫而流失。

Changes Made

feat: ModelSelector 无模型时点击跳转设置页

  • 新增 SettingsContext,通过 Context 向组件树暴露 openSettings 方法
  • ModelSelector 在无可用模型时,将静态文本替换为可点击按钮,点击后打开设置页的模型 Tab
  • App.tsx 顶层包裹 SettingsProvider

fix: 未配置模型时发送消息不再清空输入框

  • CoworkViewhandleSend 在 API 配置检查失败时返回 false,阻止调用方清空输入内容

chore: 补充 cherry-pick 后的 import 排序修复

  • 调整 App.tsx import 排序,确保本次涉及文件通过 focused eslint 校验

Validation

  • npx eslint src/renderer/App.tsx src/renderer/components/ModelSelector.tsx src/renderer/contexts/SettingsContext.tsx src/renderer/components/cowork/CoworkView.tsx
  • npm run lint 仍因仓库内既有的全局 lint 问题失败(与本 PR 无关)

leelei added 3 commits April 15, 2026 14:56
Add SettingsContext to expose openSettings across the component tree.
ModelSelector now opens the model settings tab when clicked with no available models instead of showing a static label.
…ured

Return false instead of void from handleStartSession when API config check fails, so the caller knows the send was unsuccessful and does not clear the input field.
@github-actions

Copy link
Copy Markdown

This pull request has been inactive for 30 days. It will be automatically closed in 14 days unless there is new activity.

If you're still working on this, please leave a comment or push new commits to keep it open. Thank you!

@github-actions github-actions Bot added the stale label May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant