-
Notifications
You must be signed in to change notification settings - Fork 366
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
Add selection hierarchy breadcrumbs #8319
Conversation
if entity_path.is_root() { | ||
ui.strong("/"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We used to show nothing if the root was selected
Web viewer built successfully. If applicable, you should also test it:
Note: This comment is updated whenever you push a commit. |
|
||
let relative = &entity_path.as_slice()[common_ancestor.len()..]; | ||
|
||
let is_projection = !entity_path.starts_with(&view.space_origin); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still haven't figured out how to properly match the breadcrumbs with the blueprint tree panel for projections, since I don't have a good mental model for how projections are shown in the blueprint tree panel.
8754d09
to
75bf9e6
Compare
use crate::{DataResultNode, DataResultTree}; | ||
|
||
// TODO(@Wumpf): document this | ||
pub enum DataResultNodeOrPath<'a> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I understood why we removed the "In view" row (@gavrelina) |
I guess for the same reason as we don't have a "In container" row for views/containers: we can now see that from the breadcrumbs 🤷 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for that, very nice improvement!
{ | ||
ui.spacing_mut().item_spacing.x = 2.0; | ||
|
||
// Show one single icon up-front instead: | ||
let instance_path = InstancePath::entity_all(entity_path.clone()); | ||
ui.add(instance_path_icon(&query.timeline(), db, &instance_path).as_image()); | ||
// The last part points to the selected entity, but that's ugly, so remove the highlight: | ||
let visuals = ui.visuals_mut(); | ||
visuals.selection.bg_fill = egui::Color32::TRANSPARENT; | ||
visuals.selection.stroke = visuals.widgets.inactive.fg_stroke; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this scope serve a purpose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really - it is just a logical grouping, and reducing the scope of variables, thus lessoning the mental overhead
crates/viewer/re_selection_panel/src/item_heading_with_breadcrumbs.rs
Outdated
Show resolved
Hide resolved
if instance.is_all() { | ||
// Entity path. Exclude the last part from the breadcrumbs, | ||
// as we will show it in full later on. | ||
if let [all_but_last @ .., _] = entity_path.as_slice() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
woa TIL that syntax
crates/viewer/re_selection_panel/src/item_heading_with_breadcrumbs.rs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
really surprised this icon has odd values for both its dimensions. Shouldn't we aiming for good 2x ui scale factor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest we ignore this until we switch to .svg for all icons
Related
What
This adds "breadcrumbs" to each selection header in the selection panel, showing the ancestry of the selected thing.
That should make it obvious if the selection belong to the blueprint tree panel, or the streams panel.
Future PR