← Model losses

Head-to-head comparison

cursor / composer-2.5 / Composer 2.5 default / unknown effort preferred over openai / gpt-6-luna / low / low effort · close 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

MVP source audit; taskCategory=ux; module category=ux, difficulty=high, expectedTests=none. Dashboard layout, widget/query state and API/schema contracts, including their focused tests. Source review only; no tests run. Use only exact supplied files and cite file plus original line. Do not run tests, use shell/globs/root traversal, live services, databases, customer data, or edit source. Report concrete source-proven issues with impact and confidence, otherwise state no findings. Identify every excluded boundary explicitly; do not infer production readiness. This source-only audit packet is bound to verified merged main commit 9dab4e99d3bfadf995dbaa031b9b6a365970e1e3; it does not verify runtime or production behavior.

cursor / composer-2.5 / Composer 2.5 default / unknown effort answer

# Dashboard MVP UX — source-only audit

**Commit bound:** `9dab4e99d3bfadf995dbaa031b9b6a365970e1e3`  
**Lens:** layout, widget/query state, API/schema contracts, in-scope tests  
**Method:** supplied files only; no runtime, tests, or out-of-packet source.

---

## 1. Conclusion (high-confidence issues)

### F1 — URL dashboard resolution can stay stale after route change  
**Severity:** High (wrong layout/widgets on `/dashboards/:id`)  
**Confidence:** 0.92  

`resolvedDashboard` reads `urlConfigId` but the `useMemo` dependency list omits it, so switching between URL-addressed dashboards (or from default to URL) can reuse a prior resolution until `prefs` / `configs` / `personas` change.

```140:191:[REDACTED: private project name]/frontend/src/pages/DashboardPage.tsx
  const resolvedDashboard = useMemo((): {
    widgets: (WidgetConfig & { query?: DashboardQuery })[]
    layoutError: 'invalid_json' | 'not_array' | 'invalid_widget' | null
  } => {
    // 0. URL explicitly names a dashboard (e.g. /dashboards/49) — always wins.
    if (urlConfigId != null && configs) {
      ...
    }
    ...
  }, [prefs, configs, personas])
```

**Impact:** Wrong widgets, missing layout error UI, or stale empty state after navigation via the switcher (`navigate(\`/dashboards/${cfg.id}\`)` at 309–310).

---

### F2 — Dashboard global filter `connector` (AND/OR) is never applied to widget queries  
**Severity:** Medium–High (incorrect query semantics when OR is ever set)  
**Confidence:** 0.88  

The store persists `FilterGroup.connector` (`useDashboardFilterStore.ts` 18–21, 99–103), but `WidgetCard` only merges `filters.conditions` and keeps the widget/base connector, never `filters.connector` from the store.

```40:58:[REDACTED: private project name]/frontend/src/components/dashboard/WidgetCard.tsx
  const effectiveQuery = useMemo<DashboardQuery | null>(() => {
    ...
    const effectiveConditions = getEffectiveFilters(widget.id)
    ...
    return {
      ...baseQuery,
      filters: {
        connector: baseQuery.filters?.connector ?? 'AND',
        conditions: [...existingConditions, ...allConditions],
      },
    }
  }, [widget.query, widget.id, widget.config, getEffectiveFilters, globalFilters, crossFilters])
```

```141:149:[REDACTED: private project name]/frontend/src/store/useDashboardFilterStore.ts
  getEffectiveFilters: (excludeWidgetId) => {
    const { filters, crossFilters } = get()
    const effective = [...filters.conditions]
    ...
    return effective
  },
```

**Impact:** Any UI that sets OR on the dashboard filter group still sends AND semantics to `POST /dashboard-data/query` unless the widget’s own `query.filters.connector` overrides.

---

### F3 — Server `filter_config` on dashboard config is not wired to filter state  
**Severity:** Medium (saved server filters vs local-only behavior)  
**Confidence:** 0.85  

API type includes `filter_config`; switching dashboards only loads `localStorage` keyed by id, with no use of `activeConfig.filter_config` in `DashboardPage` or `setDashboardId`.

