← Model losses

Head-to-head comparison

openai / gpt-6.1-sol / low / low effort preferred over deepseek / deepseek-flash / none / unknown effort · clear win.

Primary judge: Sol 6.1, requested Low. Effective provider effort and internal attempts were not verified. A close win is still a scored preference; it does not establish a material defect.

Reviewed public evidence

Task goal

Inspect the dashboard-builder data exploration interaction in the supplied implementation. Find one user-visible interaction that can mislead, trap, or silently discard a user’s work during filtering, loading, or editing; cite the exact condition, describe a minimal UX correction, and suggest a focused regression check.

openai / gpt-6.1-sol / low / low effort answer

### Finding: “New” silently discards unsaved edits
**Confidence: high; assessed independently from the supplied snapshot.**

- **Exact condition:** A user changes the dashboard name, widgets, or layout without saving, then clicks **New**. In `[REDACTED: private project name]/frontend/src/pages/DashboardBuilderPage.tsx:251–266`, the button directly calls `startNew`; lines **138–146** immediately clear widgets, reset the name and configuration ID, and provide no confirmation or recovery.
- **User impact:** Unsaved dashboard work disappears immediately. This is distinct from the corrupt-layout **Start fresh** action, which explicitly asks for confirmation at lines **399–404**.
- **Minimal correction:** Track whether the draft differs from its loaded/saved baseline. When dirty, ask “Discard unsaved changes?” before executing `startNew`; Cancel must preserve the draft.
- **Focused regression check:** Load a dashboard, change its name and add a widget, click **New**, and cancel. Assert that name, widgets, and configuration ID remain unchanged. Confirming should reset them; a clean draft should reset without prompting.

**Scope/uncertainty:** External component implementations are not supplied, but this direct button-to-state-reset path establishes the loss without relying on them. A query-refetch overwrite is another possible concern at lines **50–67**, but its trigger depends on the external dashboard hook, so it is not needed for this finding.

**Next action:** Add the dirty-state guard and the cancellation regression test.

deepseek / deepseek-flash / none / unknown effort answer

## Conclusion

**Defect:** In `DashboardBuilderPage.tsx`, the "New" button (`startNew`, line 138–146) and the "My Dashboards" card click / Apply Template action can silently discard unsaved widget edits with no confirmation, and `saveDashboard` is fire-and-forget against a length-changing error window. But the strongest **single user-visible trap** in the supplied evidence is narrower and reproducible:

**The "+ Add Widget" button does not create a widget in the grid the user is looking at — it flips the view to the catalog and can push the user's existing unsaved layout behind the empty-state, then the persisted save path can fail silently.**

Let me pin the exact condition rather than overstate.

## Primary finding (exact, reproducible)

**Condition:** User is editing a saved dashboard loaded from the URL (`urlConfig` effect, lines 51–67). They have unsaved edits. They click **"+ Add Widget"** (`addWidget`, lines 86–102).

```js
setWidgets((prev) => [...prev, {...}])   // line 89-98
setShowTemplates(false)
setShowSaved(false)
setShowCatalog(true)                     // line 101
```

The new widget IS appended, so work isn't lost there. **But** `addWidget` has an empty dependency array (`[]`, line 102) — it is stable, which is correct. The real hazard is the interaction with the URL-load effect:

- `useEffect` at lines 51–67 runs whenever `urlConfig` identity changes (React Query can refetch and return a **new object reference** for the same id). On refetch, it calls `setWidgets(result.widgets)`, **overwriting any unsaved edits the user has made since load**. Nothing guards against `urlConfig` re-arriving while `widgets` has local modifications. There is no dirty-tracking ref, no `configId` equality short-circuit, and no `configName` divergence check.

**Trigger:** Load a dashboard via URL. Edit/rename/add widgets (dirty state). A background refetch of `useDashboardConfig(parsedUrlId)` resolves with a fresh object → the effect re-runs → `setWidgets(result.widgets)` resets the canvas, `setConfigName` resets the name field, `setIsDefault` resets the checkbox. Unsaved work is silently discarded, and the URL effect also forces `setShowTemplates(false)` / `setShowSaved(false)`, collapsing the panels.

**Why it misleads:** The user sees the name input revert and widgets vanish with no alert; prior edits are simply gone. The page offers no "unsaved changes" indicator anywhere in the supplied code (contrast with `saveBlocked` at line 48, which only guards invalid layouts, not dirty state).

**Also relevant, same effect family:** `saveDashboard` (lines 148–167) sets `'Saved!'` optimistically after `mutateAsync` resolves, then clears the message after 2s. On catch it shows `'Failed to save'` — acceptable. However `saving` (line 46) is `createDashboard.isPending || updateDashboard.isPending`, and the Save button is `disabled={saving || saveBlocked}` (line 278). During the message timeout the button re-enables even though the toast implies success; minor.

