Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selecting/hovering components now highlights their parent entity #4748

Merged
merged 4 commits into from
Jan 10, 2024

Conversation

Wumpf
Copy link
Member

@Wumpf Wumpf commented Jan 9, 2024

What

Note that this is implemented internally using what we call a "sibling selection" - we preserve the information that the entity itself within any space view isn't selected directly but only indirectly. Different ui elements can react different to sibling selections versus "real" selections - e.g. the blueprint view does not react to sibling selections. We do however show the full outline in the space view.

Took the opportunity to make the space view highlights determination code a bit more readable. Tested it a bit to make sure that the behavior is still the same.


image Note the highlight of the points in the space view - this didn't happen before.
image Similar, hovering highlights are even more generous now, making all entities hover-highlighted whenever an entity component path with the same entity is hovered (subltey: the 0/1/2 on the selection panel in the picture are *not* hover highlighted since they are specific instance paths)

Checklist

  • I have read and agree to Contributor Guide and the Code of Conduct
  • I've included a screenshot or gif (if applicable)
  • I have tested the web demo (if applicable):
  • The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG

@Wumpf Wumpf added ui concerns graphical user interface 📺 re_viewer affects re_viewer itself 😤 annoying Something in the UI / SDK is annoying to use include in changelog labels Jan 9, 2024
@Wumpf Wumpf changed the title Selecting a component path will now highlight entity in space views where it's used Selecting/hovering components now highlights its parent entity Jan 9, 2024
@Wumpf Wumpf changed the title Selecting/hovering components now highlights its parent entity Selecting/hovering components now highlights their parent entity Jan 9, 2024
@teh-cmc teh-cmc self-requested a review January 10, 2024 07:48
Copy link
Member

@teh-cmc teh-cmc left a comment

Choose a reason for hiding this comment

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

Yep, behaves nicely 👍

pub overall: InteractionHighlight,
pub instances: ahash::HashMap<InstanceKey, InteractionHighlight>,
overall: InteractionHighlight,
instances: ahash::HashMap<InstanceKey, InteractionHighlight>,
Copy link
Member

Choose a reason for hiding this comment

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

Not added in this PR but surely an InstanceKey should be NoHash and therefore usable with a IntMap, right? 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

thought you're right at first but actually InstanceKey is not NoHash and it makes sense: Instance keys are usually ordered and low entropy, they are terrible hashes as is which is why we want to apply a hash function to them

Copy link

Size changes

Name main 4748/merge Change
dna.rrd 645.12 kiB 552.96 kiB -14.29%

@Wumpf Wumpf merged commit 7a921a8 into main Jan 10, 2024
40 checks passed
@Wumpf Wumpf deleted the andreas/component-selection-highlight branch January 10, 2024 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
😤 annoying Something in the UI / SDK is annoying to use include in changelog 📺 re_viewer affects re_viewer itself ui concerns graphical user interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Selecting a component doesn't highlight anything in the space view(s)
2 participants