```16:28:[REDACTED: private project name]/frontend/src/api/dashboards.ts
export interface DashboardConfigResponse {
  ...
  filter_config: FilterConfigPayload | null
  ...
}
```

```74:76:[REDACTED: private project name]/frontend/src/store/useDashboardFilterStore.ts
  setDashboardId: (id) => {
    const filters = loadPersistedFilters(id)
    set({ dashboardId: id, filters, crossFilters: new Map() })
  },
```

```132:136:[REDACTED: private project name]/frontend/src/pages/DashboardPage.tsx
  useEffect(() => {
    setDashboardId(activeConfig?.id ?? null)
  }, [activeConfig?.id, setDashboardId])
```

**Impact:** Org/translated filters from the backend (`FilterConfigPayload`) never hydrate the bar or widget queries; users only see `[REDACTED: private project name]-dashboard-filters-${id}` local state. `UserPreferencesResponse.dashboard_filter_presets` (userPreferences.ts 228) is likewise unused in this packet.

---

### F4 — Duplicate widget titles in the live dashboard path  
**Severity:** Medium (visual/clutter, especially print)  
**Confidence:** 0.95  

`WidgetCard` renders a title row; `WidgetRenderer` always renders another title inside the same card.

```168:179:[REDACTED: private project name]/frontend/src/components/dashboard/WidgetCard.tsx
      <div ...>
        <span>{widget.title}</span>
```

```107:122:[REDACTED: private project name]/frontend/src/components/dashboard/WidgetRenderer.tsx
  return (
    <div ...>
      <div style={{ fontSize: 13, fontWeight: 600, ... marginBottom: 8 }}>
        {widget.title}
      </div>
```

**Impact:** Double headings on every widget; builder preview (`BuilderCanvas` 138–142 + 163) adds a third chrome layer with its own header.

---

### F5 — Documented “show PersonaSelector on no preference” vs implementation  
**Severity:** Medium (first-run UX)  
**Confidence:** 0.80  

File-level comment promises a modal when there is no preference; empty state does not open `showPersonaSelector`, and a separate effect auto-assigns `persona: 'engineer'` for non-consultants.

```4:8:[REDACTED: private project name]/frontend/src/pages/DashboardPage.tsx
 * Resolution logic:
 * ...
 * 3. No preference → show PersonaSelector modal (muni/contractor orgs only)
```

```450:456:[REDACTED: private project name]/frontend/src/pages/DashboardPage.tsx
          <DashboardEmptyState
            title="No dashboard configured"
            description="Select a persona to get started with a dashboard tailored to your role."
```

`showPersonaSelector` is only toggled from the persona settings control when `prefs?.persona` already exists (358–377), not from the empty state. Auto-migration (198–227) can bypass manual persona choice.

**Impact:** New users may see a static empty state or silent default to engineer without the modal described in the module comment.

---

### F6 — Layout/test contract gap: `invalid_widget` and builder checkbox behavior untested  
**Severity:** Medium (regression risk on corrupt layouts / default flag)  
**Confidence:** 0.90  

`parseLayout` can return `invalid_widget` (parseLayout.ts 21–26); `DashboardPage` surfaces it (422–424). Tests cover only `invalid_json` and `not_array`; builder `is_default` cases are `it.todo`.

```21:26:[REDACTED: private project name]/frontend/src/lib/parseLayout.ts
    if (!parsed.every((widget: unknown) => {
      ...
    })) return { ok: false, error: 'invalid_widget' }
```

```50:62:[REDACTED: private project name]/frontend/src/__tests__/DashboardLayout.test.tsx
describe('DashboardBuilderPage — set-as-default checkbox', () => {
  it.todo('shows corrupt-layout error banner when urlConfig has invalid JSON')
  ...
  it.todo('loads is_default=true from urlConfig and renders checkbox as checked')
```

**Impact:** Plan 5 cases 3–4 and DOM-level corrupt-layout banners have no pinned behavior in this packet.

