Skip to content

[GUI] Open on the models this computer already has, not a false setup screen - #4462

Closed
xvcezrqpbxtpzblrt wants to merge 1 commit into
Niko1221:mainfrom
xvcezrqpbxtpzblrt:gui/models-first-screen-027
Closed

xvcezrqpbxtpzblrt wants to merge 1 commit into
Niko1221:mainfrom
xvcezrqpbxtpzblrt:gui/models-first-screen-027

Conversation

@xvcezrqpbxtpzblrt

Copy link
Copy Markdown
Contributor

Problem

Every start opened the Models page on a screen that was not true:

  • "Set up Strata / Connect engine" — for a computer that has the engine and a model;
  • "this installation reports no supported graphics card" — for a PC with an RTX card.

A few seconds later the page jumped to the installed model. The cause is in the host: its first snapshot says available: false with the sentence "Connect a local Strata installation" before it has read anything, and the first read of the installation can take many seconds (measured here: the first /api/native answer came after about 30 s on a cold start). The page could not tell "not read yet" from "nothing installed", so it rendered the setup state.

Result

  • The host's snapshot says checking: true until the first look at the installation ends; available: false before that no longer claims "nothing is installed".
  • The last good snapshot is written to native-snapshot.json (only when it changes) and loaded at the next start, so the page opens on the models this computer already has while the fresh read runs behind it. A model deleted outside Strata disappears when that read ends.
  • The Models page: with a known snapshot it renders at once; without one it says "Loading your models and settings…" instead of offering setup; the setup card appears only when the host is really offline or the read says there is no engine.

Validation

  • Before: a poll of /api/native right after start returned nothing for 30 s, and the Models page showed the setup card for that time.
  • Without a cache (first start after install): the page shows "正在加载模型和设置…" from the first frame, never the setup card, until the read ends. Screen captured.
  • With the cache (next start): the Models page shows "Swift IQ3_XXS 已下载" at the first check, and the context/KV settle to 512K / K8V4 as the stored settings are applied. Screen captured.
  • npm run typecheck clean; node --test tests/packaged-control.test.mjs tests/ui4-fixes.test.mjs → 33 pass, 0 fail.

Limits

  • The cached snapshot is a few seconds old at most on a normal start; a model deleted while Strata was closed is shown briefly and then removed by the read.
  • The first run after a fresh install has no cache: it shows the loading line for as long as the first read takes (about 6 s warm, 30 s cold on this PC). Shortening that read is a separate change.
  • Only the Models page is gated; other screens still update their own native figures when the read ends.

@xvcezrqpbxtpzblrt

Copy link
Copy Markdown
Contributor Author

Superseded by #4606, which carries this change with the rest of the 0.2.7 branch. Closing so the review has one place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant