Skip to content

Conversation

@prateekmedia
Copy link
Owner

@prateekmedia prateekmedia commented Sep 16, 2025

Description:

  • Increased widget image resolution from 512px thumbnails to optimized 1280px for all users
  • Implemented retry logic for remote file downloads with network error detection
  • Added cancellation mechanism to prevent waiting for outdated widget operations
  • Fixed cache bypass for high-resolution requests to ensure quality
  • Added debug mode indicator showing actual image resolution

Tests:

  • Test widget image quality on different Android devices
  • Verify retry logic works for intermittent network failures
  • Test cancellation when changing album selections rapidly
  • Confirm widget updates are immediate when switching collections
  • Check debug mode shows correct resolution with (i) suffix

prateekmedia and others added 6 commits September 19, 2025 19:05
- Implement isolate-based widget image processing pipeline with proper EXIF handling
- Increase widget image resolution from 512px to 1024px for better quality
- Add multi-level caching strategy to optimize performance
- Use flutter_image_compress with auto-rotation for EXIF orientation fixes
- Process all heavy image operations in isolate to avoid UI blocking

Co-Authored-By: Claude <[email protected]>

fix: enhance widget image processing with better error handling and visual feedback

- Add comprehensive logging throughout widget image processing pipeline
- Improve HEIC file handling with fallback decoding mechanism
- Add visual quality indicator (512px/2048px) to widget subtitle for debugging
- Better error reporting with stack traces for isolate failures
- Enhanced cache file naming with size-specific identifiers

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

fix: restore TODO comments and add widget quality feature flag

- Restored TODO prefixes that were inadvertently removed from comments
- Added enhancedWidgetImage feature flag for internal users (1024px @ 85% quality vs 512px @ 70%)
- Maintains backward compatibility with legacy widget image size for regular users

Co-Authored-By: Claude <[email protected]>

fix: optimize widget image quality and download logic

- Set optimal widget image size to 1280px for mobile screens
- Add retry logic for remote file downloads (2 attempts)
- Skip cache for requests >512px to ensure high quality
- Add network error detection to skip unnecessary retries
- Show actual image resolution in debug mode with (i) suffix
- Clean up redundant logging while keeping essential warnings

Co-Authored-By: Claude <[email protected]>
- Cancel ongoing widget operations when starting new ones
- Add CancelableCompleter support to all widget services
- Check for cancellation at key points during rendering
- Prevent waiting for outdated operations when selections change
- Clean up resources when operations are cancelled

This ensures immediate response to selection changes without
waiting for previous widget computations to complete.

Co-Authored-By: Claude <[email protected]>

fix: only cancel widget operations when changes are detected

- Move cancellation logic inside the update check
- Only cancel ongoing operations if _shouldUpdateWidgetCache returns true
- Prevents unnecessary cancellations when nothing has changed
- Applies to all three widget services (album, memory, people)

This ensures efficient resource usage by avoiding redundant cancellations
and re-runs when the widget data hasn't actually changed.

Co-Authored-By: Claude <[email protected]>

feat: implement widget-type-specific cancellation tracking

- Track separate operations for album, memory, and people widgets
- Each widget type can only cancel its own operations
- Prevents cross-widget cancellation (e.g., album changes won't cancel memory updates)
- Uses Map to track operations by widget type identifier
- Ensures operations using shared lock don't interfere with each other

This isolation ensures that if Memory widget is processing and Album selection
changes, only Album's queued operation (if any) is cancelled, not the running
Memory operation.

Co-Authored-By: Claude <[email protected]>
…ueue

- Add request generation counter to each widget service
- Skip outdated operations when they get the lock
- Prevents redundant operations when multiple requests queue up
- Ensures only the latest request for each widget type executes

Example: If queue is [Memory (running), Album1, People, Album2],
Album1 will be skipped when it gets the lock since Album2 is newer.
This prevents wasting resources on outdated operations.

Co-Authored-By: Claude <[email protected]>
- Use flutter_cache_manager instead of custom cache implementation
- Remove unreliable quality checks based on file size
- Simplify image fetching flow with clear priority hierarchy
- Maintain retry logic for remote file downloads

Co-Authored-By: Claude <[email protected]>
- Add WidgetCacheManager.emptyCache() call during logout
- Ensures cached widget images are cleared when user signs out

Co-Authored-By: Claude <[email protected]>
@prateekmedia prateekmedia force-pushed the widget-fixes branch 2 times, most recently from 38ad4da to 72b6137 Compare September 19, 2025 13:50
Co-authored-by: Claude <[email protected]>

Consolidate widget changes in internal changelog

Co-authored-by: Claude <[email protected]>

Update internal changes with enhanced widget feature

Co-authored-by: Claude <[email protected]>

Consolidate widget improvements in internal changelog

Co-authored-by: Claude <[email protected]>

Update flag notation in internal changelog

Co-authored-by: Claude <[email protected]>
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