---

### F7 — Unknown-data coaching banner latched across refetches/filter changes  
**Severity:** Low–Medium (misleading coaching after cross-filter)  
**Confidence:** 0.75  

Banner state is fixed after first data load per `widget.id`; it does not reset when `effectiveQuery` or filter store changes (only `widget.id` resets the latch).

```71:85:[REDACTED: private project name]/frontend/src/components/dashboard/WidgetCard.tsx
  // Reset latch when widget changes identity
  const prevWidgetId = useRef<string>(widget.id)
  if (prevWidgetId.current !== widget.id) {
    ...
    bannerLatch.current = BANNER_UNSET
  }
```

```88:110:[REDACTED: private project name]/frontend/src/components/dashboard/WidgetCard.tsx
  if (bannerLatch.current === BANNER_UNSET && widgetData !== undefined) {
    ...
    bannerLatch.current = ...
  }
```

**Impact:** After cross-filtering away “Unknown” dominance, banner can remain; conversely a first load without banner won’t appear after filters widen unknown share.

---

### F8 — Share dialog: active option is not actionable (only the inactive side toggles)  
**Severity:** Low (UX confusion)  
**Confidence:** 0.85  

Personal row calls `handleToggle` only when already published; published row calls toggle only when not published. Selected state uses `cursor: 'default'`.

```69:77:[REDACTED: private project name]/frontend/src/components/dashboard/ShareDialog.tsx
          <button
            onClick={() => { if (isPublished) handleToggle() }}
            ...
              cursor: isPublished ? 'pointer' : 'default',
```

```86:94:[REDACTED: private project name]/frontend/src/components/dashboard/ShareDialog.tsx
          <button
            onClick={() => { if (!isPublished) handleToggle() }}
            ...
              cursor: !isPublished ? 'pointer' : 'default',
```

**Impact:** Users may think the highlighted option is disabled; they must click the non-selected row to change visibility.

---

### F9 — Onboarding banner: client-side `.filter` on consultant client list  
**Severity:** Low for UX audit; Medium for architecture alignment  
**Confidence:** 0.70 (`needs_verification` for product intent)  

```63:64:[REDACTED: private project name]/frontend/src/components/dashboard/OnboardingBanner.tsx
    const realClientCount = (consultantClients ?? []).filter((c) => !c.is_sandbox).length
```

Contrasts with `DATA_OWNERSHIP.md` rule that list-like domain views should not use client `.filter()` on server-owned arrays (lines 17–19, 54). May be acceptable as UI grouping; not provable as bug without backend contract for `is_sandbox`.

---

### F10 — Split `WidgetConfig` shapes (dashboards API vs renderer)  
**Severity:** Low (contract drift)  
**Confidence:** 0.82  

`dashboards.ts` includes optional `query`; `WidgetRenderer`’s exported `WidgetConfig` omits `query` (types 25–32 vs 40–55 in dashboards.ts). `parseLayout` casts parsed JSON to `dashboards` `WidgetConfig` without validating `query` or widget `type` against `WIDGET_TYPE_ALLOWLIST`.

**Impact:** Invalid types render placeholder in renderer; missing `query` yields null `effectiveQuery` and loading/disabled data path without layout parse error.

---

## 2. Alternatives / likely false positives

- **Consultant bounce** (`DashboardPage` 107–110): Brief flash of dashboard chrome before `navigate('/consultant')` is possible; severity depends on router timing (not provable here).
- **`JSON.stringify(query)` cache key** (`dashboardData.ts` 55–57): Key instability from key order is a performance concern, not a functional bug in this packet.
- **`useUpdateDashboard` invalidates only list key** (`dashboards.ts` 107–109): Stale detail cache is plausible but `queryKeys.dashboardConfigs.detail` is **outside** the packet — cannot confirm.
- **DATA_OWNERSHIP vs `transformQueryResult`**: Chart shaping in `WidgetCard` (221–365) is presentation of aggregate query rows, not Explorer domain arrays; flagging as full SoT violation would overstate vs dashboard API design.

