V1 Web PWA · Surface walkthrough

Bias Detector · Veritas

A per-surface walkthrough of the V1 Web PWA customer surface: layout, states, interactions, data, and cross-references.

walked
9sections6 minread

On this page

Context. surface customer · domain veritas · route /domains/veritas/bias · auth signed-in · source apps/oshun/web/src/app/domains/veritas/bias/page.tsx

Last walked. 2026-05-29 automated runtime walk (Playwright headless) — render, /v1 data (2xx), console/page-errors, expected content, screenshot verified; live screen-reader, touch, offline, and telemetry-delivery checks pending a manual AT pass. Evidence: WALKTHROUGH/results/runtime-sweep-2026-05-29.md. 2026-06-28 Codex Bias Detector addendum — signed-in cognitive-bias filtering, keyboard accordion expansion, close/back, media spectrum, framing analysis, dashboard metrics, debiasing guidance, blind-spot quiz completion/results/reset, personal profile, reduced-motion chart/bar checks, standalone PWA launch, offline mobile use, no-horizontal-overflow checks, /domains/veritas tool-grid entry, and /veritas broadsheet-subnav entry are covered by the E2E evidence below.

Purpose#

The Veritas Bias Detector — a full-screen overlay tool that explains cognitive biases, charts a media political spectrum, compares story framing across sources, summarizes fixture bias metrics, suggests debiasing exercises, runs a "blind spot" diagnostic, and surfaces a personal bias profile dashboard.

Entry points#

  • /domains/veritas index — secondary "More verification tools" panel → "Bias" button opens this detector in-place and Close returns to the domain home view.
  • Linked from /veritas — broadsheet subnav "Bias analysis" navigates to /domains/veritas/bias; Close uses browser history to return to /veritas.
  • Direct URL / bookmark — yes (auth required)

Layout regions#

page.tsx is a 'use client' component that renders an sr-only <h1> ("Bias Detector · Veritas · OSHUN") then mounts <VeritasBiasDetector onClose={() => router.back()} />. The detector is a fixed full-screen overlay.

  • Header: title "Veritas Bias Detector", 44px-minimum Close button (aria-label="Close Bias Detector"), and responsive wrap behavior.
  • Nav tablist: seven tabs with role="tab", aria-selected, and stable data-veritas-bias-tab hooks.
  • Body: focusable scrollable region labelled "Bias detector workspace"; current view is driven by view: BiasView.
    • Cognitive Biases (cognitive) — default fixture list, category filter, and keyboardable per-bias accordion via expandedBias
    • Media Spectrum (spectrum) — spectrum marker buttons and keyboardable source detail rows via expandedSource
    • Framing Analysis (framing) — story cards with perspective accordions via expandedFraming
    • Bias Score (dashboard) — fixture source/count/factual-reporting metrics
    • Debiasing (debiasing) — profile-derived suggestions, vulnerable biases, and toolkit exercises
    • Blind Spot Test (blindspot) — local quiz state in blindSpotAnswers, blindSpotIndex, and showBlindSpotResult
    • My Profile (profile) — fixture reading lean, scores, top sources, and vulnerability bars

States#

  • Loading — overlay renders synchronously; no async fetch, skeleton, or spinner.
  • Cognitive Biases view (default) — list count and category filtering are verified against COGNITIVE_BIASES.
  • Cognitive no-hidden state branch — all fixture categories currently contain results; no empty state is implemented for category filters.
  • Media Spectrum view — all MEDIA_SOURCES render as source rows and spectrum marker buttons; source details expand.
  • Framing view — all FRAMING_ANALYSES render with divergence scores and perspective details.
  • Bias Score view — average/source/cognitive/framing counts, source distribution, and factual-reporting buckets render from fixture data.
  • Debiasing view — suggestions, vulnerable biases, and toolkit exercises render from SAMPLE_PERSONAL_BIAS_PROFILE.
  • Blind Spot view — all questions can be answered, results score is computed, result rows render, and retake resets to the first question.
  • Profile view — reading lean, diversity score, blind-spot score, top sources, and vulnerability bars render from the profile fixture.
  • Offline — client-only filter/detail interactions remain usable after context.setOffline(true).
  • Standalone PWA/?surface=pwa restores to /domains/veritas/bias and matches standalone display-mode.
  • Reduced motion — E2E emulates reduced motion and verifies score-ring arcs and chart/bar transitions are effectively zero.

Interactions#

  • Close Bias Detector (button, aria-label="Close Bias Detector", X icon)
    • Function: keyboard Enter calls onClose()router.back()
  • /veritas broadsheet subnav entry — "Bias analysis" link navigates to the standalone detector route and the detector Close action returns to the lead.
  • /domains/veritas secondary-tools entry — "Show tools" reveals the "Bias" button, which opens the detector in the domain shell and closes back to the domain home view.
  • Nav tablist (per navItems):
    • cognitiveBrain icon, label "Cognitive Biases"
    • spectrumArrowLeftRight icon, label "Media Spectrum"
    • framingNewspaper icon, label "Framing Analysis"
    • dashboardBarChart3 icon, label "Bias Score"
    • debiasingLightbulb icon, label "Debiasing"
    • blindspotTarget icon, label "Blind Spot Test"
    • profileUser icon, label "My Profile"

