docs+store: oracle r3 follow-ups
Some checks failed
build-and-publish / test (push) Has been cancelled
build-and-publish / image (push) Has been cancelled

- README test/smoke counts: 18→22, 26→28 (drifted across rounds)
- runLiveFetch keepCurrent now checks the MERGED catalog, not the old
  state — fixes the edge case where a scenarioId disappears between
  refreshes (would have orphaned the active scenario)

Constraint: no test changes; pure cleanup
Confidence: high
Scope-risk: narrow
This commit is contained in:
Shad 2026-06-14 00:30:57 +04:00
parent e3b4ed62c0
commit 2e0e4c08e8
2 changed files with 7 additions and 6 deletions

View File

@ -95,14 +95,14 @@ pnpm fetch:scenarios
pnpm dev # → http://127.0.0.1:5173
# tests
pnpm test # vitest, 18 tests across api, live,
# synthetic, layout
pnpm test # vitest, 22 tests across api, live,
# synthetic, layout, store
# build
pnpm build # tsc + vite, single chunk ~225 KB gz
# end-to-end smoke + screenshots
pnpm qa:smoke # playwright headless, 26 assertions
pnpm qa:smoke # playwright headless, 28 assertions
# DOM layout audit
pnpm qa:layout

View File

@ -83,14 +83,15 @@ async function runLiveFetch(
const { scenarios, workItems, distinctDefs } = await buildLiveScenariosFromApi();
const merged = [...scenarios, ...syntheticScenarios];
const first = merged[0];
const keepCurrent = get().scenarios.some((s) => s.id === get().scenarioId);
const currentId = get().scenarioId;
const stillThere = merged.find((s) => s.id === currentId);
set({
scenarios: merged,
liveTotals: { workItems: workItems.length, distinctDefs },
liveFetchedAt: Date.now(),
liveLoading: false,
scenarioId: keepCurrent ? get().scenarioId : first?.id ?? get().scenarioId,
selectedStepId: keepCurrent ? get().selectedStepId : first?.defaultStepId ?? null,
scenarioId: stillThere ? currentId : first?.id ?? currentId,
selectedStepId: stillThere ? get().selectedStepId : first?.defaultStepId ?? null,
});
get().pushToast(
"ok",