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
|
pnpm dev # → http://127.0.0.1:5173
|
||||||
|
|
||||||
# tests
|
# tests
|
||||||
pnpm test # vitest, 18 tests across api, live,
|
pnpm test # vitest, 22 tests across api, live,
|
||||||
# synthetic, layout
|
# synthetic, layout, store
|
||||||
|
|
||||||
# build
|
# build
|
||||||
pnpm build # tsc + vite, single chunk ~225 KB gz
|
pnpm build # tsc + vite, single chunk ~225 KB gz
|
||||||
|
|
||||||
# end-to-end smoke + screenshots
|
# end-to-end smoke + screenshots
|
||||||
pnpm qa:smoke # playwright headless, 26 assertions
|
pnpm qa:smoke # playwright headless, 28 assertions
|
||||||
|
|
||||||
# DOM layout audit
|
# DOM layout audit
|
||||||
pnpm qa:layout
|
pnpm qa:layout
|
||||||
|
|||||||
@ -83,14 +83,15 @@ async function runLiveFetch(
|
|||||||
const { scenarios, workItems, distinctDefs } = await buildLiveScenariosFromApi();
|
const { scenarios, workItems, distinctDefs } = await buildLiveScenariosFromApi();
|
||||||
const merged = [...scenarios, ...syntheticScenarios];
|
const merged = [...scenarios, ...syntheticScenarios];
|
||||||
const first = merged[0];
|
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({
|
set({
|
||||||
scenarios: merged,
|
scenarios: merged,
|
||||||
liveTotals: { workItems: workItems.length, distinctDefs },
|
liveTotals: { workItems: workItems.length, distinctDefs },
|
||||||
liveFetchedAt: Date.now(),
|
liveFetchedAt: Date.now(),
|
||||||
liveLoading: false,
|
liveLoading: false,
|
||||||
scenarioId: keepCurrent ? get().scenarioId : first?.id ?? get().scenarioId,
|
scenarioId: stillThere ? currentId : first?.id ?? currentId,
|
||||||
selectedStepId: keepCurrent ? get().selectedStepId : first?.defaultStepId ?? null,
|
selectedStepId: stillThere ? get().selectedStepId : first?.defaultStepId ?? null,
|
||||||
});
|
});
|
||||||
get().pushToast(
|
get().pushToast(
|
||||||
"ok",
|
"ok",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user