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

[Discover] Custom grid toolbar #166744

Merged
merged 44 commits into from
Oct 19, 2023
Merged

Conversation

jughosta
Copy link
Contributor

@jughosta jughosta commented Sep 19, 2023

Summary

This PR customizes the grid toolbar for Discover. The controls will have the "ToolbarButton" look.

Screenshot 2023-10-17 at 11 23 16 Screenshot 2023-10-17 at 11 23 00 Screenshot 2023-10-17 at 11 23 44

Checklist

@jughosta jughosta changed the title [Discover] Tmp custom toolbar [Discover] Custom grid toolbar Sep 28, 2023
@jughosta jughosta self-assigned this Sep 28, 2023
@jughosta jughosta added Feature:Discover Discover Application release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. labels Sep 28, 2023
@jughosta jughosta marked this pull request as ready for review September 29, 2023 18:29
@jughosta jughosta requested review from a team as code owners September 29, 2023 18:29
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

@andreadelrio
Copy link
Contributor

Looking good! Question, in the future do we have plans to be able to update the labels of the buttons and to show a counter to match the mockups?

image

@kertal
Copy link
Member

kertal commented Oct 3, 2023

Looking good! Question, in the future do we have plans to be able to update the labels of the buttons and to show a counter to match the mockups?

image

yes, about the counter, this is one of the next steps and included in: #167427

@andreadelrio
Copy link
Contributor

Looking good! Question, in the future do we have plans to be able to update the labels of the buttons and to show a counter to match the mockups?
image

yes, about the counter, this is one of the next steps and included in: #167427

@kertal Oh when I said "counter" I was referring to the counters inside the buttons like Columns and Sort fields. We'd need the same for the selected documents like Selected documents [4].

@andreadelrio
Copy link
Contributor

looking nice 👍 one thought, should we consider to make "Selected documents" shorter? Document refer to the ES Documents, but we now have also aggregation results thanks to ES|QL.

Would something like Selection [nr] or Selected [nr] work? wdyt?

I think this would work! I prefer Selected.

@andreadelrio
Copy link
Contributor

andreadelrio commented Oct 17, 2023

@jughosta Where do these buttons go on small screens? I can't seem to find them
image

image

Update: It seems like we don't show those buttons on small screens already so not something introduced by this PR.

}

.dscGridToolbar .euiTabs {
transform: translateY(9px);
Copy link
Contributor

Choose a reason for hiding this comment

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

Reduce to 8px and use EUI variable.

Suggested change
transform: translateY(9px);
transform: translateY($euiSize);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@andreadelrio If we change to 8 then the blue border would be further from the gray border:

Documents tab:
Screenshot 2023-10-18 at 14 59 58

vs Statistics tab:
Screenshot 2023-10-18 at 15 00 07

9px seems to be working better to align both tabs borders visually.

Copy link
Contributor

@davismcphee davismcphee left a comment

Choose a reason for hiding this comment

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

The latest changes look great! And I like the look of bringing the tabs into the table header, although I was personally more of a fan of the borderless version tbh. I think going with borderless tabs could help us get closer to the mockups by replacing the histogram resize handle with a solid border, and it wouldn't look busy with too many borders IMO.

I pulled the branch and made some changes to show what I was thinking, and also opened a PR here with the changes if we like them: jughosta#7. @andreadelrio wdyt?
after

And the same screenshot before the changes for reference:
before

Also the shortened "Selected" label looks better to me as well. @amyjtechwriter does it seem fine for us to shorten this button label from "Selected documents" to "Selected" for extra space in the UI? A screenshot for reference:
image

@andreadelrio
Copy link
Contributor

andreadelrio commented Oct 18, 2023

The latest changes look great! And I like the look of bringing the tabs into the table header, although I was personally more of a fan of the borderless version tbh. I think going with borderless tabs could help us get closer to the mockups by replacing the histogram resize handle with a solid border, and it wouldn't look busy with too many borders IMO.

I pulled the branch and made some changes to show what I was thinking, and also opened a PR here with the changes if we like them: jughosta#7. @andreadelrio wdyt? after

Thanks @davismcphee, this looks very nice! When we remove the resizable icon and add a line it makes a lot of sense to get rid of the line below the tabs. I've put your branch with our mocks side by side and my only comment is: can we add a bit more space between the toolbar and the table's headings? I'm thinking something between 4px and 8px should do it.

image

Copy link
Contributor

@davismcphee davismcphee left a comment

Choose a reason for hiding this comment

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

@andreadelrio great! In that case we should be good to merge my changes into this branch and include them with this PR.

And sure we can add some extra padding below the toolbar. I tried it out with both 4px and 8px and I'm happy with either, so whichever you prefer works for me.

8px:
8px

4px:
4px

@andreadelrio
Copy link
Contributor

@andreadelrio great! In that case we should be good to merge my changes into this branch and include them with this PR.

And sure we can add some extra padding below the toolbar. I tried it out with both 4px and 8px and I'm happy with either, so whichever you prefer works for me.

Thanks for providing the screenshots! Let's go with 4px.

Replace resize handle with border, and small UI touchups
# Conflicts:
#	packages/kbn-unified-data-table/src/components/data_table.tsx
#	src/plugins/discover/public/application/main/components/layout/discover_documents.tsx
#	test/functional/apps/discover/group3/index.ts
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
discover 677 685 +8

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/unified-data-table 44 49 +5

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
cloudSecurityPosture 400.5KB 401.2KB +644.0B
discover 578.4KB 584.8KB +6.4KB
unifiedHistogram 50.2KB 50.3KB +149.0B
total +7.2KB
Unknown metric groups

API count

id before after diff
@kbn/unified-data-table 103 109 +6

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @jughosta

Copy link
Contributor

@davismcphee davismcphee left a comment

Choose a reason for hiding this comment

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

Did one final round of testing after the latest changes, and it's still working well! This a great improvement that brings us very close to our mockups, and especially improves the look and usability of the saved search embeddable. Awesome work, LGTM 👍

Copy link
Contributor

@andreadelrio andreadelrio left a comment

Choose a reason for hiding this comment

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

Amazing job on this team! LGTM.

@jughosta jughosta merged commit a8335fa into elastic:main Oct 19, 2023
@jughosta jughosta deleted the redesign-grid-toolbar branch October 19, 2023 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:Discover Discover Application release_note:skip Skip the PR/issue when compiling release notes Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. v8.12.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[UnifiedDataTable] Migrate Buttons to shared UX toolbar buttons styles
9 participants