Skip to content

Switch embedding plot to commit region geometry (LIG-9903)#1589

Closed
ikondrat wants to merge 6 commits into
kondrat/lig-9903-4-images-frontendfrom
kondrat/lig-9903-6-plot-selection-switch
Closed

Switch embedding plot to commit region geometry (LIG-9903)#1589
ikondrat wants to merge 6 commits into
kondrat/lig-9903-4-images-frontendfrom
kondrat/lig-9903-6-plot-selection-switch

Conversation

@ikondrat

@ikondrat ikondrat commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

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?

  • Yes
  • Not needed (internal change)

ikondrat and others added 6 commits July 6, 2026 14:40
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>
@ikondrat ikondrat requested a review from a team as a code owner July 6, 2026 12:52
@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: b171d428-6ec9-4551-adee-334f58779365

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch kondrat/lig-9903-6-plot-selection-switch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Base automatically changed from kondrat/lig-9903-5-annotations-frontend to kondrat/lig-9903-4-images-frontend July 7, 2026 15:35
@ikondrat ikondrat force-pushed the kondrat/lig-9903-4-images-frontend branch from dd81371 to ff1d2f3 Compare July 8, 2026 11:14
@ikondrat ikondrat closed this Jul 8, 2026
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.

1 participant