Skip to content

Favorite a dashboard from within#201596

Merged
Dosant merged 25 commits intoelastic:mainfrom
Dosant:d/2024-11-25-favorite-dash-from-within
Feb 17, 2025
Merged

Favorite a dashboard from within#201596
Dosant merged 25 commits intoelastic:mainfrom
Dosant:d/2024-11-25-favorite-dash-from-within

Conversation

@Dosant
Copy link
Contributor

@Dosant Dosant commented Nov 25, 2024

stardust1.mov
stardust2.mov
  • Adds favorite button to dashboard page next to the breadcrumb (should look good for both old and new nav)

Screenshot 2025-02-10 at 15 31 15
Screenshot 2025-02-10 at 15 31 21
Screenshot 2025-02-10 at 15 32 42
Screenshot 2025-02-10 at 15 32 46

…vorite-dash-from-within

# Conflicts:
#	src/platform/plugins/shared/dashboard/public/dashboard_top_nav/internal_dashboard_top_nav.tsx
@Dosant Dosant assigned Dosant and unassigned andreadelrio Jan 29, 2025
…vorite-dash-from-within

# Conflicts:
#	src/platform/packages/shared/kbn-typed-react-router-config/src/breadcrumbs/use_breadcrumbs.ts
#	x-pack/solutions/observability/plugins/observability_logs_explorer/public/components/logs_explorer_top_nav_menu.tsx
#	x-pack/solutions/observability/plugins/observability_shared/public/hooks/use_breadcrumbs.ts
@Dosant Dosant changed the title POC favorite a dashboard from within Feb 10, 2025
* Attempts to reuse existing query client otherwise fallbacks to a default one.
*/
export function MaybeQueryClientProvider({ children }: React.PropsWithChildren) {
const client = React.useContext(defaultContext);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I reworked a bit query client provider in table list view to allow re-using existing QueryClientProvider. This allowed to share cache for favorites between table list view and dashboard page

el.current = undefined;
});
if (unsetMountPoint) {
unsetMountPoint();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Small improvement to allow to use this component nicer with pattern like chrome.setAppendBreadcrumbExtension

.kbnBody {
.dshTitleBreadcrumbs__updateIcon {
margin-left: $euiSizeXS;
margin-top: calc(-1 * $euiSizeXS / 2);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The edit button inside dashboard breadcrumb looked miss-placed vertically when using new solution nav. This makes it placed nicer and work well for both old and new nav.

Before:

Screenshot 2025-02-10 at 15 39 17

After:

Screenshot 2025-02-10 at 15 39 09


I wonder if we should improve it further and use the same placement pattern and a real button (EuiButtonIcon instead of EuiIcon) for it

<>
{dashboardTitle}
<EuiIcon
tabIndex={0}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

slightly fixing a11y for this edit button, but I wonder if we should improve it further and use the same placement pattern and a real button (EuiButtonIcon instead of EuiIcon) for it


import { QueryClient } from '@tanstack/react-query';

export const dashboardQueryClient = new QueryClient({
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Creating this client allows to re-use favorites cache between landing and dashboard pages

@Dosant Dosant added release_note:enhancement backport:skip This PR does not require backporting Team:SharedUX Platform AppEx-SharedUX (formerly Global Experience) t// labels Feb 11, 2025
@Dosant Dosant marked this pull request as ready for review February 11, 2025 11:34
@Dosant Dosant requested review from a team as code owners February 11, 2025 11:34
@elasticmachine
Copy link
Contributor

Pinging @elastic/appex-sharedux (Team:SharedUX)

@Heenawter Heenawter self-requested a review February 11, 2025 17:24
Copy link
Contributor

@nreese nreese left a comment

Choose a reason for hiding this comment

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

kibana-presentation changes LGTM
code review, tested in chrome

@Heenawter Heenawter removed their request for review February 11, 2025 17:57
Copy link
Contributor

@stratoula stratoula left a comment

Choose a reason for hiding this comment

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

This is cute! LGTM! I only tested the ES|QL starred queries

@Dosant
Copy link
Contributor Author

Dosant commented Feb 13, 2025

@elasticmachine merge upstream

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.

Hi Anton! Thanks for working on this. Please see the comments below:

  1. I'm noticing some styles/animations that come built in with EUI are overcrowding this microinteraction we're adding. I would like it if we could disable some of this EUI styles, something like this:
.euiButtonIcon:hover {
    transform: none !important;   
    background: none;
}

We should leave a comment explaining why we're disabling this behavior. Something like to avoid conflict with star dust animation.

  1. For the Dashboards case I don't think you need margin-top: -2px on StardustWrapper. It's causing the star to look misaligned with the context on its left.
Frame 5
  1. We need to account for when the user has chosen prefers-reduced-motion
@media (prefers-reduced-motion: reduce) {
  .star.active svg {
    animation: none;
  }

  .star.active .stardust {
    animation: none;
  }

  .star.active .stardust circle {
    animation: none;
  }
}
@Dosant Dosant requested a review from andreadelrio February 14, 2025 10:31
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.

@Dosant Left a comment about simplifying some style code. Approving now assuming you can take care of it. Thanks for bringing some delight to Kibana's UI!

Copy link
Contributor

@eokoneyo eokoneyo left a comment

Choose a reason for hiding this comment

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

Tested locally... changes look good! ❇️

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
dashboard 736 740 +4
esql 205 206 +1
eventAnnotationListing 746 748 +2
filesManagement 150 152 +2
graph 279 281 +2
lens 1820 1821 +1
maps 1341 1343 +2
stackAlerts 273 274 +1
visualizations 500 502 +2
total +17

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/content-management-favorites-public 45 47 +2

Async chunks

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

id before after diff
dashboard 531.7KB 535.6KB +3.9KB
esql 235.9KB 237.1KB +1.3KB
eventAnnotationListing 233.7KB 235.0KB +1.3KB
filesManagement 105.0KB 106.3KB +1.3KB
graph 404.6KB 405.9KB +1.3KB
maps 2.9MB 2.9MB +1.3KB
visualizations 363.2KB 364.5KB +1.3KB
total +11.8KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
dashboard 17.5KB 17.5KB +2.0B
esql 10.0KB 10.0KB -1.0B
navigation 12.6KB 12.6KB +21.0B
total +22.0B
Unknown metric groups

API count

id before after diff
@kbn/content-management-favorites-public 46 48 +2

History

cc @Dosant

@Dosant Dosant merged commit 79dfa2e into elastic:main Feb 17, 2025
9 checks passed
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Mar 22, 2025
@florent-leborgne florent-leborgne added the Feature:Dashboard Dashboard related features label Jun 10, 2025
@florent-leborgne
Copy link
Contributor

Added Feature:dashboard for release notes categorization

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting Feature:Dashboard Dashboard related features release_note:enhancement Team:SharedUX Platform AppEx-SharedUX (formerly Global Experience) t// v9.1.0

8 participants