Skip to content

GraphView exposed via pluginLib needs an "embedded" mode for use on detail pages #7242

Description

@danbruno101

#6992 exposes GraphView through window.pluginLib.ResourceMap — thank you,
this unblocked embedding graphs in the kro plugin (headlamp-k8s/plugins,
kro 0.2.0-alpha). Using it on plugin detail pages surfaced a set of
behaviors that make sense for the full-page Map but are surprising for an
embedded section. Requesting an opt-in embedded mode (or props) that:

  1. Controlled/uncontrolled selection without URL sync. GraphView reads
    and writes the page's ?node= and ?group= query params
    (useQueryParamsState), so an embedded graph mutates the host page's URL
    and participates in browser history. Two GraphViews on one page would
    fight over the same params. An embedded mode should keep selection in
    component state (or accept selectedNode/onNodeSelect props).
  2. No global namespace-filter coupling. Mounting dispatches
    setNamespaceFilter([]) when the URL has no ?namespace=, resetting the
    user's app-wide namespace selection as a side effect of visiting any page
    that embeds a graph.
  3. Sources isolation. defaultSources is appended to, not substituted
    for, all globally registered plugin sources; there is no way to render
    only the sources the caller passes. (Today the workaround is
    defaultNodeSelection + connected-component collapsing, plus id-matched
    first-wins dedupe.)
  4. Hideable chrome. The namespace autocomplete, source picker, group-by
    chips, and filters cannot be hidden; an embedded section usually wants
    just the canvas (or a reduced toolbar).
  5. Skip unneeded discovery. useGetAllSources() (cluster-wide CRD list,
    API discovery, VPA/Gateway probes) runs even when the caller passes
    defaultSources only.
  6. Minor: GraphViewProps is not exported from the barrel, so plugin
    wrappers cannot type their pass-through props; and the lazy wrapper's
    Suspense fallback={null} causes a layout jump unless the caller
    reserves height.

Alternatively, exporting the lower-level pieces (GraphRenderer,
GraphSourceManager, applyGraphLayout, GraphNodeDetails) would let
plugins compose a bare renderer themselves.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions