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

Updated breadcrumb UI to new design #7362

Conversation

MichaelMauderer
Copy link
Contributor

@MichaelMauderer MichaelMauderer commented Jul 20, 2023

Pull Request Description

Implements ##7199

image

Important Notes

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 self-assigned this Jul 20, 2023
@MichaelMauderer MichaelMauderer marked this pull request as ready for review July 20, 2023 22:30
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.

The attached screenshot does not match the design:
design
I see that gaps between elements are different, and not only a gap before the read icon, but also gaps between entry and separator seems a little off to me (I didn't measure though)

/// a separator between entries, and an ellipsis. The breadcrumbs implementation selects the needed
/// representation for each entry in the grid view. For efficiency, text label and icons are
/// allocated once the entry is created.
/// An internal structure of [`Entry`]. It has four visual representations: text, an icon (before a
Copy link
Contributor

Choose a reason for hiding this comment

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

Technically not true, if we look at the variants of State (which was the source of this three representations statement). I'd rather say text has an optional icon.

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 comment was out of date and belonged to the first attempt to refactor the breadcrumbs. Fixed now.

@@ -92,6 +95,10 @@ pub mod ellipsis {
// === Style ===
// =============

/// The width of the icon in a text [`Entry`].
pub const ICON_WIDTH: f32 = 30.0;
Copy link
Contributor

Choose a reason for hiding this comment

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

On the attached screenshot, I see the width of the gap between data ▶︎ and icon read to be enormous. I wonder if it is caused by incorrect size or the fact that we don't have separate padding and size settings for the icon. Also, shouldn't it be in the stylesheet?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed the gap and this is now matching the design. This was caused by too large icon size, resulting in space around the icon.

Also, shouldn't it be in the stylesheet?
All the icon sizes here are fixed, so this is following the current implementation.

self.text.set_x(ICON_WIDTH);
} else {
self.icon.unset_parent();
self.icon.set_size((0.0, 0.0));
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 necessary?

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.

}
}

impl Default for Breadcrumb {
Copy link
Contributor

Choose a reason for hiding this comment

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

It can be derived automatically (recent clippy has a lint for that)

Comment on lines +203 to +217

let breadcrumbs = app.new_view::<Breadcrumbs>();
breadcrumbs.set_y(400.0);
breadcrumbs.frp().set_size(Vector2(500.0, 100.0));
breadcrumbs.set_entries_from((
vec![
Breadcrumb::from("home"),
Breadcrumb::from("data"),
Breadcrumb::new_with_icon("read", icon::Id::DataInput),
],
0,
));
breadcrumbs.set_base_layer(&app.display.default_scene.layers.node_searcher);


Copy link
Contributor

Choose a reason for hiding this comment

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

Please note that in #7350 breadcrumbs were moved to the documentation view (and to the documentation demo-scene), so there would be a merge conflict in this place.

@MichaelMauderer
Copy link
Contributor Author

The attached screenshot does not match the design: design I see that gaps between elements are different, and not only a gap before the read icon, but also gaps between entry and separator seems a little off to me (I didn't measure though)

I've updated the distances to better match the reference (see the new screenshot).

Copy link
Contributor

@farmaazon farmaazon left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -11,3 +11,5 @@ ensogl-derive-theme = { path = "../../../../../../lib/rust/ensogl/app/theme/deri
ensogl-hardcoded-theme = { path = "../../../../../../lib/rust/ensogl/app/theme/hardcoded" }
ensogl-text = { path = "../../../../../../lib/rust/ensogl/component/text" }
ensogl-grid-view = { path = "../../../../../../lib/rust/ensogl/component/grid-view" }
ide-view-component-list-panel-grid = { path = "../grid" }
Copy link
Contributor

Choose a reason for hiding this comment

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

Do breadcrumbs still need this dependency?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes.

Separator,
}

#[allow(missing_docs)]
#[derive(Clone, Copy, CloneRef, Debug, Default, PartialEq)]
#[derive(Clone, Copy, Debug, Default, PartialEq)]
enum State {
Copy link
Contributor

Choose a reason for hiding this comment

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

A private enum, does not need #[allow(missing_docs)]

@kazcw
Copy link
Contributor

kazcw commented Jul 27, 2023

QA: 🟢

@MichaelMauderer MichaelMauderer added the CI: Ready to merge This PR is eligible for automatic merge label Jul 27, 2023
…ser_breadcrumbs_to_new_design

# Conflicts:
#	app/gui/view/component-browser/component-list-panel/breadcrumbs/src/lib.rs
@mwu-tow mwu-tow merged commit d272d62 into develop Jul 27, 2023
19 of 21 checks passed
@mwu-tow mwu-tow deleted the wip/MichaelMauderer/update_component_browser_breadcrumbs_to_new_design branch July 27, 2023 14:10
@kazcw kazcw mentioned this pull request Aug 21, 2023
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants