Improve performance by wiring bulk metadata map into refresh path#81
Improve performance by wiring bulk metadata map into refresh path#81AlanRockefeller merged 2 commits intomainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughAppController now passes a Changes
Sequence Diagram(s)sequenceDiagram
participant UI as "UI / User"
participant App as "AppController"
participant Model as "ThumbnailModel"
participant Meta as "Metadata provider\n(_get_bulk_metadata_map)"
UI->>App: trigger load/filter/sort/grid-change
App->>Model: refresh_from_controller(images, metadata_map_fn=Meta)
Model->>Model: apply filename filter -> filtered_images
alt metadata_map not provided
Model->>Meta: metadata_map_fn(filtered_images)
Meta-->>Model: metadata_map (subset)
end
Model->>Model: apply flag-filtering using metadata_map or per-item metadata
Model->>Model: bulk_add thumbnails with metadata_map
Model-->>App: refresh complete / update view
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3133ac2e62
ℹ️ 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".
| self.image_files, | ||
| metadata_map=self._get_bulk_metadata_map(self.image_files), |
There was a problem hiding this comment.
Build metadata map after filename filtering
Passing self.image_files into _get_bulk_metadata_map(...) forces a sidecar metadata lookup for every image on each grid refresh, even when an active filename filter would shrink the list dramatically. In ThumbnailModel.refresh_from_controller, filename filtering happens inside the model before metadata is needed, so this change turns filtered refreshes (e.g., typing in search) from roughly O(k) metadata reads to O(N), which can noticeably regress UI responsiveness in large folders.
Useful? React with 👍 / 👎.
…_from_controller invoke it after filename filtering
Summary by CodeRabbit
Refactor
New Features