docs+store: oracle r3 follow-ups
- 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:
parent
e3b4ed62c0
commit
2e0e4c08e8
@ -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
|
||||
|
||||
@ -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",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user