Skip to content

feat(selection): auto-open Details panel when lasso/ellipse selection…#647

Open
vijayvuyyuru wants to merge 6 commits intomainfrom
auto-open-details-on-multiselect
Open

feat(selection): auto-open Details panel when lasso/ellipse selection…#647
vijayvuyyuru wants to merge 6 commits intomainfrom
auto-open-details-on-multiselect

Conversation

@vijayvuyyuru
Copy link
Copy Markdown
Member

@vijayvuyyuru vijayvuyyuru commented May 6, 2026

Hey yall this change opens the details panel for a selection upon making it.
I want this change as I am making a tutorial for sanding operators to use the targeting flow. Furthermore, I think this change makes sense as the operator is typically configuring heaviness immediately after making a selection anyway.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 6, 2026

🦋 Changeset detected

Latest commit: 8f07e71

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@viamrobotics/motion-tools Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://viamrobotics.github.io/visualization/pr-preview/pr-647/

Built to branch gh-pages at 2026-05-08 19:25 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@vijayvuyyuru vijayvuyyuru force-pushed the auto-open-details-on-multiselect branch from 19aa96f to 41b39e3 Compare May 6, 2026 20:48
Comment thread src/lib/components/Selection/Tool.svelte
… populates

When a lasso or ellipse selection transitions from empty to populated, point
the existing `selectedEntity` context at the first entity in the selection so
the Details panel auto-opens. Track which entity we wrote so a later click on
a different entity wins (normal click behavior is preserved).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vijayvuyyuru vijayvuyyuru force-pushed the auto-open-details-on-multiselect branch from 41b39e3 to c7ec234 Compare May 6, 2026 20:59
@mattmacf98
Copy link
Copy Markdown
Member

I think we want to hold off on this for now, this will make it so every user who uses the lasso select will auto-focus on the points they select (which is business logic and opinionated)

for context on our approach we will:

  1. make selectable entity a trait
  2. expose that trait to consumers
  3. let the consumer set the trait on the selected point (like we already do for updating the color here https://github.com/viamrobotics/sanding-webapp/blob/main/src/lib/components/PointCloudSelector/PointCloudSelector.svelte#L26-L27)

if you really need this ASAP we could enable the way you have but could you add a prop

interface Props {
		/** Whether to auto-enable lasso mode when the component mounts */
		enabled?: boolean
		children?: Snippet
	}

to let the auto focus on select be configurable for the component.

@vijayvuyyuru
Copy link
Copy Markdown
Member Author

@mattmacf98 I don't need this right now, Ill update this PR to make it a prop that can be passed in.

Auto-selecting the newest entity is opinionated business logic, so it
should not fire for every consumer of SelectionTool. Make it opt-in via
a new `autoSelectNewEntities` prop that defaults to false.
The prop name is self-explanatory; the changeset documents the behavior.
@vijayvuyyuru
Copy link
Copy Markdown
Member Author

@mattmacf98 Alright, ive updated this to be an opt in prop.

@micheal-parks
Copy link
Copy Markdown
Member

@vijayvuyyuru If you don't need this now I'd recommend holding off - in the near future I'll be refactoring internals so that Selected is a trait. So none of this would be necessary since a plugin consumer would just do

entity.add(traits.Selected)

@micheal-parks
Copy link
Copy Markdown
Member

If you do need it - please just add a @todo comment saying to remove once a Selected trait exists

Add a TODO noting the prop should be removed once a Selected trait
exists, per the longer-term direction in PR #647 review.
@vijayvuyyuru
Copy link
Copy Markdown
Member Author

@micheal-parks Added TODO comment. Thanks for understanding!!

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.

3 participants