Link to stage from figure modal, fix plotly figure height, and link to env from pipeline YAML#620
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds cross-navigation between pipeline-related views (figure/publication info → pipeline stage; pipeline YAML environment refs → environments page) and fixes Plotly figure height in the artifact modal.
Changes:
- Pipeline page accepts a
stagesearch param; YAML highlights the stage and Mermaid diagram pans/zooms to it; environment refs become links. - Environments page accepts a
namesearch param and opens the view modal accordingly; figure modal gains aFigureInfopanel linking to files/pipeline. FigureViewgains afillHeightmode so tall Plotly figures fit modal height; pipeline YAML helpers extracted intolib/pipelineYaml.tswith unit tests.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/routes/_layout/$accountName/$projectName/_layout/pipeline.tsx | Adds stage search param, highlights stage YAML, links env refs, passes zoomToStage to Mermaid. |
| frontend/src/routes/_layout/$accountName/$projectName/_layout/publications.tsx | Stage value linked to pipeline page with stage query param. |
| frontend/src/routes/_layout/$accountName/$projectName/_layout/environments.tsx | Adds name search param to drive the view modal via navigation. |
| frontend/src/lib/pipelineYaml.ts | New helpers: looksLikePath, extractFilePaths, extractEnvRefs, findStageLineRange. |
| frontend/src/lib/pipelineYaml.test.ts | Unit tests covering the new helpers. |
| frontend/src/components/Common/Mermaid.tsx | Adds zoom-to-stage effect using d3-zoom transforms. |
| frontend/src/components/Common/ArtifactCompareModal.tsx | Adds FigureInfo panel with file/pipeline links; uses fillHeight on Plotly figures. |
| frontend/src/components/Figures/FigureView.tsx | Adds fillHeight mode for Plotly figures. |
| frontend/src/components/Projects/ProjectShowcase.tsx | Wraps showcase items in a single Box with consistent mt. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+61
to
+63
| } else { | ||
| walk(child) | ||
| } |
Comment on lines
+1
to
3
| import { ExternalLinkIcon } from "@chakra-ui/icons" | ||
| /** | ||
| * Modal for viewing an artifact with version comparison support. |
| // Pan/zoom to the requested stage's node once the diagram is rendered. | ||
| useEffect(() => { | ||
| if (!zoomToStage || !zoomBehaviorRef.current) return | ||
| const svgEl = select<SVGSVGElement, unknown>(".mermaid svg").node() |
Comment on lines
+74
to
+108
| /** | ||
| * Find the [start, end) line range of a stage's block within the YAML so it | ||
| * can be highlighted. Works for both calkit.yaml (pipeline.stages.<name>) and | ||
| * dvc.yaml (stages.<name>) by matching the stage key at any indent and | ||
| * extending until the next line at the same or lower indentation. | ||
| */ | ||
| export function findStageLineRange( | ||
| yamlContent: string, | ||
| stage: string, | ||
| ): [number, number] | null { | ||
| const lines = yamlContent.split("\n") | ||
| const keyRe = new RegExp( | ||
| `^(\\s*)(["']?)${stage.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}\\2:\\s*(#.*)?$`, | ||
| ) | ||
| let start = -1 | ||
| let indent = 0 | ||
| for (let i = 0; i < lines.length; i++) { | ||
| const m = lines[i].match(keyRe) | ||
| if (m) { | ||
| start = i | ||
| indent = m[1].length | ||
| break | ||
| } | ||
| } | ||
| if (start === -1) return null | ||
| let end = lines.length | ||
| for (let i = start + 1; i < lines.length; i++) { | ||
| const line = lines[i] | ||
| if (line.trim() === "" || line.trim().startsWith("#")) continue | ||
| const curIndent = line.length - line.trimStart().length | ||
| if (curIndent <= indent) { | ||
| end = i | ||
| break | ||
| } | ||
| } |
Comment on lines
+69
to
+71
| <RouterLink to={envTo} search={{ name: seg } as never}> | ||
| <span style={{ textDecoration: "underline" }}>{seg}</span> | ||
| </RouterLink> |
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.
Resolves #619, resolves #564