Show processing screenshots in Today filters#31
Conversation
Greptile SummaryThis PR surfaces in-flight local sources (images, screenshots) as non-interactive "Processing" placeholder cards in the Today screen, bridging the gap between when a user adds a source and when Tag finishes building a card from it. Placeholders are synthesised in-memory from an anti-join query, merged with real stored cards in both the one-shot
Confidence Score: 5/5Safe to merge. The placeholder synthesis is purely in-memory, the anti-join query is a well-understood pattern, and real cards are unaffected by the new code paths. All changed paths — placeholder loading, stream merging, filter/sort extensions, and UI routing — are well-guarded and covered by the new tests. The late final subscriptions in watchCards are safe because onCancel can only fire after onListen. No correctness defects were found. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant UI as Today Screen
participant Cubit as TodayCubit
participant Repo as CardRepositoryImpl
participant DB as Drift DB
UI->>Cubit: subscribe watchCards(today, all)
Cubit->>Repo: watchCards(query)
Repo->>DB: _watchStoredCards() — tagCards JOIN spaces
Repo->>DB: _watchProcessingSourcePlaceholders() — sourceItems LEFT JOIN cardSources WHERE sourceId IS NULL
DB-->>Repo: stored cards emit
Repo-->>Cubit: emitCurrent([storedCards, []])
DB-->>Repo: processing placeholders emit
Repo-->>Cubit: emitCurrent([storedCards, placeholders])
Cubit-->>UI: state with placeholder cards shown
note over UI: User taps placeholder
UI->>UI: isProcessingPlaceholder? push sourcePreviewLocation(sourceId)
note over DB: Source processing completes, card created
DB-->>Repo: cardSources row inserted, placeholder query emits []
DB-->>Repo: tagCards row inserted, storedCards emits [newCard]
Repo-->>Cubit: emitCurrent([newCard, []])
Cubit-->>UI: placeholder replaced by real card
Reviews (2): Last reviewed commit: "Show processing screenshots in Today fil..." | Re-trigger Greptile |
89001a6 to
7399cc5
Compare
Summary
Validation
flutter analyzeflutter testflutter test test/features/today/domain/today_card_query_test.dartflutter test test/features/today/presentation/today_screen_test.dartflutter test integration_test/beta_feedback_icon_e2e_test.dart -d AB1A14DF-4B6D-4E70-87C4-2ED36D0BF7A4; blocked because Flutter/Xcode did not accept the booted iPhone 16e simulator destination during the build invocation.Closes #30