Cognitive view#

  • Category filter (biasCategory) — all | decision_making | social | memory | probability | belief.
  • Bias card — click/Enter/Space toggles expandedBias === bias.id.
    • Expanded content includes definition context, example, information impact, and debiasing strategy.

Spectrum view#

  • Spectrum marker button — click opens/closes the associated media source detail via expandedSource.
  • Source row — click/Enter/Space toggles the detail panel.
    • Expanded detail includes source description, political spectrum bar, bias breakdown bars, factual-reporting badge, sample article, and linguistic triggers.

Framing view#

  • Framing card — click/Enter/Space toggles expandedFraming === id.
    • Expanded content includes source, lean, tone, bias score, headline, framing angle, and key phrases for each perspective.

Bias Score view#

  • Metric cards — average bias score, source count, cognitive-bias count, and framing-story count render fixture-derived values.
  • Source distribution bars — one bar per media source; transition is disabled under reduced motion.
  • Factual reporting breakdown — buckets are aggregated from MEDIA_SOURCES.

Debiasing view#

  • Personalized suggestions — fixture suggestions render in order.
  • Vulnerable-bias bars — fixture vulnerability scores render and respect reduced motion.
  • Quick debiasing toolkit — four static exercises render.

Blind Spot Test view#

  • Answer button — writes blindSpotAnswers[questionId] = answerId and exposes selected state.
  • Previous / Next / See Results — navigation remains disabled until the current question has an answer; final action shows results once every question is answered.
  • Results — score is computed from answers where option.biasRevealed === null; result rows include correctness and explanations.
  • Retake Test — clears local answers, resets blindSpotIndex to 0, and hides results.

Profile view#

  • Profile metrics — reading lean, diversity score, and blind-spot score render from SAMPLE_PERSONAL_BIAS_PROFILE.
  • Top sources — source names, lean labels, and article counts render.
  • Bias Vulnerability Profile — one BreakdownBar per vulnerable bias.

Current E2E evidence#

  • apps/oshun/web/e2e/veritas-bias-detector.spec.tsopens from the Veritas domain tool grid and returns to the domain home covers signed-in /domains/veritas navigation, secondary-tools disclosure, the "Bias" tool button, detector default cognitive state, and Close returning to the Veritas domain home without route replacement.
  • apps/oshun/web/e2e/veritas-bias-detector.spec.tsopens from the /veritas broadsheet subnav and browser-back closes to the lead covers the /veritas "Bias analysis" subnav entry, navigation to /domains/veritas/bias, detector default cognitive state, and Close/browser history returning to the broadsheet lead.
  • apps/oshun/web/e2e/veritas-bias-detector.spec.tsfilters cognitive biases, opens a card by keyboard, and closes by keyboard covers signed-in navigation from /library, default cognitive count, close target size/name, category filtering, keyboard accordion expansion, example/strategy detail content, and keyboard close/back behavior.
  • apps/oshun/web/e2e/veritas-bias-detector.spec.tsaudits spectrum, framing, dashboard metrics, and reduced-motion animations covers media-source rows and marker buttons, keyboard source expansion, source trigger details, reduced-motion score/breakdown transitions, framing counts and keyboard expansion, dashboard metrics, source distribution, and factual-reporting aggregation.
  • apps/oshun/web/e2e/veritas-bias-detector.spec.tsreviews debiasing guidance, completes the blind spot test, and opens profile covers debiasing suggestions/vulnerabilities/toolkit exercises, full blind-spot quiz completion with correct fixture answers, score/result rows, retake reset, profile metrics, top-source count, and vulnerability bars.
  • apps/oshun/web/e2e/veritas-bias-detector.spec.tskeeps the client-only detector usable offline and restores standalone without mobile overflow covers standalone PWA launch restoration, offline cognitive filtering, offline accordion expansion, offline spectrum navigation/source expansion, mobile no-horizontal-overflow checks, and standalone display-mode.

Data & contracts#

  • Reads: COGNITIVE_BIASES, MEDIA_SOURCES, FRAMING_ANALYSES, BIAS_BLIND_SPOT_QUESTIONS, SAMPLE_PERSONAL_BIAS_PROFILE, and MEDIA_BIAS_LEAN_CONFIG from @/lib/veritas/veritas-simulation-data.
  • Writes: none externally; all quiz answers, filters, and expanded panels are local component state only.
  • Realtime: none.
  • Caching: not applicable.
  • Auth/role check: shell middleware (verify).
  • Telemetry: no track* imports in this file.
  • Page metadata: not set (client component); sr-only <h1> reads "Bias Detector · Veritas · OSHUN".

Cross-references#

Open questions / known gaps#

  • No telemetry on tab switches, source expansion, quiz answer selection, or test completion.
  • Blind-spot answers, profile scores, source spectrum, and debiasing guidance are fixture/local-only; verify whether V1 intends persistence or a backend analysis endpoint.
  • Live screen-reader and touch-device AT passes remain pending beyond the automated keyboard/Playwright coverage here.