Skip to content

Show processing screenshots in Today filters#31

Merged
Ayobami-00 merged 1 commit into
mainfrom
fix/processing-screenshots-should-be-a-visible-u
May 23, 2026
Merged

Show processing screenshots in Today filters#31
Ayobami-00 merged 1 commit into
mainfrom
fix/processing-screenshots-should-be-a-visible-u

Conversation

@Ayobami-00
Copy link
Copy Markdown
Owner

Summary

  • Add source-backed Processing placeholders to Today while image/screenshot sources are still in local processing states and no Tag Card has linked the source yet.
  • Add the Today Processing filter, render processing placeholders without destructive/card actions, and route them to source evidence.
  • Cover All/Processing/Suggestion filter behavior, stream updates, placeholder removal after card creation, and the Today filter sheet.

Validation

  • flutter analyze
  • flutter test
  • Targeted simulator/E2E check, if relevant
    • flutter test test/features/today/domain/today_card_query_test.dart
    • flutter test test/features/today/presentation/today_screen_test.dart
    • Attempted flutter 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.
    • Attempted macOS E2E fallback; blocked because this repo has no macOS desktop project configured.

Closes #30

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 23, 2026

Greptile Summary

This 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 getCards path and the new dual-subscription watchCards stream, and disappear automatically once a real card is linked to the source.

  • New TagCardStatus.processing + isProcessingPlaceholder: synthetic cards carry a prefixed ID (processing_source_<sourceId>) and an empty actions list, routing taps to sourcePreviewLocation instead of card detail.
  • New TodayCardFilter.processing: dedicated filter chip with hourglass icon; _matchesFilter explicitly excludes processing cards from the Urgent/Goal/Suggestion buckets so they don't double-count.
  • watchCards refactor: splits into _watchStoredCards + _watchProcessingSourcePlaceholders merged via a StreamController with onListen/onCancel guards; _DismissibleTodayCard skips Dismissible wrapping for processing placeholders.

Confidence Score: 5/5

Safe 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

Filename Overview
lib/features/cards/data/repositories/card_repository_impl.dart Core change: adds processing-source placeholder loading via anti-join query, merges two DB streams into watchCards, and extends filter/sort/viewMode logic. Implementation is solid.
lib/features/cards/domain/entities/card_entities.dart Adds TagCardStatus.processing enum value and isProcessingPlaceholder discriminator combining ID prefix, status, and sourceIds presence. Clean and well-guarded.
lib/features/cards/domain/entities/card_query.dart Adds TodayCardFilter.processing enum value. Minimal change, no issues.
lib/features/cards/domain/use_cases/card_policy.dart Short-circuits availableActionsFor to return empty list for processing-status cards. Correct guard placement.
lib/features/today/presentation/screens/today_screen.dart Routes processing placeholder taps to sourcePreviewLocation, skips Dismissible wrapping for processing cards, and adds Processing filter chip. Changes are well-isolated.
lib/features/today/presentation/widgets/tag_card_list_item.dart Adds brandPrimary/brandSoft visual style and hourglass icon for processing status cards.
test/features/today/domain/today_card_query_test.dart Adds three new tests covering filter membership, stream reactivity, and placeholder removal after card creation.
test/features/today/presentation/today_screen_test.dart Adds assertion that Processing filter chip appears in the filter sheet. Minimal and correct.

Sequence Diagram

sequenceDiagram
    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
Loading

Reviews (2): Last reviewed commit: "Show processing screenshots in Today fil..." | Re-trigger Greptile

Comment thread lib/features/cards/domain/entities/card_entities.dart
Comment thread lib/features/cards/data/repositories/card_repository_impl.dart
Comment thread test/features/today/domain/today_card_query_test.dart Outdated
@Ayobami-00 Ayobami-00 force-pushed the fix/processing-screenshots-should-be-a-visible-u branch from 89001a6 to 7399cc5 Compare May 23, 2026 22:44
@Ayobami-00 Ayobami-00 merged commit 104598c into main May 23, 2026
2 checks passed
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.

[Bug]: Processing screenshots should be a visible under the processing filter

1 participant