feat(cowork): improve model setup entry and preserve draft input#1693
Open
leedalei wants to merge 3 commits into
Open
feat(cowork): improve model setup entry and preserve draft input#1693leedalei wants to merge 3 commits into
leedalei wants to merge 3 commits into
Conversation
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.
|
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! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
优化
ModelSelector组件交互体验,并修复未配置模型时发送消息导致输入内容丢失的问题。此前用户未配置模型时,
ModelSelector仅显示不可交互的提示文字,用户需自行寻找设置入口,路径长且不直观;同时若直接点击发送,输入内容会被意外清空,造成内容丢失。本 PR 将提示区域改为一键直达模型设置页的按钮,并修复输入丢失 bug,显著降低新用户上手门槛,避免因操作受挫而流失。Changes Made
feat: ModelSelector 无模型时点击跳转设置页
SettingsContext,通过 Context 向组件树暴露openSettings方法ModelSelector在无可用模型时,将静态文本替换为可点击按钮,点击后打开设置页的模型 TabApp.tsx顶层包裹SettingsProviderfix: 未配置模型时发送消息不再清空输入框
CoworkView中handleSend在 API 配置检查失败时返回false,阻止调用方清空输入内容chore: 补充 cherry-pick 后的 import 排序修复
App.tsximport 排序,确保本次涉及文件通过 focused eslint 校验Validation
npx eslint src/renderer/App.tsx src/renderer/components/ModelSelector.tsx src/renderer/contexts/SettingsContext.tsx src/renderer/components/cowork/CoworkView.tsxnpm run lint仍因仓库内既有的全局 lint 问题失败(与本 PR 无关)