-
Notifications
You must be signed in to change notification settings - Fork 323
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
Sync breadcrumbs and documentation panel. #7508
Sync breadcrumbs and documentation panel. #7508
Conversation
@@ -186,8 +186,9 @@ impl EntryData { | |||
let separator = separator::View::new(); | |||
let state = default(); | |||
let icon: any_icon::View = default(); | |||
icon.set_size((ICON_WIDTH, ICON_WIDTH)); | |||
ellipsis.set_size((ICON_WIDTH, ICON_WIDTH)); |
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.
The next line sets the size of the ellipsis as well.
self.icon.set_x(-size.x / 2.0 - 2.0); | ||
self.icon.set_y(-ICON_WIDTH * 1.25 - 2.0); |
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.
Offsets like 2.0
and 1.25
should probably be moved to constants.
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.
Done.
@@ -18,6 +18,7 @@ ensogl-selector = { path = "../../../../../lib/rust/ensogl/component/selector" } | |||
ensogl-toggle-button = { path = "../../../../../lib/rust/ensogl/component/toggle-button" } | |||
ensogl-text = { path = "../../../../../lib/rust/ensogl/component/text" } | |||
ensogl-tooltip = { path = "../../../../../lib/rust/ensogl/component/tooltip/" } | |||
ensogl-breadcrumbs = { path = "../../../../../lib/rust/ensogl/component/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.
Is it used in this crate?
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.
No. Removed.
app/gui/src/controller/searcher.rs
Outdated
/// Return the documentation for the breadcrumb. | ||
pub fn documentation_for_selected_breadcrumb(&self) -> Option<EntryDocumentation> { | ||
let selected = self.breadcrumbs.selected(); | ||
console_log!("documentation_for_selected_breadcrumb -> selected: {:?}", selected); |
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.
console_log
left in the code.
app/gui/src/controller/searcher.rs
Outdated
None | ||
} | ||
} else { | ||
warn!("Update readcrumbs called with invalid index: {}", index); |
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.
warn!("Update readcrumbs called with invalid index: {}", index); | |
warn!("Update breadcrumbs called with invalid index: {}", index); |
} | ||
|
||
/// Return a list of breadcrumbs to be displayed in the panel. | ||
pub fn items(&self) -> impl Iterator<Item = BreadcrumbEntry> + '_ { |
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.
It looks suspicious lifetime-wise, and it seems to be unused.
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.
Removed.
app/gui/src/controller/searcher.rs
Outdated
let name = &component.name; | ||
let icon = Some(component.icon()); | ||
let module = &component.defined_in; | ||
let breadcrumbs_base = module.path().iter().map(|name| Breadcrumb::new_without_icon(name)); |
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.
Here I see that we create breadcrumbs without icons for the modules path, but in the video, there are icons on each crumb. Is that correct?
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.
This was left over and unused, but you are right that only the last breadcrumb should have an icon. Fixed.
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.
Code changes look good to me. @MichaelMauderer could you update the screencast in the PR description?
Updated. |
This issue is also on develop, and I assume it will be fixed in the documentation panel's update. I would merge it. |
Yes, this is addressed in that PR. So I'll merge this one. |
…r/synchronize-cb-breadcrumbs-with-documentation-panel # Conflicts: # app/gui/src/controller/searcher.rs
Pull Request Description
Implements #7310.
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.
./run ide build
.