[ENHANCEMENT]: Add dashboard-level links support#67
Open
prakhar29jain wants to merge 1 commit intoperses:mainfrom
Open
[ENHANCEMENT]: Add dashboard-level links support#67prakhar29jain wants to merge 1 commit intoperses:mainfrom
prakhar29jain wants to merge 1 commit intoperses:mainfrom
Conversation
34d74d8 to
73a717c
Compare
…iagtion Signed-off-by: Prakhar JAIN <prakhar29jain@gmail.com>
73a717c to
5c0ea97
Compare
Member
|
Only checked screenshot, please use the same layout as others drawers / editors |
Comment on lines
+46
to
+62
| // If there is only one link, show it directly as a chip | ||
| if (links.length === 1 && links[0]) { | ||
| const link = links[0]; | ||
| return <DashboardLinkChip link={link} />; | ||
| } | ||
|
|
||
| // If there are 2-3 links, show them all as chips | ||
| if (links.length <= 3) { | ||
| return ( | ||
| <Stack direction="row" spacing={0.5} alignItems="center"> | ||
| {links.map((link) => ( | ||
| <DashboardLinkChip key={link.url} link={link} /> | ||
| ))} | ||
| </Stack> | ||
| ); | ||
| } | ||
|
|
Contributor
There was a problem hiding this comment.
I think it's ok to remove the first return & go through the loop when there's only 1 link?
Suggested change
| // If there is only one link, show it directly as a chip | |
| if (links.length === 1 && links[0]) { | |
| const link = links[0]; | |
| return <DashboardLinkChip link={link} />; | |
| } | |
| // If there are 2-3 links, show them all as chips | |
| if (links.length <= 3) { | |
| return ( | |
| <Stack direction="row" spacing={0.5} alignItems="center"> | |
| {links.map((link) => ( | |
| <DashboardLinkChip key={link.url} link={link} /> | |
| ))} | |
| </Stack> | |
| ); | |
| } | |
| // If there are a few links, show them all as chips | |
| if (links.length <= 3) { | |
| return ( | |
| <Stack direction="row" spacing={0.5} alignItems="center"> | |
| {links.map((link) => ( | |
| <DashboardLinkChip key={link.url} link={link} /> | |
| ))} | |
| </Stack> | |
| ); | |
| } | |
| } | ||
|
|
||
| // For more than 3 links, show a menu | ||
| return ( |
Contributor
There was a problem hiding this comment.
this part is very similar to its PanelLinks counterpart; could you try to factorize & reuse here?
| ); | ||
| } | ||
|
|
||
| function DashboardLinkMenuItem({ link }: { link: Link }): ReactElement { |
Contributor
There was a problem hiding this comment.
Same remark as above
| ); | ||
| } | ||
|
|
||
| function useLink(link: Link): Link { |
Contributor
There was a problem hiding this comment.
same remark as above
This was referenced Feb 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds support for dashboard-level links, allowing users to navigate between dashboards or external resources while preserving variable context.
perses/perses#3905
Screenshots
UX-1:
UX-2:
Working after Variables rendering -
Checklist
[<catalog_entry>] <commit message>naming convention using one of thefollowing
catalog_entryvalues:FEATURE,ENHANCEMENT,BUGFIX,BREAKINGCHANGE,DOC,IGNORE.UI Changes
See e2e docs for more details. Common issues include: