Skip to content

feat: screen/action tracking, Flutter NavigatorObserver, RN navigation helper, dashboard UX - #6

Open
jeremiahseun wants to merge 3 commits into
mainfrom
claude/upbeat-mccarthy-H43JK
Open

jeremiahseun wants to merge 3 commits into
mainfrom
claude/upbeat-mccarthy-H43JK

Conversation

@jeremiahseun

Copy link
Copy Markdown
Owner

Summary

This PR implements the top roadmap request ("knowing which screen, and what was pressed or happened before the crash") across all four SDK platforms, plus a round of dashboard UX improvements.

Mobile SDKs — Screen & User Action Tracking (all platforms)

Two new first-class APIs added everywhere:

API What it records
screenView(name, attrs) Which screen the user is currently on (screen_view event type)
userAction(actionType, target, attrs) What the user just did — tap, swipe, submit (user_action event type)

These produce distinct event types in the ring buffer (not breadcrumb), so the crash timeline immediately shows the last active screen and the last user interaction before the crash.

iOS (Swift)

CircleBox.screenView("CheckoutScreen")
CircleBox.userAction("tap", target: "SubmitOrderButton")

Android (Kotlin)

CircleBox.screenView("CheckoutScreen")
CircleBox.userAction("tap", "SubmitOrderButton")

Flutter (Dart)

CircleBox.screenView('CheckoutScreen');
CircleBox.userAction('tap', 'SubmitOrderButton');

React Native (TypeScript)

await CircleBox.screenView('CheckoutScreen');
await CircleBox.userAction('tap', 'SubmitOrderButton');

Flutter — CircleBoxNavigatorObserver

New NavigatorObserver that auto-records screen_view events on every route push/pop/replace/remove with zero per-screen code:

MaterialApp(
  navigatorObservers: [CircleBoxNavigatorObserver()],
  ...
)

Supports a custom nameExtractor for apps using unnamed routes.

React Native — createCircleBoxNavigationListener

Helper that plugs directly into React Navigation's onStateChange:

const navigationRef = useRef(null);
const { onStateChange } = createCircleBoxNavigationListener(navigationRef);

<NavigationContainer ref={navigationRef} onStateChange={onStateChange}>

Dashboard — Project Overview (real stats)

  • Crash Reports (30d): live count from the usage API roll-up instead of --
  • Events Captured (30d): total events across the period
  • Storage (30d): human-readable bytes (KB/MB/GB)
  • Day-over-day delta badge: red ▲ / green ▼ vs yesterday
  • Sparkline chart: 30-day crash trend rendered as an SVG polyline

Dashboard — Crash Detail Page (full UX overhaul)

  • Crash banner: prominent red highlight at the top showing crash seq, type, and time
  • Pre-crash context strip: shows last screen_view (last screen) and last user_action (last tap/button) at a glance — the exact information previously buried in the raw timeline
  • Severity badges: colour-coded pills (red/fatal, orange/error, yellow/warn, green/info)
  • Collapsible event-type groups: accordion cards instead of plain <details> tags
  • Timeline improvements: rows colour-highlighted by category (crash=red, pre-crash=yellow, screen-view=green, user-action=blue); attrs rendered as structured key=value chips
  • Copy-to-clipboard: copy buttons on report ID and fingerprint fields (no page reload)

Samples

All four chaos apps updated with "Record Screen View" and "Record User Action" demo buttons.

Test plan

  • iOS: call CircleBox.screenView("Home") and CircleBox.userAction("tap", "Buy"), export JSON, confirm screen_view and user_action events appear with correct attrs
  • Android: same as above via the chaos app new buttons
  • Flutter: add CircleBoxNavigatorObserver to sample, navigate between screens, confirm screen_view events appear in debug snapshot
  • React Native: use createCircleBoxNavigationListener, navigate, confirm events
  • Dashboard: open a project with usage data, confirm stats cards show real numbers and sparkline renders
  • Dashboard: open a crash report that has screen_view/user_action events, confirm context strip shows last screen and last action

https://claude.ai/code/session_01M2SM2GfBsPiWrFynVPvCCc


Generated by Claude Code

…UX improvements

**Mobile SDKs — all platforms**
- Add `screenView(name, attrs)` and `userAction(actionType, target, attrs)` APIs
  to iOS (Swift), Android (Kotlin), Flutter (Dart + native bridges), and
  React Native (TS + native modules) so apps can record which screen was active
  and what the user last did — exactly the crash context requested in the
  phase-3 roadmap item.

**Flutter SDK**
- New `CircleBoxNavigatorObserver` (`NavigatorObserver` subclass) that auto-records
  `screen_view` events on every push/pop/replace/remove with zero per-screen code.
  Add it once to `MaterialApp.navigatorObservers` for full navigation history.

**React Native SDK**
- New `createCircleBoxNavigationListener(navigationRef)` helper that plugs directly
  into React Navigation's `NavigationContainer.onStateChange` for automatic tracking.
- Export `NavigationContainerRefLike` type for TypeScript consumers.

**Dashboard**
- Project overview: wire up real crash/events/storage stats from the usage API
  (30-day roll-up) instead of showing `--`. Added a sparkline chart for crash
  trends, day-over-day delta badge, and bytes-formatted storage card.
- Crash detail page: full UI overhaul — crash banner, pre-crash context strip
  showing last screen and last user action, severity badges with colour coding,
  collapsible event-type groups, timeline row highlights for crash/pre-crash/
  screen-view/user-action events, structured attrs chips, and copy-to-clipboard
  for report IDs and fingerprints.
- Root layout: global clipboard event-delegation handler for copy buttons.

**Samples**
- All four chaos apps (iOS, Android, Flutter, React Native) updated with
  "Record Screen View" and "Record User Action" demo buttons.

https://claude.ai/code/session_01M2SM2GfBsPiWrFynVPvCCc
@vercel

vercel Bot commented May 7, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
circlebox Ready Ready Preview, Comment May 7, 2026 2:20am
dashboard Ready Ready Preview, Comment May 7, 2026 2:20am

- crash-detail-page.tsx: cast unknown attrs values to String() before
  rendering as JSX children; use !! to convert unknown guard expressions
  to boolean in && short-circuits. Fixes all cloud-types TS2322 errors.

- circlebox_navigator_observer.dart: wrap CircleBox.screenView() call in
  unawaited() and import dart:async. Fixes unawaited_futures lint in the
  Flutter plugin, adapters, and cloud CI jobs (all use the local
  circlebox_flutter path override and analyze it as workspace code).

https://claude.ai/code/session_01M2SM2GfBsPiWrFynVPvCCc
tar -czf artifacts/foo.tgz . tries to archive the output file while
writing it. Newer GNU tar (ubuntu-latest) returns exit code 1 when a
file changes during archiving, causing all three Flutter packaging jobs
(plugin, adapters, cloud) to fail after passing analyze and test.

Add --exclude=./artifacts to each tar command so the output file is
never included in the archive.

https://claude.ai/code/session_01M2SM2GfBsPiWrFynVPvCCc

This branch was successfully deployed

2 active deployments
Preview – dashboard — 72ac4c5e Deployed May 7, 2026 by vercel[bot]
Preview – circlebox — 72ac4c5e Deployed May 7, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants