Switch embedding plot to commit region geometry (LIG-9903)#1589
Switch embedding plot to commit region geometry (LIG-9903)#1589ikondrat wants to merge 6 commits into
Conversation
Shared foundation for filtering both images and annotations by an embedding-plot lasso/rectangle selection. The frontend sends the region geometry (a few vertices) instead of the full list of selected sample ids, and the backend resolves it to sample ids via a vectorized point-in-polygon test over the cached 2D projection. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add an optional embedding_region to SampleFilter, resolved server-side to sample ids before the filter is applied. The image resolvers (get_all, get_sample_ids, annotation counts) call the resolver so a lasso/rectangle selection narrows the grid without the client sending the full selected sample-id list. An empty region matches nothing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Mirror the image behaviour for the annotations grid: AnnotationsFilter gains an optional embedding_region resolved server-side to annotation sample ids, and the annotation resolvers plus the read-with-payload route wire in the resolver. An empty region matches nothing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Store the image lasso/rectangle selection as region geometry instead of a resolved sample-id list and send it to the backend. Adds the shared region-selection plumbing (useEmbeddingPlotSelection count store and useRegionFilterVisibility) plus updateEmbeddingRegion on the image filter store, and threads embedding_region through the request body, types, and external-filter sync. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Keep the annotations lasso/rectangle selection as region geometry in the shared annotation-plot store and send it to the backend instead of a resolved sample-id list. The annotations grid, infinite-query options, and select-all all carry the region, reusing the shared region-visibility behaviour. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Wire the plot's lasso/rectangle selection to commit region geometry for images and annotations (videos still commit resolved sample ids), and propagate the client-computed in-polygon count so the sidebar filter chip can show how many items are selected without sending the id list. The plot keeps highlighting the committed region after drawing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 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: f5b4b73cc3
ℹ️ 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".
| // Commit the drawn polygon to the right store for the active tab. | ||
| const commitRegion = (region: { polygon: Point[] } | null) => { | ||
| if (isAnnotations) { | ||
| saveAnnotationPlotRegion(region); |
There was a problem hiding this comment.
Scope annotation regions by collection
When the annotations tab commits a lasso, this writes the polygon into the module-level annotationPlotRegion store, but that store is not associated with collectionId while the filter chip count is keyed per collection. If a user selects a region in one annotation collection and then navigates to another, AnnotationsGrid.svelte still sends the stale embedding_region for the new collection, but getPlotSelectionCount returns 0 so there is no chip indicating or clearing the active filter.
Useful? React with 👍 / 👎.
dd81371 to
ff1d2f3
Compare
What has changed and why?
Wire the plot's lasso/rectangle selection to commit region geometry for images and annotations (videos still commit resolved sample ids), and propagate the client-computed in-polygon count so the sidebar filter chip can show how many items are selected without sending the id list. The plot keeps highlighting the committed region after drawing.
How has it been tested?
(Delete this: Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.)
Did you update CHANGELOG.md?