Models cards say which test and save their note refers to - #708
Merged
WaylandYang merged 3 commits intoSep 14, 2026
Merged
WaylandYang merged 3 commits into
WaylandYang merged 3 commits into
Conversation
Signed-off-by: Aniruddha Adak <aniruddhaadak80@users.noreply.github.com>
aniruddhaadak80
force-pushed
the
fix/models-test-and-save-feedback
branch
from
September 14, 2026 15:57
131412e to
899d347
Compare
…ed one Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: WaylandYang <wayland0916@gmail.com>
Contributor
|
@aniruddhaadak80 thanks, this makes the cards much clearer. I checked it in the browser against a real endpoint:
One gap from #698 remained, so I pushed a commit to your branch before merging (6b1ecd9): Test always checks the saved configuration. Items 2 and 3 in the issue are exactly that case. You type a new key, press Test and see the old key's "Reachable"; or the embedding fields are filled but unsaved and the card says "Not configured". Now:
🤖 Generated with Claude Code |
Merged
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.
On Administration → Models, the cards make it hard to tell whether the configuration was saved, which card is being tested, and whether the connection succeeded or failed (#698). Three defects, all still present on
dev:testmutation, so pressing either one puts both buttons into "Testing…".text-accenton both cards; chat errors rendertext-dangerwhile embed errors render body-tonetext-ink-2— unlike the Data sources section in the same file, which usestext-ok/text-danger.A transport-level test failure (request never reaches the endpoint) additionally showed nothing at all: the note silently fell back to the old save state.
What changed (
web/src/pages/Settings.tsx)testCardstate: "Testing…" lights up only on the card whose button was pressed. Results still return to their respective cards (one endpoint tests both).modelCardStatus(pure, exported): one precedence table for both cards — fresh test result (including a transport failure) beats save error beats "Saved" beats silence — returning thetext-ok/text-dangertone with the note.Fixes #698
Verification
web/src/pages/Settings.test.ts(5 tests): fresh result beats stale "Saved", failed test beats save state, transport failure surfaces instead of going quiet, save error/confirmation preserved when untested, silence when idle. Each assertion contradicts the previous rendering (old tones weretext-accent/text-ink-2, old transport failures fell back to save state).pnpm vitest run: 11 files, 56 tests, all pass (51 pre-existing + 5 new).pnpm typecheck(tsc --noEmit),pnpm guard(style guard: 80 files compliant), andpnpm build(style-guard + typecheck + vite) all green locally — i.e. the fullwebCI job reproduced.Notes / trade-offs
"Not configured"/"Empty response"strings are still displayed verbatim on failure; localizing them would mean matching on backend message text across the API boundary, which is brittle — leaving that as a possible follow-up.ok/dangersemantic tones rather than introducing new ones.After review (6b1ecd9)
Test checks the saved configuration, so a card with unsaved edits now says "Unsaved changes. Save this card to test them." and disables its Test button until saved. This covers #698 items 2 and 3: an edited key tested against the old one, and filled but unsaved fields reported as "Not configured". Checked in the browser against a real endpoint: