Skip to content

Link to stage from figure modal, fix plotly figure height, and link to env from pipeline YAML#620

Merged
petebachant merged 4 commits into
mainfrom
stages
May 28, 2026
Merged

Link to stage from figure modal, fix plotly figure height, and link to env from pipeline YAML#620
petebachant merged 4 commits into
mainfrom
stages

Conversation

@petebachant
Copy link
Copy Markdown
Member

Resolves #619, resolves #564

@petebachant petebachant changed the title Link to pipeline stage from figure modal, fix plotly figure height, and link to env from pipeline YAML Link to stage from figure modal, fix plotly figure height, and link to env from pipeline YAML May 28, 2026
@petebachant petebachant requested a review from Copilot May 28, 2026 19:13
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 stage search param; YAML highlights the stage and Mermaid diagram pans/zooms to it; environment refs become links.
  • Environments page accepts a name search param and opens the view modal accordingly; figure modal gains a FigureInfo panel linking to files/pipeline.
  • FigureView gains a fillHeight mode so tall Plotly figures fit modal height; pipeline YAML helpers extracted into lib/pipelineYaml.ts with 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>
@petebachant petebachant merged commit 04e546b into main May 28, 2026
4 checks passed
@petebachant petebachant deleted the stages branch May 28, 2026 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tall Plotly figures overflow vertically in the figure modal I want to be able to see the provenance or source for a figure

2 participants