## Minimal UX correction

Track dirtiness and refuse to silently clobber:

1. **Guard the URL-load effect** so it only applies a fetched config when the user has no unsaved local changes, or when the incoming config id differs from the current one. Smallest change: add a `dirtyRef`/`loadedRef` and short-circuit the `setWidgets` branch when `result.ok` and the user has edited since last load — e.g. only re-apply when `configId !== urlConfig.id` or when `!isDirty`. Alternatively, key the load effect solely on the config **id** (compare `urlConfig.id` to a ref) so identity churn from React Query refetches does not reset the canvas.

2. **Make destructive transitions explicit**: `startNew` (line 138), `applyTemplate` (line 114), and `loadSavedConfig` (line 122) all replace `widgets` unconditionally with no dirty check. A single confirm when `widgets` differ from the last loaded/saved snapshot is enough. (`startNew` is currently only guarded when reached via the corrupt-layout banner's own `window.confirm`, line 401 — the toolbar "New" button at line 252 calls it unguarded.)

## Focused regression check

A unit/component test (React Testing Library) over `DashboardBuilderPage`:

1. Render with `useDashboardConfig` mocked to return a config; assert widgets render and the name field is populated.
2. Fire an edit (call the exposed widget rename/config `onSave`, or `onLayoutChange`/`addWidget`), producing local divergence.
3. Re-render with a **new object reference for the same config id** (simulating a React Query refetch).
4. **Expected after fix:** local `widgets` and `configName` are preserved; the fetched snapshot does not overwrite unsaved state.
   **Current behavior:** `setWidgets(result.widgets)` overwrites — test fails on the pre-fix code, which is exactly the trap.

A second assertion: clicking "New" while widgets are non-empty should require confirmation (spy on `window.confirm`) and, if declined, leave `widgets` intact.

## Uncertainty / dependencies outside the packet

- The reset is only provable if `useDashboardConfig` (in `../api/dashboards`, **not supplied**) returns a new object reference on refetch or refetch-on-focus is enabled. If that hook memoizes by structural equality or has no refetch triggers, the effect will not re-run and the clobber cannot fire. I cannot confirm the hook's `refetchOnWindowFocus`/`staleTime` from the packet — this is the load-bearing dependency.
- `parseLayout`, `BuilderCanvas`, and `WidgetConfigEditor` are outside the packet; I cannot verify whether `onLayoutChange` (line 456) also creates a dirty indicator or whether the editor's save path differs.
- `useServerGrid.ts` analysis: I found **no independent user-visible work-discarding trap** in the supplied hook that isn't already handled. Notable near-misses I evaluated and discarded as *not* defects:
  - `tabulatorFiltersToGridFilters` (lines 327–336) **drops** custom-function header filters on non-numeric columns, logging only to `console.warn`. This *can* mislead (grid shows a filter in the header but the server query is wider) — the hook's own `rawHeaderFilterCount` docstring (lines 68–76) acknowledges it. It's real, but the conditional requires a developer-authored custom `headerFilterFunc`, and the hook documents the limitation; I rank it below the dashboard clobber.
  - The abort path returns a **never-settling promise** (line 629) — intentional and documented (lines 619–624); not a leak in practice because the abort is always paired with a superseding `replaceData()` or unmount.

**Confidence:** Medium on the exact clobber (depends on the unsupplied `useDashboardConfig` refetch behavior); High that the page has **no dirty-state guard** on `startNew`/`applyTemplate`/`loadSavedConfig`/the URL effect, so *some* unsaved-edit loss is reachable by the user through at least the unguarded "New" button (line 252) — that path needs no external dependency to confirm.

MATERIAL_EVIDENCE_CONFLICT: The `useServerGrid` docstrings assert header-filter drops are "honest" and surfaced via `rawHeaderFilterCount` (lines 68–76), while lines 327–343 still silently drop the filter and default unknown types to `contains`; the page-level dashboard code asserts no dirty-tracking exists (lines 51–67, 138) yet the corrupt-layout banner guards only itself (lines 399–404).

Primary judge's stated reason

Prefer A because its trigger, minimal correction, and regression check all target the demonstrated user-controlled loss path without conflicting introductory claims. B's equivalent New coverage and useful conditional loading analysis limit the advantage, but do not remove the practical risk of directing investigation toward its unsupported Add Widget diagnosis.

This reason is the judge's assessment. No independent factual-defect finding is asserted by this record.

Battle wave: c50cc6a9-2031-4391-a213-ab4daedec0f2. Pair: brp1_3bae34fc9b7140e32748a53abe5215f3d29306895219d453dac3b8d60f88f34f. A separate independent review is required before calling a concern a verified factual defect. Judge disagreement is not recorded here.