Files

2.4 KiB

R1c2 — run detail native widget slice

Change

RunDetailView keeps its existing controller and onBack API but now selects its presentation from the host: MaterialApp uses the standard Material controls, CupertinoApp uses Cupertino controls without a Material ancestor. Selection is based on MaterialLocalizations, so it works on the web's desktop host and in widget tests without relying on the browser's target platform.

  • Material: Chip, ExpansionTile, ListTile, TextButton, IconButton, selectable text and SnackBar feedback.
  • Cupertino: CupertinoButton, CupertinoExpansionTile, CupertinoListTile and grouped list sections. Copy feedback is inline in a live-region status; no ScaffoldMessenger/SnackBar is used.
  • Loading and failure states are platform-specific and honest: only the error text is shown when no detail exists, and the Back action remains available. A refresh with retained detail reports Refreshing run details… instead of clearing the view.
  • The scrollable list has a stable per-run key and a test proves a live detail update keeps its scroll offset.

Detail-only helpers split formatting from presentation:

  • run_detail_content.dart: title/pipeline, prompt extraction, nested JSON, usage metrics and recorded timeline entries.
  • run_detail_material.dart and run_detail_cupertino.dart: the two native presentations.
  • Input/output are pretty-printed, selectable JSON. Copy prompt passes the stored string byte-for-byte (no trim, no fallback field).
  • Usage distinguishes reported zero from unknown: token/cost totals are Unavailable unless the corresponding stage count proves reporting; a known stage count with an omitted zero cost renders $0.000000. Timeline rows show the server's recorded sequence.

Verification

  • flutter test test/features/runs/ui/run_detail_widget_test.dart: 7 tests passed. They run both platforms at 390px width with 2x text, exercise loading/error and Back, exact prompt copy and denied clipboard feedback, nested JSON, recorded sequences, zero vs missing usage, and scroll retention.
  • flutter test test/features/runs: 24 tests passed.
  • flutter analyze: no issues.
  • flutter build web: succeeded.

Limits

No real browser interaction or rendered capture was performed in this slice; the manager separately tracks R1 browser acceptance. Android/iOS builds and devices were not run, so mobile is unverified. No commit, push or deployment was made.