Skip to content

fix(setting-model): keep newly saved instance card expanded after name save - #16904

Merged
wangq8 merged 1 commit into
infiniflow:mainfrom
dcc123456:fix/model-provider-0714
Jul 14, 2026
Merged

wangq8 merged 1 commit into
infiniflow:mainfrom
dcc123456:fix/model-provider-0714

Conversation

@dcc123456

Copy link
Copy Markdown
Collaborator

Summary

fix(setting-model): keep newly saved instance card expanded after name save

@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. 🐞 bug Something isn't working, pull request that fix bug. 🧰 typescript Pull requests that update Typescript code labels Jul 14, 2026
@dcc123456
dcc123456 requested a review from wangq8 July 14, 2026 08:36
@dcc123456 dcc123456 added the ci Continue Integration label Jul 14, 2026
@dcc123456
dcc123456 marked this pull request as draft July 14, 2026 08:36
@dcc123456
dcc123456 marked this pull request as ready for review July 14, 2026 08:36
@coderabbitai

coderabbitai Bot commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

SettingModelV2 now receives saved instance names from draft save flows, stores the latest name, and expands the matching persisted provider card. The saved-name state resets when the provider selection changes.

Changes

Saved instance expansion

Layer / File(s) Summary
Save-name callback contract
web/src/pages/user-setting/setting-model/instance-card/interface.ts, web/src/pages/user-setting/setting-model/instance-card/hooks.tsx, web/src/pages/user-setting/setting-model/instance-card/*-instance-card.tsx
onNameSaved now receives the trimmed instance name after successful draft name persistence.
Parent expansion state
web/src/pages/user-setting/setting-model/index.tsx
SettingModelV2 stores the latest saved name, clears it on selection changes, and opens the matching persisted card while preserving first-card expansion.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant InstanceCard
  participant SaveHook
  participant ProviderAPI
  participant SettingModelV2
  InstanceCard->>SaveHook: save trimmed instance name
  SaveHook->>ProviderAPI: add provider instance
  ProviderAPI-->>SaveHook: successful response
  SaveHook-->>SettingModelV2: onNameSaved(instanceName)
  SettingModelV2-->>InstanceCard: expand matching persisted card
Loading

Suggested reviewers: wangq8, jinhai-cn

Poem

I saved a name, said Bunny bright,
The matching card now opens right.
Old drafts hop away from view,
New names guide the UI through.
Sniff sniff! What a tidy delight!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title matches the main change and is concise and specific.
Description check ✅ Passed The description includes the required Summary section and states the PR's goal, though it is brief.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.16%. Comparing base (654fc88) to head (04b6515).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #16904   +/-   ##
=======================================
  Coverage   93.16%   93.16%           
=======================================
  Files          10       10           
  Lines         717      717           
  Branches      118      118           
=======================================
  Hits          668      668           
  Misses         29       29           
  Partials       20       20           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@wangq8
wangq8 merged commit 376a905 into infiniflow:main Jul 14, 2026
15 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞 bug Something isn't working, pull request that fix bug. ci Continue Integration size:M This PR changes 30-99 lines, ignoring generated files. 🧰 typescript Pull requests that update Typescript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants