forked from Cloud-Pipelines/pipeline-editor
-
Notifications
You must be signed in to change notification settings - Fork 7
feat: v2 - mini content for collapsed docked windows #2188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
maxy-shpfy
merged 1 commit into
master
from
05-01-feat_v2_-_mini_content_for_collapsed_docked_windows
May 15, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
src/routes/v2/pages/Editor/components/ComponentLibraryWindowMiniContent.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| import TooltipButton from "@/components/shared/Buttons/TooltipButton"; | ||
| import { Icon } from "@/components/ui/icon"; | ||
|
|
||
| export function ComponentLibraryWindowMiniContent() { | ||
| return ( | ||
| <TooltipButton | ||
| tooltip="View Component Library" | ||
| tooltipSide="right" | ||
| variant="outline" | ||
| size="icon" | ||
| aria-label="Components" | ||
| > | ||
| <Icon name="LayoutGrid" size="sm" className="text-gray-700" /> | ||
| </TooltipButton> | ||
| ); | ||
| } |
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
46 changes: 46 additions & 0 deletions
46
src/routes/v2/pages/Editor/components/PipelineTreeContent/PipelineTreeWindowMiniContent.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| import { observer } from "mobx-react-lite"; | ||
|
|
||
| import TooltipButton from "@/components/shared/Buttons/TooltipButton"; | ||
| import { Icon } from "@/components/ui/icon"; | ||
| import { | ||
| countErrors, | ||
| countWarnings, | ||
| } from "@/routes/v2/pages/Editor/components/ValidationSummary"; | ||
| import { useSharedStores } from "@/routes/v2/shared/store/SharedStoreContext"; | ||
|
|
||
| import { IssueBadge } from "./components/IssueBadge"; | ||
|
|
||
| export const PipelineTreeWindowMiniContent = observer( | ||
| function PipelineTreeWindowMiniContent() { | ||
| const { navigation } = useSharedStores(); | ||
| const rootSpec = navigation.rootSpec; | ||
| const issues = rootSpec?.allValidationIssues ?? []; | ||
| const errorCount = countErrors(issues); | ||
| const warningCount = countWarnings(issues); | ||
| const hasIssues = errorCount > 0 || warningCount > 0; | ||
| const showValidBadge = rootSpec !== undefined && !hasIssues; | ||
|
|
||
| return ( | ||
| <TooltipButton | ||
| tooltip="View Pipeline Structure" | ||
| tooltipSide="right" | ||
| variant="outline" | ||
| size="icon" | ||
| className="relative" | ||
| aria-label="Pipeline Structure" | ||
| > | ||
| <Icon name="GitBranch" size="sm" className="text-gray-700" /> | ||
| {showValidBadge && ( | ||
| <span className="pointer-events-none absolute -bottom-0.5 -right-0.5 flex size-3.5 items-center justify-center rounded-full bg-white shadow-sm ring-1 ring-green-200"> | ||
| <Icon name="CircleCheck" size="xs" className="text-green-600" /> | ||
| </span> | ||
| )} | ||
| {rootSpec && hasIssues && ( | ||
| <span className="pointer-events-none absolute -top-1 -right-1"> | ||
| <IssueBadge issues={issues} /> | ||
| </span> | ||
| )} | ||
| </TooltipButton> | ||
| ); | ||
| }, | ||
| ); |
17 changes: 17 additions & 0 deletions
17
src/routes/v2/pages/Editor/components/RunsAndSubmissionWindowMiniContent.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| import { observer } from "mobx-react-lite"; | ||
|
|
||
| import { QuickRunButton } from "@/routes/v2/pages/Editor/components/EditorMenuBar/components/QuickRunButton"; | ||
|
|
||
| export const RunsAndSubmissionWindowMiniContent = observer( | ||
| function RunsAndSubmissionWindowMiniContent() { | ||
| return ( | ||
| <QuickRunButton | ||
| variant="mini" | ||
| tooltipSide="right" | ||
| renderSubmitter={false} | ||
| trackingKey="v2.pipeline_editor.quick_run_mini" | ||
| onPointerDown={(event) => event.stopPropagation()} | ||
| /> | ||
| ); | ||
| }, | ||
| ); |
23 changes: 12 additions & 11 deletions
23
src/routes/v2/pages/Editor/hooks/useComponentLibraryWindow.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,24 @@ | ||
| import { useEffect } from "react"; | ||
|
|
||
| import { ComponentLibraryContent } from "@/routes/v2/pages/Editor/components/ComponentLibraryContent"; | ||
| import { ComponentLibraryWindowMiniContent } from "@/routes/v2/pages/Editor/components/ComponentLibraryWindowMiniContent"; | ||
| import { useSharedStores } from "@/routes/v2/shared/store/SharedStoreContext"; | ||
|
|
||
| const COMPONENT_LIBRARY_WINDOW_ID = "component-library"; | ||
|
|
||
| export function useComponentLibraryWindow() { | ||
| const { windows } = useSharedStores(); | ||
| useEffect(() => { | ||
| if (!windows.getWindowById(COMPONENT_LIBRARY_WINDOW_ID)) { | ||
| windows.openWindow(<ComponentLibraryContent />, { | ||
| id: COMPONENT_LIBRARY_WINDOW_ID, | ||
| title: "Components", | ||
| position: { x: 0, y: 100 }, | ||
| size: { width: 280, height: 350 }, | ||
| disabledActions: ["close"], | ||
| persisted: true, | ||
| defaultDockState: "left", | ||
| }); | ||
| } | ||
| if (windows.getWindowById(COMPONENT_LIBRARY_WINDOW_ID)) return; | ||
| windows.openWindow(<ComponentLibraryContent />, { | ||
| id: COMPONENT_LIBRARY_WINDOW_ID, | ||
| title: "Components", | ||
| position: { x: 0, y: 100 }, | ||
| size: { width: 280, height: 350 }, | ||
| disabledActions: ["close"], | ||
| persisted: true, | ||
| defaultDockState: "left", | ||
| miniContent: <ComponentLibraryWindowMiniContent />, | ||
| }); | ||
| }, [windows]); | ||
| } |
23 changes: 12 additions & 11 deletions
23
src/routes/v2/pages/Editor/hooks/usePipelineTreeWindow.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,24 @@ | ||
| import { useEffect } from "react"; | ||
|
|
||
| import { PipelineTreeContent } from "@/routes/v2/pages/Editor/components/PipelineTreeContent/PipelineTreeContent"; | ||
| import { PipelineTreeWindowMiniContent } from "@/routes/v2/pages/Editor/components/PipelineTreeContent/PipelineTreeWindowMiniContent"; | ||
| import { useSharedStores } from "@/routes/v2/shared/store/SharedStoreContext"; | ||
|
|
||
| const PIPELINE_TREE_WINDOW_ID = "pipeline-tree"; | ||
|
|
||
| export function usePipelineTreeWindow() { | ||
| const { windows } = useSharedStores(); | ||
| useEffect(() => { | ||
| if (!windows.getWindowById(PIPELINE_TREE_WINDOW_ID)) { | ||
| windows.openWindow(<PipelineTreeContent />, { | ||
| id: PIPELINE_TREE_WINDOW_ID, | ||
| title: "Pipeline Structure", | ||
| position: { x: 300, y: 100 }, | ||
| size: { width: 280, height: 400 }, | ||
| disabledActions: ["close"], | ||
| persisted: true, | ||
| defaultDockState: "left", | ||
| }); | ||
| } | ||
| if (windows.getWindowById(PIPELINE_TREE_WINDOW_ID)) return; | ||
| windows.openWindow(<PipelineTreeContent />, { | ||
| id: PIPELINE_TREE_WINDOW_ID, | ||
| title: "Pipeline Structure", | ||
| position: { x: 300, y: 100 }, | ||
| size: { width: 280, height: 400 }, | ||
| disabledActions: ["close"], | ||
| persisted: true, | ||
| defaultDockState: "left", | ||
| miniContent: <PipelineTreeWindowMiniContent />, | ||
| }); | ||
| }, [windows]); | ||
| } |
31 changes: 16 additions & 15 deletions
31
src/routes/v2/pages/Editor/hooks/useRunsAndSubmissionWindow.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,27 +1,28 @@ | ||
| import { useEffect } from "react"; | ||
|
|
||
| import { RunsAndSubmissionContent } from "@/routes/v2/pages/Editor/components/RunsAndSubmissionContent"; | ||
| import { RunsAndSubmissionWindowMiniContent } from "@/routes/v2/pages/Editor/components/RunsAndSubmissionWindowMiniContent"; | ||
| import { useSharedStores } from "@/routes/v2/shared/store/SharedStoreContext"; | ||
|
|
||
| const RUNS_AND_SUBMISSION_WINDOW_ID = "runs-and-submission"; | ||
|
|
||
| export function useRunsAndSubmissionWindow() { | ||
| const { windows } = useSharedStores(); | ||
| useEffect(() => { | ||
| if (!windows.getWindowById(RUNS_AND_SUBMISSION_WINDOW_ID)) { | ||
| windows.openWindow(<RunsAndSubmissionContent />, { | ||
| id: RUNS_AND_SUBMISSION_WINDOW_ID, | ||
| title: "Runs & Submissions", | ||
| position: { x: 100, y: 460 }, | ||
| size: { width: 280, height: 50 }, | ||
| minSize: { | ||
| width: 280, | ||
| height: 50, | ||
| }, | ||
| disabledActions: ["close"], | ||
| persisted: true, | ||
| defaultDockState: "left", | ||
| }); | ||
| } | ||
| if (windows.getWindowById(RUNS_AND_SUBMISSION_WINDOW_ID)) return; | ||
| windows.openWindow(<RunsAndSubmissionContent />, { | ||
| id: RUNS_AND_SUBMISSION_WINDOW_ID, | ||
| title: "Runs & Submissions", | ||
| position: { x: 100, y: 460 }, | ||
| size: { width: 280, height: 50 }, | ||
| minSize: { | ||
| width: 280, | ||
| height: 50, | ||
| }, | ||
| disabledActions: ["close"], | ||
| persisted: true, | ||
| defaultDockState: "left", | ||
| miniContent: <RunsAndSubmissionWindowMiniContent />, | ||
| }); | ||
| }, [windows]); | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| import { observer } from "mobx-react-lite"; | ||
| import type { CSSProperties } from "react"; | ||
|
|
||
| import { | ||
| Popover, | ||
| PopoverContent, | ||
| PopoverTrigger, | ||
| } from "@/components/ui/popover"; | ||
| import { Text } from "@/components/ui/typography"; | ||
| import { cn } from "@/lib/utils"; | ||
| import { useSharedStores } from "@/routes/v2/shared/store/SharedStoreContext"; | ||
|
|
||
| import { WindowContextProvider } from "./ContentWindowStateContext"; | ||
| import { MAX_DOCK_AREA_WIDTH } from "./types"; | ||
|
|
||
| interface CollapsedDockWindowMiniProps { | ||
| windowId: string; | ||
| dockSide: "left" | "right"; | ||
| } | ||
|
|
||
| export const CollapsedDockWindowMini = observer( | ||
| function CollapsedDockWindowMini({ | ||
| windowId, | ||
| dockSide, | ||
| }: CollapsedDockWindowMiniProps) { | ||
| const { windows } = useSharedStores(); | ||
| const model = windows.getWindowById(windowId); | ||
| const mini = windows.getWindowMiniContent(windowId); | ||
| const content = windows.getWindowContent(windowId); | ||
|
|
||
| if (!model || model.state === "hidden" || !mini || !content) { | ||
| return null; | ||
| } | ||
|
|
||
| const popoverSide = dockSide === "left" ? "right" : "left"; | ||
| const panelWidth = Math.min(model.size.width, MAX_DOCK_AREA_WIDTH); | ||
|
|
||
| return ( | ||
| <Popover> | ||
| {/* | ||
| Radix asChild merges ref and listeners onto one DOM node. Mini content | ||
| is often a MobX observer() component that does not forwardRef to a host | ||
| element, so we wrap it in a div that receives the trigger props. | ||
| */} | ||
| <PopoverTrigger asChild> | ||
| <div className="relative z-20 flex w-full shrink-0 justify-center outline-none"> | ||
|
maxy-shpfy marked this conversation as resolved.
|
||
| {mini} | ||
| </div> | ||
| </PopoverTrigger> | ||
| <PopoverContent | ||
| side={popoverSide} | ||
| align="start" | ||
| sideOffset={6} | ||
| collisionPadding={12} | ||
| className={cn( | ||
| "p-0 overflow-hidden flex flex-col border shadow-lg z-50", | ||
| "max-h-[min(70vh,720px)] w-[min(92vw,var(--dock-mini-popover-w))]", | ||
| )} | ||
| style={ | ||
| { | ||
| "--dock-mini-popover-w": `${panelWidth}px`, | ||
| } as CSSProperties | ||
| } | ||
| > | ||
| <div className="shrink-0 border-b bg-white px-2 py-1.5"> | ||
| <Text size="xs" weight="semibold" className="truncate"> | ||
| {model.title} | ||
| </Text> | ||
| </div> | ||
| <div className="min-h-0 flex-1 overflow-auto bg-white"> | ||
| <WindowContextProvider value={{ model, content }}> | ||
| {content} | ||
| </WindowContextProvider> | ||
| </div> | ||
| </PopoverContent> | ||
| </Popover> | ||
| ); | ||
| }, | ||
| ); | ||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.