Skip to content

Add Deck browsing feature with controller, UI, routing, and format helpers - #53

Open
ercmine wants to merge 1 commit into
mainfrom
codex/implement-deck-experience-in-flutter-frontend-dsc4sa
Open

Add Deck browsing feature with controller, UI, routing, and format helpers#53
ercmine wants to merge 1 commit into
mainfrom
codex/implement-deck-experience-in-flutter-frontend-dsc4sa

Conversation

@ercmine

@ercmine ercmine commented Mar 7, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Introduce a swipable "Deck" experience to browse session suggestions and integrate it into existing sessions flows.
  • Provide client-side telemetry and location-aware fetching for deck results and a small set of UI helper formatters.

Description

  • Added a full Deck feature including state (deck_state.dart), controller (deck_controller.dart) with telemetry, location and repository integration, and a new route at /sessions/:id/deck wired into router.dart and session_page.dart.
  • Implemented the Deck UI in deck_page.dart and a set of widgets for cards and details (deck_card.dart, deck_card_skeleton.dart, deck_actions_bar.dart, card_details_sheet.dart, and several small badges/pills), and hooked link launching into existing linkLauncherProvider usage.
  • Registered a deckControllerProvider in providers/app_providers.dart, added format helpers in core/format/formatters.dart, and updated pubspec.yaml to include flutter_card_swiper, cached_network_image, and collection dependencies.
  • Added UI behaviors such as loading/fallback states, undo stack, batching/merge logic for plans, and telemetry enqueue/flush calls to the existing telemetry repository API.

Testing

  • Ran flutter analyze to ensure static analysis and imports are correct and it completed successfully.
  • Ran flutter test and unit/widget tests completed successfully (no failing tests).

Codex Task

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3fa2653efc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +52 to +56
state = state.copyWith(
isLoadingInitial: true,
plans: const [],
nextCursor: null,
errorMessage: null,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Clear swipe history when starting a fresh deck load

refresh() resets the card list but leaves undoStack and shownPlanIds untouched, so after a retry/pull-to-refresh users can still undo into cards from the previous deck and telemetry positions continue from the old run; this mixes stale state into what should be a fresh batch load.

Useful? React with 👍 / 👎.

Comment on lines +214 to +217
_telemetryRepository().then((repo) async {
repo.enqueue(state.sessionId, event);
await repo.flush(state.sessionId);
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Serialize telemetry flushes to avoid queue races

Each telemetry event triggers an unawaited _enqueueTelemetry call that immediately flushes, so rapid interactions (for example card_viewed + swipe emitted back-to-back) can run overlapping flushes on the same session queue; TelemetryRepository.flush mutates a shared list, so concurrent flushes can send duplicate batches or leave events unsafely handled after removeRange races.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant