Skip to content

[ENHANCEMENT]: Add dashboard-level links support#67

Open
prakhar29jain wants to merge 1 commit intoperses:mainfrom
prakhar29jain:dashboard-links
Open

[ENHANCEMENT]: Add dashboard-level links support#67
prakhar29jain wants to merge 1 commit intoperses:mainfrom
prakhar29jain:dashboard-links

Conversation

@prakhar29jain
Copy link

@prakhar29jain prakhar29jain commented Feb 23, 2026

Description

Adds support for dashboard-level links, allowing users to navigate between dashboards or external resources while preserving variable context.

Merge Panel level and Dashboard level Links support for scalability.

perses/perses#3905

Screenshots

UX-1:
image

UX-2:

image

Working after Variables rendering -

image

Checklist

  • Pull request has a descriptive title and context useful to a reviewer.
  • Pull request title follows the [<catalog_entry>] <commit message> naming convention using one of the
    following catalog_entry values: FEATURE, ENHANCEMENT, BUGFIX, BREAKINGCHANGE, DOC,IGNORE.
  • All commits have DCO signoffs.

UI Changes

  • Changes that impact the UI include screenshots and/or screencasts of the relevant changes.
  • Code follows the UI guidelines.
  • E2E tests are stable and unlikely to be flaky.
    See e2e docs for more details. Common issues include:
    • Is the data inconsistent? You need to mock API requests.
    • Does the time change? You need to use consistent time values or mock time utilities.
    • Does it have loading states? You need to wait for loading to complete.

@prakhar29jain prakhar29jain requested a review from a team as a code owner February 23, 2026 06:28
@prakhar29jain prakhar29jain force-pushed the dashboard-links branch 2 times, most recently from 73a717c to 5c0ea97 Compare February 23, 2026 06:37
@prakhar29jain prakhar29jain changed the title [ENHANCEMENT]: ^Cpport Dashboards links for internal and external nav… [ENHANCEMENT]: Add dashboard-level links support Feb 23, 2026
@prakhar29jain prakhar29jain changed the title [ENHANCEMENT]: Add dashboard-level links support [ENHANCEMENT]: Add dashboard-level links support #1642 Feb 23, 2026
@prakhar29jain prakhar29jain changed the title [ENHANCEMENT]: Add dashboard-level links support #1642 [ENHANCEMENT]: Add dashboard-level links support Feb 23, 2026
@Gladorme
Copy link
Member

Gladorme commented Feb 23, 2026

Only checked screenshot, please use the same layout as others drawers / editors

);
}

function DashboardLinkMenuItem({ link }: { link: Link }): ReactElement {
Copy link
Contributor

Choose a reason for hiding this comment

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

Same remark as above

);
}

function useLink(link: Link): Link {
Copy link
Contributor

Choose a reason for hiding this comment

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

same remark as above

@prakhar29jain
Copy link
Author

I became more ambitious and went forward create a single component for Displaying Links...
This covers both Panel and Dashboard level links
@AntoineThebaud

@AntoineThebaud
Copy link
Contributor

AntoineThebaud commented Feb 27, 2026

Remarks for the UI after trying out locally:

  • links should also be displayed in edit mode imho
  • the theming isnt great in dark mode:
    image
    -> I'd say the simplest solution is to change the icon color to white
  • the theming here is also "too much" in case of invalid link imho
    image
    just the strings displayed in red is enough imho, but the rendering in white them is ok
    image
    so maybe you can try to find a background color that has less contrast with the rest of the popup
  • it lacks a bit of spacing between the chips
    image
  • I played the mean QA here and it doesnt like it :D
    image
    -> I guess for the switch from chips to dropdown button, it could as well apply when the links container exceeds a certain width
  • there's some useless empty space in the editor that could be used to show more of the links:
    image

@prakhar29jain
Copy link
Author

Dark Mode UI with proper spacing in chips ✅:

image

Small Size of tables rows and Links now can be viewed in edit mode ✅:

image

Conditional/Dynamic chips rendering ✅:
Max character limit for the name(30) and url(70)to prevent overflow in the dashboard title area, but if either the name or url is too long, we will fall back to showing the links in a dropdown menu

Error contrast fixed ✅:

image

@AntoineThebaud
Copy link
Contributor

AntoineThebaud commented Mar 3, 2026

Sorry I wasnt clear when I mentioned "useless empty space", I actually meant horizontal space between columns, not vertical space between each row (though I like the new design that is more compact)

image

It'd be good to display more of the URLs by shrinking the other columns that have quite some unused empty space.

Otherwise looks good!

…iagtion

Signed-off-by: Prakhar JAIN <prakhar29jain@gmail.com>
@prakhar29jain
Copy link
Author

New Design I believe that the name should be at least shown completely for better accesibility :

image

Copy link
Member

@Gladorme Gladorme left a comment

Choose a reason for hiding this comment

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

Nice PR, some comments ;)

sx={{ backgroundColor: (theme) => theme.palette.primary.main + (isEditMode ? '30' : '0') }}
>
{dashboardTitle}
{dashboardLinks.length > 0 && (
Copy link
Member

Choose a reason for hiding this comment

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

We need to check if isLinksEnabled is enabled here too

// Default: show dropdown menu for multiple links
return (
<>
<InfoTooltip description={`${links.length} links`} enterDelay={100}>
Copy link
Member

Choose a reason for hiding this comment

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

IMO, if there is only one link, it should not display a menu on the dashboard, the link could be directly clickable. Can be improved later in another PR, if others are fine with that

<TableContainer>
<Table size="small" sx={{ tableLayout: 'fixed', width: '100%' }} aria-label="table of dashboard links">
<TableHead>
<TableRow>
Copy link
Member

Choose a reason for hiding this comment

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

Let's use all the place available

<TableRow>
                  <TableCell>Name</TableCell>
                  <TableCell>URL</TableCell>
                  <TableCell width={80}>New Tab</TableCell>
                  <TableCell align="right" width={180}>
                    Actions
                  </TableCell>
                </TableRow>

<TableCell component="th" scope="row" sx={{ fontWeight: 'bold', overflow: 'hidden', textOverflow: 'ellipsis' }}>
{displayName}
</TableCell>
<TableCell
Copy link
Member

Choose a reason for hiding this comment

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

URL is wrap, title will help to see all url on hover, we could use tooltip, but I think title is enough

<TableCell
  title={link.url || '(no URL)'}
  ...

display?: Display;
datasources?: Record<string, DatasourceSpec>;
links?: Link[];
setLinks: (links: Link[]) => void;
Copy link
Member

Choose a reason for hiding this comment

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

In readonly mode with embedded usage, it not useful to useful to define this method. Make it optional

setLinks?: (links: Link[]) => void;

I wonder if we should not use Slice instead too 🤔

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants