Skip to content

feat(graph): add toolbar menu, image export, and node pod phase resolution - #921

Merged
kyasbal merged 2 commits into
GoogleCloudPlatform:mainfrom
kyasbal:push-kxymsxqwlxuw
Aug 28, 2026
Merged

kyasbal merged 2 commits into
GoogleCloudPlatform:mainfrom
kyasbal:push-kxymsxqwlxuw

Conversation

@kyasbal

@kyasbal kyasbal commented Aug 28, 2026

Copy link
Copy Markdown
Member

Summary

Adds a toolbar menu to the architecture graph view with fit-to-view, SVG/PNG export, and a deleted resource retention slider. Also improves backend architecture graph building by resolving pods under nodes from PodPhase timelines when manifests lack node names or are metadata-only.

Key Changes

  • Backend (pkg/server/workbench/architecturegraph):
    • Resolves pods under nodes from length 6 PodPhase timelines (core/v1/node/cluster-scope/<nodeName>/<namespace>/<podName>[<uid>]).
    • Supports synthetic pod creation for pods that appear only as child PodPhase timelines under a node.
    • Implements fallback extraction for containers and conditions from child timelines when resource manifests are unavailable (reader == nil).
    • Unifies Kubernetes pod phase health evaluation across manifest and timeline parsing (isPodPhaseHealthy()).
  • Frontend Toolbar & Export (web/src/app/graph/, web/src/app/pages/graph/):
    • Introduces GraphToolbarComponent with:
      • Fit to view button to center and zoom the architecture graph.
      • Download image menu supporting SVG and PNG export with high-resolution canvas rasterization.
      • Deletion retention slider to dynamically adjust the duration that deleted resources remain visible.
    • Follows Smart-Dumb component architecture (GraphLayoutComponent & GraphToolbarComponent).
    • Standardizes icon button sizing and centered icons via SCSS mixins.
  • Tests & Quality:
    • Unit tests for GraphToolbarComponent, GraphLayoutComponent, GraphRoot, GraphDownloadService, svg-export-util, and time-format-util.
    • Comprehensive table-driven tests for backend Builder including synthetic pods, nil manifest fallback, and pod phase parsing.
    • Storybook stories for GraphToolbarComponent and GraphLayoutComponent.

Testing

  • make test-go
  • make test-web
  • make lint-go
  • make lint-web
  • make build-web
  • make build-storybook
  • make pre-commit
…ution

- Add architecture graph toolbar with fit-to-view, SVG/PNG export, and deletion retention slider
- Resolve pods under nodes from pod phase timelines in backend architecture graph builder
- Provide fallback resolution for containers and conditions when manifests are unavailable
- Add comprehensive unit tests and storybook stories for toolbar and layout components

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request enhances the backend architecture graph builder to resolve pod phases, node placements, and container/condition fallbacks from child timelines when manifests are incomplete. On the frontend, it introduces a graph toolbar with a resource retention slider, fit-to-view controls, and improved SVG/PNG export capabilities. The reviewer identified a critical logic bug in the backend fallback loop that prematurely terminates container/condition processing, recommended filtering allowed timelines earlier to prevent inconsistent pod updates, and suggested optimizing the PNG export utility by using object URLs instead of encoding large SVG strings as data URIs.

…RL export

- Capture fallbackContainers and fallbackConditions before loop to preserve multiple containers and conditions
- Clarify design rationale for allowedTimelines filtering on podPhaseMap merge
- Use exportSvgToBlob and URL.createObjectURL in exportSvgToPngBlob and revoke in onload/onerror
@kyasbal
kyasbal merged commit 88d46e9 into GoogleCloudPlatform:main Aug 28, 2026
16 checks passed
@kyasbal
kyasbal deleted the push-kxymsxqwlxuw branch August 28, 2026 05:24
@kyasbal kyasbal added type:feature New feature or request area:frontend Web frontend application and UI components labels Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:frontend Web frontend application and UI components type:feature New feature or request

1 participant