Skip to content

feat(links): add global cluster links list page - #696

Draft
omarelkashef wants to merge 2 commits into
canonical:mainfrom
omarelkashef:agents/add-cluster-link-page-react-components
Draft

omarelkashef wants to merge 2 commits into
canonical:mainfrom
omarelkashef:agents/add-cluster-link-page-react-components

Conversation

@omarelkashef

@omarelkashef omarelkashef commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

DO NOT REVIEW; THIS PR WILL BE SPLIT UP INTO SMALLER PRS

feat: add global cluster links list page WD-36618

QA

  • Create 2+ clusters, enroll them in cluster manager, and enable the tunnel.
  • In the nav bar, go to Cluster links.
  • Ensure that the page looks right, showing links, sources, targets, and types.
  • Check sorting(within groups only), searching, filtering work.

Screenshots

image

Pagination splits groups and group header wraps into new page

image image

Tradeoff Brief: Backend aggregation for the cluster links page

Decision needed: Should the management API expose an aggregated GET /1.0/cluster-links endpoint, or should the UI keep fanning out one GET /1.0/remote-cluster/{cluster}/cluster-links request per tunnel-enabled cluster?

Context: The new /ui/cluster-link page lists links across all managed clusters. The management API only proxies per-cluster requests through the cluster-connector and tunnels to each LXD cluster. The UI currently uses React Query useQueries (one query per cluster), flattened and grouped client-side in useClusterLinks.


Option A — UI fan-out (current implementation)

One React Query per tunnel-enabled cluster; results flattened in useClusterLinks.

Pros

  • No backend changes; ships with the UI PR.
  • Progressive rendering: each cluster's links appear as soon as its query resolves; a slow or unreachable cluster never blocks the rest of the page.
  • Per-cluster caching, retries, and error attribution come free from React Query; failed clusters are reported individually ("Unable to load cluster links for X, Y").
  • Create/delete invalidation already reuses the same per-cluster cache keys.

Cons

  • N+1 requests: page load fires one HTTP request per cluster through the management API and cluster-connector.
  • Per-cluster permission and tunnel errors surface in the UI and must be handled there.
  • Client-side aggregation logic (flatten, group, resolve targets) lives in the UI.

Option B — Backend aggregation endpoint

New top-level GET /1.0/cluster-links on the management API. The handler loads all clusters with details, fans out to each tunnel-enabled cluster concurrently (goroutines), and returns a grouped payload, e.g. { cluster, links, error? } per cluster.

Pros

  • One request from the UI regardless of cluster count; better at scale (dozens of clusters).
  • Server-side parallelism with one consistent timeout policy.
  • Simpler UI: a single useQuery; no fan-out hook.
  • Central place for future aggregation features (filtering, counts).

Cons

  • New public API contract: response shape, per-cluster error encoding, and partial-failure semantics must be designed and versioned carefully.
  • UX regression on partial availability: nothing renders until the slowest cluster responds or times out — the current fan-out streams data in progressively.
  • Loses per-cluster cache granularity; any mutation refetches everything (today only the affected cluster's query refetches, though the broad [clusters] invalidation mostly equalizes this).
  • Tunnel timeout tuning becomes page-wide: one hung cluster degrades the whole endpoint.
  • Scope: ~350 lines across handler, response model, OpenAPI spec, unit/OpenAPI/e2e tests, plus a rewrite of useClusterLinks — roughly doubling this PR's review surface.

Comparison

Criterion A: UI fan-out B: Backend aggregation
Requests per page load 1 + N clusters 2 (clusters + links)
Time to first data Fastest cluster Slowest cluster / timeout
Partial failure handling Per-cluster, already built New API semantics to design
Cache granularity Per cluster All or nothing
Backend work None ~200–250 lines Go + tests
UI work Done Rewrite useClusterLinks
Review surface of this PR UI only UI + backend + API contract

Recommendation

Keep Option B

@omarelkashef
omarelkashef marked this pull request as draft October 15, 2026 17:46
@omarelkashef
omarelkashef force-pushed the agents/add-cluster-link-page-react-components branch 2 times, most recently from 0be38fc to ae066a4 Compare October 16, 2026 07:09
@omarelkashef omarelkashef self-assigned this Oct 16, 2026
@github-actions

Copy link
Copy Markdown

@sophiecarroll Design review is needed for this PR.

@omarelkashef
omarelkashef force-pushed the agents/add-cluster-link-page-react-components branch from ae066a4 to c356716 Compare October 16, 2026 07:13
@omarelkashef
omarelkashef marked this pull request as ready for review October 16, 2026 07:13
@sophiecarroll

sophiecarroll commented Oct 16, 2026 •

Copy link
Copy Markdown

Looks great overall, just a few comments/questions.

  1. The create button: currently uses Vanilla in the implementation, and I see some buttons on LXD are starting to migrate to Pragma–are we waiting to change all the "create" buttons to Pragma at the same time? Could we start this process now on cluster manager or do you want to do it at the same time as LXD?

  2. The rows on the grouped table should be all white, referencing these grouped table guidelines: (the darker header row was deprecated for Pragma) https://www.figma.com/design/2MYJvamCVgbyWXZRT7IPan/25.10-Data-table---Design-system-contributions?node-id=4351-77923

  3. Just confirming that if there are more than 2 addresses the cell overflows like this

Screenshot 2026-10-16 at 11 11 52 AM
  1. Also just confirming that the table groups are open by default, with the option to click the chevron to close them

  2. Pagination should be at the bottom: this is actually true for both Vanilla and Pragma but we use the incorrect pattern across LXD (this is something in my UX backlog for next cycle as well). We only have two places where pagination occurs in cluster manager right now (cluster list and cluster link list pages) and the change isn't super disruptive to the layout, so is it possible to use pagination at the bottom for cluster links page, and update pagination to be at the bottom for the cluster page as well?

  3. Delete button should stay on the upper right for bulk delete, not upper left

  4. Last column should be the setting icon as the column header, double action edit/delete in each cell. Is there a reason there's no pencil edit icon, or is that something that will be implemented in a future step?

@omarelkashef

omarelkashef commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor Author

Looks great overall, just a few comments/questions.

  1. The create button: currently uses Vanilla in the implementation, and I see some buttons on LXD are starting to migrate to Pragma–are we waiting to change all the "create" buttons to Pragma at the same time? Could we start this process now on cluster manager or do you want to do it at the same time as LXD?
  2. The rows on the grouped table should be all white, referencing these grouped table guidelines: (the darker header row was deprecated for Pragma) https://www.figma.com/design/2MYJvamCVgbyWXZRT7IPan/25.10-Data-table---Design-system-contributions?node-id=4351-77923
  3. Just confirming that if there are more than 2 addresses the cell overflows like this
Screenshot 2026-10-16 at 11 11 52 AM 4. Also just confirming that the table groups are open by default, with the option to click the chevron to close them 5. Pagination should be at the bottom: this is actually true for both Vanilla and Pragma but we use the incorrect pattern across LXD (this is something in my UX backlog for next cycle as well). We only have two places where pagination occurs in cluster manager right now (cluster list and cluster link list pages) and the change isn't super disruptive to the layout, so is it possible to use pagination at the bottom for cluster links page, and update pagination to be at the bottom for the cluster page as well? 6. Delete button should stay on the upper right for bulk delete, not upper left 7. Last column should be the setting icon as the column header, double action edit/delete in each cell. Is there a reason there's no pencil edit icon, or is that something that will be implemented in a future step?

1- Changing the icon proved to be a non-trivial task in LXD. It will be out of scope here. But we can create a follow up ticket.
2- I see all the rows white 😂 Which ones are you referencing?
3- Yes, when there are more addresses, they show like this
image
4- Yes
5, 6, 7- Ok I will update them. The pencil is not included now because editing is coming in another PR.

@omarelkashef

Copy link
Copy Markdown
Contributor Author

Looks great overall, just a few comments/questions.

  1. The create button: currently uses Vanilla in the implementation, and I see some buttons on LXD are starting to migrate to Pragma–are we waiting to change all the "create" buttons to Pragma at the same time? Could we start this process now on cluster manager or do you want to do it at the same time as LXD?
  2. The rows on the grouped table should be all white, referencing these grouped table guidelines: (the darker header row was deprecated for Pragma) https://www.figma.com/design/2MYJvamCVgbyWXZRT7IPan/25.10-Data-table---Design-system-contributions?node-id=4351-77923
  3. Just confirming that if there are more than 2 addresses the cell overflows like this
Screenshot 2026-10-16 at 11 11 52 AM 4. Also just confirming that the table groups are open by default, with the option to click the chevron to close them 5. Pagination should be at the bottom: this is actually true for both Vanilla and Pragma but we use the incorrect pattern across LXD (this is something in my UX backlog for next cycle as well). We only have two places where pagination occurs in cluster manager right now (cluster list and cluster link list pages) and the change isn't super disruptive to the layout, so is it possible to use pagination at the bottom for cluster links page, and update pagination to be at the bottom for the cluster page as well? 6. Delete button should stay on the upper right for bulk delete, not upper left 7. Last column should be the setting icon as the column header, double action edit/delete in each cell. Is there a reason there's no pencil edit icon, or is that something that will be implemented in a future step?

1- Changing the icon proved to be a non-trivial task in LXD. It will be out of scope here. But we can create a follow up ticket. 2- I see all the rows white 😂 Which ones are you referencing? 3- Yes, when there are more addresses, they show like this image 4- Yes 5, 6, 7- Ok I will update them. The pencil is not included now because editing is coming in another PR.

@sophiecarroll new screenshots

imageimage
image

@omarelkashef
omarelkashef force-pushed the agents/add-cluster-link-page-react-components branch from c356716 to 0a6bb09 Compare October 16, 2026 13:29
@sophiecarroll

sophiecarroll commented Oct 16, 2026 •

Copy link
Copy Markdown

Thanks!

I see all the rows white 😂 Which ones are you referencing

The rows that contain the cluster (group row) are currently showing a muted grey in the background

Just confirming that if there are more than 2 addresses the cell overflows like this

Could we use the overlay component instead of tooltip? For learnability (also consistency with other apps), we should stick with the tooltip as describing/learning about an entity, while overlay is for information and data that expands beyond the space available (see launchpad examples here)
Screenshot 2026-10-16 at 3 28 08 PM
Screenshot 2026-10-16 at 3 27 44 PM

New screenshots look good, I'm just wondering what is the rectangle on microcloud-01 cluster name in the first screenshot?

@omarelkashef
omarelkashef force-pushed the agents/add-cluster-link-page-react-components branch from 0a6bb09 to 68155ca Compare October 16, 2026 13:45
@omarelkashef

omarelkashef commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor Author

Could we use the overlay component instead of tooltip? For learnability (also consistency with other apps), we should stick with the tooltip as describing/learning about an entity, while overlay is for information and data that expands beyond the space available (see launchpad examples here)

which vanilla component should we use?

New screenshots look good, I'm just wondering what is the rectangle on microcloud-01 cluster name in the first screenshot?

I was just hovering over the name

@sophiecarroll

@sophiecarroll

sophiecarroll commented Oct 19, 2026 •

Copy link
Copy Markdown

Could we use the overlay component instead of tooltip? For learnability (also consistency with other apps), we should stick with the tooltip as describing/learning about an entity, while overlay is for information and data that expands beyond the space available (see launchpad examples here)

which vanilla component should we use?

"Contextual menu"

Let me know when you have new screenshots and it should be good to go from design

@omarelkashef

Copy link
Copy Markdown
Contributor Author

@sophiecarroll newest screenshots:

image image

@sophiecarroll

Copy link
Copy Markdown

@sophiecarroll newest screenshots:

image image

Ok almost all done, just 2 things:

  1. Chevron should be to the left of the checkbox (in its own leftmost column, meaning that cluster column with the checkboxes and names still line up vertically–you can reference the Figma design for the visual)
  2. The "+x" for addresses should go on a second line: so if there are 2, the 2 addresses show and the row increases in height to account for that, and then if there are 3+ it shows the 1 and +x under. I double checked and we do have tables that have two rows within a cell in Warnings and Operations, so we've used the pattern before. This applies to description and other column overflows as well: default 1 row, overflow 2 rows, and then overflow truncation.

@omarelkashef

omarelkashef commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor Author
  • Chevron should be to the left of the checkbox (in its own leftmost column, meaning that cluster column with the checkboxes and names still line up vertically–you can reference the Figma design for the visual)
  • The "+x" for addresses should go on a second line: so if there are 2, the 2 addresses show and the row increases in height to account for that, and then if there are 3+ it shows the 1 and +x under. I double checked and we do have tables that have two rows within a cell in Warnings and Operations, so we've used the pattern before. This applies to description and other column overflows as well: default 1 row, overflow 2 rows, and then overflow truncation.

@sophiecarroll
image

Everything is good, except the chevrons shouldn't have that grey box around them (background should match white of row). I'll go ahead and give my design +1 now!

@omarelkashef
omarelkashef force-pushed the agents/add-cluster-link-page-react-components branch from 68155ca to 908642c Compare October 19, 2026 12:43
@Kxiru

Kxiru commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

@omarelkashef , as the cluster link checkboxes are included on each row, do you plan to implement any kind of bulk actions in this same PR? Or is this ready for code/qa review already?

@omarelkashef

Copy link
Copy Markdown
Contributor Author

@omarelkashef , as the cluster link checkboxes are included on each row, do you plan to implement any kind of bulk actions in this same PR? Or is this ready for code/qa review already?

Can you elaborate? If you check more than one box, you can bulk delete them. If you check the box next to the group itself, everything inside is selected. Yes, it is ready for QA and review. I will add some instructions.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Comment on lines +101 to +107
for index, cluster := range clusters {
name := cluster.Name
workers.Go(func() error {
result := clusterLinksResult{links: []api.ClusterLink{}}
defer func() {
results[index] = result
}()
Comment thread internal/pkg/request/proxy.go Resolved
Comment thread ui/src/api/clusters.ts Resolved
Comment thread ui/src/components/NavLink.tsx Resolved
@kimanhou

Copy link
Copy Markdown
Contributor

Hi @omarelkashef could you please rebase and resolve conflicts ?

Signed-off-by: Omar Elkashef <omarelkashef01@gmail.com>
@omarelkashef
omarelkashef force-pushed the agents/add-cluster-link-page-react-components branch from cd913ff to 889d5c9 Compare November 18, 2026 15:29
Copilot AI lite review requested due to automatic review settings November 18, 2026 15:29

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@sophiecarroll

Copy link
Copy Markdown

Commenting this from MM decisions:

  1. Removing settings icon as actions column header (unless we decide to show/hide columns)

  2. Sorry this is last minute but I remembered a conversation we had about "used by" being vague. Can we add a tooltip to the Used by column that says "Number of repositories and replicators using the cluster link" or is it too late?

@kimanhou kimanhou left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This PR is really big, is there a way to divide it into smaller ones ?

Below some findings after doing QA:

The settings icon is still here, could you please remove it ?

The search and filter doesn't include "Cluster", only "Link type".

The edit icon on each row is missing.

On hover, the delete icon does not seem centered compared to its background.
image

@sophiecarroll
I didn't find any reference in the figma file when the target cluster is not enrolled in MCM. Should "unknown" be muted ?
image

@omarelkashef

omarelkashef commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor Author

This PR is really big, is there a way to divide it into smaller ones ?

It is only one page in the UI, so I can't think of a way to split it.

Below some findings after doing QA:

The settings icon is still here, could you please remove it ?

Yes, removed locally but have not pushed yet.

The search and filter doesn't include "Cluster", only "Link type".

What do you mean? To search for a cluster, just type its name in the search bar. Do you want all the clusters to appear as options in the filter? I do not think we do that in other places.

The edit icon on each row is missing.

Yes, good catch!

On hover, the delete icon does not seem centered compared to its background. image

I can not see it 😂

@kimanhou

Copy link
Copy Markdown
Contributor

@omarelkashef

Do you want all the clusters to appear as options in the filter?

That's what I understand from the design. @sophiecarroll ?

Screenshot from 2026-11-19 09-53-31

I can not see it 😂

The icon sits too high. Or the background is too low maybe ?

@sophiecarroll

Copy link
Copy Markdown

This PR is really big, is there a way to divide it into smaller ones ?

Below some findings after doing QA:

The settings icon is still here, could you please remove it ?

The search and filter doesn't include "Cluster", only "Link type".

The edit icon on each row is missing.

On hover, the delete icon does not seem centered compared to its background. image

@sophiecarroll I didn't find any reference in the figma file when the target cluster is not enrolled in MCM. Should "unknown" be muted ? image

That was an oversight, I thought I had the edge case but I don't think I do–I'm not sure "unknown" is the best option for this I'm going to see what cluster permission denied patterns we have, also what does the tooltip say?

@omarelkashef

Copy link
Copy Markdown
Contributor Author

This PR is really big, is there a way to divide it into smaller ones ?
Below some findings after doing QA:
The settings icon is still here, could you please remove it ?
The search and filter doesn't include "Cluster", only "Link type".
The edit icon on each row is missing.
On hover, the delete icon does not seem centered compared to its background. image
@sophiecarroll I didn't find any reference in the figma file when the target cluster is not enrolled in MCM. Should "unknown" be muted ? image

That was an oversight, I thought I had the edge case but I don't think I do–I'm not sure "unknown" is the best option for this I'm going to see what cluster permission denied patterns we have, also what does the tooltip say?

The tooltip says "The linked cluster might not be enrolled in this cluster manager." This is not necessarily a permission error. It is when a link targets a cluster that is not in cluster manager.

@sophiecarroll

sophiecarroll commented Nov 19, 2026 •

Copy link
Copy Markdown

The tooltip says "The linked cluster might not be enrolled in this cluster manager." This is not necessarily a permission error. It is when a link targets a cluster that is not in cluster manager.

I was thinking about similar patterns where "it exists but we can't see it." Is it possible that we could not have permission to view a target cluster on a link in CM? Would this automatically return "-" if so?

@omarelkashef

Copy link
Copy Markdown
Contributor Author

The tooltip says "The linked cluster might not be enrolled in this cluster manager." This is not necessarily a permission error. It is when a link targets a cluster that is not in cluster manager.

I was thinking about similar patterns where "it exists but we can't see it." Is it possible that we could not have permission to view a target cluster on a link in CM? Would this automatically return "-" if so?

No, currently in cluster manager, you can either see all clusters or not at all.

@sophiecarroll

Copy link
Copy Markdown

The tooltip says "The linked cluster might not be enrolled in this cluster manager." This is not necessarily a permission error. It is when a link targets a cluster that is not in cluster manager.

I was thinking about similar patterns where "it exists but we can't see it." Is it possible that we could not have permission to view a target cluster on a link in CM? Would this automatically return "-" if so?

No, currently in cluster manager, you can either see all clusters or not at all.

In that case, could we put "not registered" in the target cell? It seems like we either know the name because the cluster is registered, or we don't know the name because it's not registered. Is there any other reason we wouldn't know the name, if permission is not an issue?

@omarelkashef
omarelkashef force-pushed the agents/add-cluster-link-page-react-components branch from 889d5c9 to 6a98b7e Compare November 19, 2026 10:00
Copilot AI lite review requested due to automatic review settings November 19, 2026 10:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Comment thread internal/pkg/request/proxy.go Resolved
@omarelkashef

Copy link
Copy Markdown
Contributor Author

The tooltip says "The linked cluster might not be enrolled in this cluster manager." This is not necessarily a permission error. It is when a link targets a cluster that is not in cluster manager.

I was thinking about similar patterns where "it exists but we can't see it." Is it possible that we could not have permission to view a target cluster on a link in CM? Would this automatically return "-" if so?

No, currently in cluster manager, you can either see all clusters or not at all.

In that case, could we put "not registered" in the target cell? It seems like we either know the name because the cluster is registered, or we don't know the name because it's not registered. Is there any other reason we wouldn't know the name, if permission is not an issue?

There are cases where the cluster link has addresses that we do not know about and we can not do the matching so "Unregistered" announces something that might not be true. How about "Unidentified"?

Signed-off-by: Omar Elkashef <omarelkashef01@gmail.com>
@omarelkashef
omarelkashef force-pushed the agents/add-cluster-link-page-react-components branch from 6a98b7e to 584cc1e Compare November 19, 2026 10:31
Copilot AI lite review requested due to automatic review settings November 19, 2026 10:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Comment thread internal/pkg/request/proxy.go Resolved
Comment thread ui/src/api/clusters.ts Resolved
@Kxiru

Kxiru commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Please rebase on main to resolve outstanding conflicts. Thank you for your time on this PR so far it's quite hefty!
A few Qs:

  1. (Asked on MM) Did we decide on implementing an aggregated backend endpoint for the clusterlinks page (Option B) or are we still sticking to option A right now?
  2. Now that the Cluster link tab table is merged, please do give that a once over. Happy to jump into a WT call to align on some of the logic there. For example, Used-by resource derivation logic has already been implemented in my PR and can be found in ClusterLinksTable.tsx from lines 113-135.

@omarelkashef
omarelkashef marked this pull request as draft November 20, 2026 16:21

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants