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

Sync breadcrumbs and documentation panel. #7508

Conversation

MichaelMauderer
Copy link
Contributor

@MichaelMauderer MichaelMauderer commented Aug 7, 2023

Pull Request Description

Implements #7310.

Peek 2023-08-09 16-07

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • The documentation has been updated, if necessary.
  • Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.
  • All code follows the
    Scala,
    Java,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • All code has been tested:
    • Unit tests have been written where possible.
    • If GUI codebase was changed, the GUI was tested when built using ./run ide build.

@MichaelMauderer MichaelMauderer added the CI: No changelog needed Do not require a changelog entry for this PR. label Aug 7, 2023
@MichaelMauderer MichaelMauderer self-assigned this Aug 7, 2023
@MichaelMauderer MichaelMauderer marked this pull request as ready for review August 7, 2023 12:59
@@ -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));
Copy link
Contributor

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.

Comment on lines 266 to 267
self.icon.set_x(-size.x / 2.0 - 2.0);
self.icon.set_y(-ICON_WIDTH * 1.25 - 2.0);
Copy link
Contributor

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.

Copy link
Contributor Author

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/" }
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No. Removed.

/// 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);
Copy link
Contributor

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.

None
}
} else {
warn!("Update readcrumbs called with invalid index: {}", index);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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> + '_ {
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed.

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));
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

@vitvakatu vitvakatu left a 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?

@MichaelMauderer
Copy link
Contributor Author

Code changes look good to me. @MichaelMauderer could you update the screencast in the PR description?

Updated.

@kazcw
Copy link
Contributor

kazcw commented Aug 10, 2023

QA: 🟡

When the documentation is hidden (with the Show/hide documentation button), the breadcrumb container remains:
image

Other than that, it looks good.

@farmaazon
Copy link
Contributor

farmaazon commented Aug 10, 2023

When the documentation is hidden (with the Show/hide documentation button), the breadcrumb container remains:

This issue is also on develop, and I assume it will be fixed in the documentation panel's update. I would merge it.

@MichaelMauderer
Copy link
Contributor Author

When the documentation is hidden (with the Show/hide documentation button), the breadcrumb container remains:

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.

@MichaelMauderer MichaelMauderer added the CI: Ready to merge This PR is eligible for automatic merge label Aug 10, 2023
…r/synchronize-cb-breadcrumbs-with-documentation-panel

# Conflicts:
#	app/gui/src/controller/searcher.rs
@mergify mergify bot merged commit 7f19b09 into develop Aug 15, 2023
24 checks passed
@mergify mergify bot deleted the wip/MichaelMauderer/synchronize-cb-breadcrumbs-with-documentation-panel branch August 15, 2023 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: No changelog needed Do not require a changelog entry for this PR. CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants