Repository navigation
[bugfix] providers: keep each model's capability check on one line #604
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Zhangbo-cn
wants to merge
11
commits into
ThinkFlowLab:main
Choose a base branch
from
Zhangbo-cn:feat/model-capability-row
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+371
−96
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
4a9f643
feat(models): keep service capability detail folded in the service form
Zhangbo-cn 62174e8
[bugfix] providers: keep each model's capability check on one line
Zhangbo-cn 7510d13
refactor(providers): drop the unused draft check wrapper and its dead…
Zhangbo-cn 532c527
Merge remote-tracking branch 'origin/main' into feat/model-capability…
Zhangbo-cn fe1e912
ci: retrigger after a publication-lock timeout in the python lane
Zhangbo-cn 22030fb
Merge remote-tracking branch 'origin/main' into feat/model-capability…
Zhangbo-cn 19f0789
Merge remote-tracking branch 'origin/main' into feat/model-capability…
Zhangbo-cn a17a9d6
fix(providers): fold the capability detail and keep one check entry p…
Zhangbo-cn 9a1a14a
test(providers): target the row summary, not the card's inner summary
Zhangbo-cn 896a191
test(providers): open the row fold before reading the capability card
Zhangbo-cn e7974b3
ci: retrigger the real-CLI worker after a timeout
Zhangbo-cn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| import type { ReactNode } from "react"; | ||
| import type { ModelConfigInput } from "../backend/models.ts"; | ||
| import { useT } from "../i18n/I18nProvider"; | ||
| import { useDraftAvailability } from "./DraftAvailabilityCheck"; | ||
| import { ModelAvailabilityCard } from "./ModelAvailabilityCard"; | ||
|
|
||
| /** One model row of the service form. | ||
| * | ||
| * The check action sits on the model line: it offers the check until the | ||
| * service answers, then reports the result. Everything else — chips, input | ||
| * rules, the per-kind parameters — stays folded behind one summary, so a list | ||
| * of selected models keeps one line per model until the row is opened. | ||
| */ | ||
| export function ModelRowDetails({ | ||
| modelId, | ||
| connection, | ||
| configId, | ||
| children, | ||
| }: { | ||
| modelId: string; | ||
| connection: ModelConfigInput; | ||
| configId?: string; | ||
| children: ReactNode; | ||
| }) { | ||
| const t = useT(); | ||
| const draft = useDraftAvailability({ connection, configId, modelId }); | ||
| // Chat rows already carry the picker's own connection test. | ||
| const showTest = connection.kind !== "agent"; | ||
| return ( | ||
| <> | ||
| {showTest && ( | ||
| <button | ||
| type="button" | ||
| className="cw-settings-button cw-settings-button-quiet cw-model-row-test" | ||
| disabled={draft.checking} | ||
| aria-busy={draft.checking || undefined} | ||
| onClick={draft.check} | ||
| > | ||
| {t( | ||
| draft.checking | ||
| ? "availability.checking" | ||
| : draft.error | ||
| ? "availability.reason.query_failed" | ||
| : draft.value | ||
| ? "availability.rowTested" | ||
| : "availability.rowTest", | ||
| )} | ||
| </button> | ||
| )} | ||
| <details className="cw-model-row-details"> | ||
| <summary>{t("models.service.capabilityDetails")}</summary> | ||
| <ModelAvailabilityCard | ||
| value={draft.value} | ||
| checking={draft.checking} | ||
| error={draft.error} | ||
| actions={false} | ||
| /> | ||
| {children} | ||
| </details> | ||
| </> | ||
| ); | ||
| } | ||
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
收起后这里会把所有拿到回执的非 Chat 模型都显示成「已测试」,即使三项能力都不支持或结果未知;耗时也没显示。这样用户还是得逐行展开才能看 #574 要的测试结果。能否从现有检查回执导出一个简短的行内结果(含耗时,拿不到就明确不显示),再补一个「保持折叠时通过/失败可区分」的浏览器断言?