---

## 3. Excluded boundaries and missing evidence

**Explicitly out of packet (per scope JSON + missing-deps list):**  
`queryKeys.js/ts`, `csrf.js`, `mediaTokens.js`, `useDrillThrough.js`, `UnknownDataCoachingBanner.js`, all unstated widget modules (`MapWidget`, `DataHealthWidget`, etc.), `nlParser.js`, dashboard **builder page** (only `BuilderCanvas.tsx` in scope), backend `/dashboards` and `/dashboard-data` handlers, `resetRegistry` / org-switch interaction with dashboard filters.

**Not inferred:** production readiness, CI arch-check allowlist, runtime TanStack Query behavior, whether `queryKeys.dashboardData.all` prefix matches all widget queries (`DashboardHeader` 47–48).

**Consequence:** Cannot verify manual refresh coverage, drill-through URLs, or server acceptance of merged filter DTOs.

---

## 4. Next useful action

1. Fix **F1** by adding `urlConfigId` (and likely `configs` stability) to `resolvedDashboard` deps.  
2. Wire **F2**: pass `filters.connector` from `useDashboardFilterStore` into `DashboardQuery.filters.connector` when merging global conditions.  
3. Hydrate **F3**: on `setDashboardId`, call `resetToDefaults` from `activeConfig.filter_config` when present (and define precedence vs localStorage).  
4. Remove duplicate title in **F4** (renderer title only in builder preview, or `WidgetCard`-only on dashboard).  
5. Align first-run UX (**F5**) with either auto-engineer migration or PersonaSelector + tests in `DashboardLayout.test.tsx` (**F6**).

---

**Overall:** Multiple source-proven UX/state contract issues; the highest-impact fix in-packet is **F1** (stale URL dashboard resolution). No claim that the dashboard is production-ready or that backend contracts match frontend types beyond what is typed in the supplied API modules.

openai / gpt-6-luna / low / low effort answer

Finding: **Persisted global filters are presented as AND, but their connector is discarded when constructing widget queries.** `useDashboardFilterStore` stores the connector and `setConnector` updates it (`[REDACTED: private project name]/frontend/src/store/useDashboardFilterStore.ts:18-20, 99-104`); the filter bar also displays individual conditions (`[REDACTED: private project name]/frontend/src/components/dashboard/DashboardFilterBar.tsx:41-58`). But `WidgetCard` takes only the effective conditions and combines them with existing query conditions using a hard-coded `AND` (`[REDACTED: private project name]/frontend/src/components/dashboard/WidgetCard.tsx:44-59`). Thus a user-set `OR` filter group is silently evaluated as AND, potentially narrowing results and showing misleading widget data. **Confidence: high.**

No other concrete source-proven issue identified in the supplied snapshot. The dashboard-layout test file explicitly leaves DashboardPage error rendering and default-checkbox interactions as TODOs (`[REDACTED: private project name]/frontend/src/__tests__/DashboardLayout.test.tsx:48-63`); this is a focused coverage gap, not proof of a runtime defect.

**Boundaries and limitations:** Review is limited to the supplied files and their original line references. Dependencies outside the packet—including dashboard API/backend handlers and several imported frontend modules—were not assessed; no claims are made about their behavior. No tests were run. Runtime, database, customer-data, live-service, and production behavior were not verified; this audit does not infer production readiness.

Primary judge's stated reason

B offers a useful additional repair target for potentially mismatched dashboard navigation and displayed widgets. Its speculative and optional findings reduce audit precision, so this is a weak, forced preference for its supported coverage advantage, not an established material quality gap. An independent review could reasonably favor A's restraint.

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

Battle wave: a74ee767-4b32-4c9f-aba3-8297b9f8fec4. Pair: brp1_530918a0e38c2754d819fb91a1e4ca13a70c3e7e8034e20f1a46097624dcfcf5. A separate independent review is required before calling a concern a verified factual defect. Judge disagreement is not recorded here.