Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

Cahllagerfeld
Copy link
Contributor

@Cahllagerfeld Cahllagerfeld commented Apr 29, 2025

Summary by CodeRabbit

  • New Features

    • Added ability to copy metadata via a new Copy Metadata button in metadata cards and nested collapsibles.
    • Introduced manual and deep refresh controls for pipeline runs, including a refresh group with dropdown options.
    • Added tooltips and documentation links to environment configuration sections for improved clarity.
    • Added a ConnectorTag component to visually display service connectors.
    • Provided an Update dialog for stacks and a direct edit button for stack components.
  • UI Improvements

    • Simplified and unified avatar rendering by directly using user names.
    • Enhanced empty state displays with a new NotAvailable component.
    • Improved artifact and stack component detail headers for clarity and easier editing.
    • Updated button and border styles for consistency across dialogs and alerts.
    • Refined metadata and environment cards for better usability and structure.
  • Bug Fixes

    • Improved handling of missing or undefined author/user names in tables and avatars.
    • Fixed metadata empty state logic to provide more accurate messaging.
  • Chores

    • Refactored internal code for better maintainability and reduced reliance on helper functions.

@Cahllagerfeld Cahllagerfeld requested a review from schustmi April 29, 2025 13:44
Copy link
Contributor

coderabbitai bot commented Apr 29, 2025

Walkthrough

This update introduces several new components and utilities, refactors existing UI elements, and simplifies data handling across the codebase. Notable additions include components for copying metadata, updating stacks, and refreshing pipeline runs, as well as utility hooks for clipboard operations and orchestrator data fetching. The update also standardizes how user names are accessed and displayed, removes unnecessary helper functions, and enhances UI clarity with tooltips, improved empty states, and more flexible card headers. Several components are refactored for better encapsulation, maintainability, and user experience.

Changes

File(s) Change Summary
src/app/components/columns.tsx, src/app/settings/members/columns.tsx, src/app/settings/page.tsx, src/app/settings/profile/page.tsx, src/app/settings/secrets/columns.tsx, src/app/stacks/columns.tsx Removed usage of getUsername helper; now directly access and display user names. Simplified avatar and cell rendering logic.
src/app/pipelines/PipelinesTab/DeletePipelineAlert.tsx, src/app/pipelines/RunsTab/DeleteRunAlert.tsx, src/app/settings/service-accounts/DeleteAlert.tsx, src/app/settings/service-accounts/[service-account-id]/DeleteApiKeyDialog.tsx Updated button border styling from border-none to border-y-0 in alert dialog triggers.
src/app/pipelines/RunsTab/columns.tsx Simplified author accessor, updated cell rendering to handle undefined names, and added a guard clause for empty values.
src/app/runs/[id]/Header.tsx Added RunRefreshGroup to the header, grouping it with the actions menu for pipeline runs.
src/app/runs/[id]/RunActionMenu.tsx Refactored dropdown trigger to use a styled Button with asChild, improving appearance and interaction.
src/app/runs/[id]/_Tabs/Configuration/EnvironmentCollapsible.tsx Normalized python_packages fields, added tooltips to environment titles, and clarified terminology.
src/app/runs/[id]/_Tabs/Configuration/ParameterCollapsible.tsx Replaced plain text "Not available" with a NotAvailable component for empty state.
src/app/runs/[id]/_Tabs/Configuration/index.tsx Modified pipeline run detail query to include include_python_packages: true in query parameters.
src/components/CollapsibleCard.tsx Added headerClassName and headerChildren props for more flexible card headers.
src/components/MetadataCards.tsx Added a CopyMetadataButton to card headers, allowing copying of metadata as JSON.
src/components/NestedCollapsible.tsx Refactored value rendering into a RenderSimpleValue component, added copy button, improved empty state.
src/components/artifacts/artifact-node-sheet/DetailCards.tsx Refactored artifact store display into a dedicated ArtifactStore component; improved rendering and encapsulation.
src/components/artifacts/artifact-node-sheet/MetadataTab.tsx Improved empty state detection and messaging for artifact metadata.
src/components/artifacts/artifact-node-sheet/SheetContent.tsx, src/components/stack-components/component-sheet/index.tsx, src/components/steps/step-sheet/SheetContent.tsx Replaced custom close button headers with the standardized SheetHeader component.
src/components/buttons/update-button-content.tsx Added new UpdateButtonContent component for consistent update button styling.
src/components/copy-metadata-button.tsx Added CopyMetadataButton component for copying text to clipboard with visual feedback.
src/components/dag-visualizer/PreviewArtifact.tsx Added a text style class to artifact label for improved appearance.
src/components/not-available.tsx Added a simple NotAvailable component for consistent empty state messaging.
src/components/runs/refresh-group/deep-refresh.ts, src/components/runs/refresh-group/dropdown.tsx, src/components/runs/refresh-group/index.tsx Introduced deep refresh functionality for pipeline runs, including dropdown and button UI components.
src/components/service-connectors/connector-tag.tsx Added a ConnectorTag component for visualizing service connectors.
src/components/sheet/SheetHeader.tsx Refactored SheetHeader to accept standard div props and children, improved close button styling.
src/components/stack-components/component-detail/ConfigTab.tsx Refactored data access, added service connector display, improved author rendering.
src/components/stack-components/component-detail/Header.tsx Replaced dropdown edit menu with a direct edit button linking to the edit route.
src/components/stacks/Sheet/index.tsx, src/components/stacks/Sheet/update-stacks-dialog.tsx Added UpdateStackDialog for updating stacks, integrated into the stack headline UI.
src/data/pipeline-runs/fetch-orchestrator-run.ts Added useFetchOrchestratorPipelineRun mutation hook for orchestrator pipeline run refresh.
src/data/pipeline-runs/pipeline-run-detail-query.ts Extended query params support for pipeline run detail fetches, updated function signatures.
src/layouts/AuthenticatedLayout/UserDropdown.tsx Simplified avatar fallback logic to use the first character of the user's name directly.
src/lib/copy.ts Added useCopy hook for clipboard operations with stateful copied feedback.
src/types/pipeline-runs.ts Added PipelineRunDetailQueryParams type alias for pipeline run query parameters.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant RunHeader
    participant RunRefreshGroup
    participant RunRefreshDropdown
    participant useDeepRefresh
    participant OrchestratorAPI
    participant Toast

    User->>RunHeader: Clicks refresh button or opens dropdown
    RunHeader->>RunRefreshGroup: Triggers refresh UI
    RunRefreshGroup->>RunRefreshDropdown: (if dropdown used) Shows menu
    User->>RunRefreshDropdown: Selects "Deep Refresh"
    RunRefreshDropdown->>useDeepRefresh: Calls fetchOrchestratorPipelineRun(runId)
    useDeepRefresh->>OrchestratorAPI: Requests orchestrator run data (refresh_status: true)
    OrchestratorAPI-->>useDeepRefresh: Returns run data or error
    alt Success
        useDeepRefresh->>Toast: Show success message
        useDeepRefresh->>RunRefreshDropdown: Close dropdown
    else Error
        useDeepRefresh->>Toast: Show error message
        useDeepRefresh->>RunRefreshDropdown: Close dropdown
    end
Loading

Poem

A rabbit hopped through fields of code,
With buttons to copy, and dialogs that glowed.
Now user names are simpler, and stacks can update,
Refreshing runs deeply, no need to wait!
Tooltips and headers, all neat and refined—
This garden of features is well-aligned.
🐇✨ Hooray for the code that’s now better designed!

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@Cahllagerfeld Cahllagerfeld changed the title Staging Release Apr 29, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (14)
src/components/buttons/update-button-content.tsx (1)

1-10: Good extraction of reusable UI pattern!

This component promotes UI consistency for update buttons across the application.

Consider making this component more flexible by accepting props to customize:

  • Button text (for internationalization or different contexts)
  • Icon sizes for different button variants
  • Optional className to extend styling
-export function UpdateButtonContent() {
+export function UpdateButtonContent({ 
+  text = "Update", 
+  iconSize = 24,
+  className = ""
+}: {
+  text?: string;
+  iconSize?: number;
+  className?: string;
+}) {
 	return (
 		<>
-			<Edit width={24} height={24} className="shrink-0 fill-theme-text-primary" />
-			Update
+			<Edit 
+				width={iconSize} 
+				height={iconSize} 
+				className={`shrink-0 fill-theme-text-primary ${className}`} 
+			/>
+			{text}
 		</>
 	);
 }
src/components/artifacts/artifact-node-sheet/DetailCards.tsx (1)

165-165: Consider user experience implications of truncating IDs

Showing only the first segment of the producer run ID (producerRunId.split("-")[0]) makes the UI cleaner, but verify that this shortened ID remains meaningful and uniquely identifiable in context.

Consider adding a tooltip that shows the full ID for cases where users need to see or copy the complete identifier:

-{producerRunId.split("-")[0]}
+<TooltipProvider>
+  <Tooltip>
+    <TooltipTrigger className="cursor-default">
+      {producerRunId.split("-")[0]}
+    </TooltipTrigger>
+    <TooltipContent align="start">
+      {producerRunId}
+    </TooltipContent>
+  </Tooltip>
+</TooltipProvider>
src/components/service-connectors/connector-tag.tsx (1)

4-15: Add handling for empty connector names.

The component looks well-structured and follows React functional component patterns. However, it doesn't handle cases where the connectorName might be empty or undefined, which could lead to rendering issues.

Consider adding a guard to handle empty connector names:

export function ConnectorTag({ connectorName }: Props) {
+	if (!connectorName) return null;
	return (
		<Tag color="yellow" rounded={false} className="w-fit gap-0.5" emphasis="subtle">
			<Transform width={20} height={20} className="shrink-0 fill-warning-900" />
			<span>{connectorName}</span>
		</Tag>
	);
}
src/data/pipeline-runs/fetch-orchestrator-run.ts (2)

5-7: Consider a more descriptive type name.

The type UpdateRunParams is used for fetching rather than updating data. A more descriptive name would better reflect its purpose.

-type UpdateRunParams = {
+type FetchOrchestratorRunParams = {
	runId: string;
};

9-18: Add documentation to explain the hook's purpose.

The hook looks well-implemented, but lacks documentation explaining what the refresh_status: true parameter does and when to use this hook versus the regular pipeline run fetching.

Add JSDoc comments to explain the purpose and behavior:

+/**
+ * Hook for fetching a pipeline run with forced status refresh from the orchestrator.
+ * This is useful when you need to ensure you have the latest run status from the 
+ * underlying orchestration system.
+ * 
+ * @param options - Optional React Query mutation options
+ * @returns A mutation object for fetching the orchestrator pipeline run
+ */
export function useFetchOrchestratorPipelineRun(
	options?: UseMutationOptions<PipelineRun, FetchError, UpdateRunParams, unknown>
) {
	return useMutation<PipelineRun, FetchError, UpdateRunParams, unknown>({
		...options,
		mutationFn: async ({ runId }: UpdateRunParams) => {
			return fetchPipelineRun({ runId, queryParams: { refresh_status: true } });
		}
	});
}
src/components/runs/refresh-group/deep-refresh.ts (1)

1-33: Well-structured hook implementation with good error handling

The implementation provides appropriate UI feedback and properly invalidates queries after the operation completes.

Consider these improvements:

  1. Use a constant for the query key instead of hardcoding ["runs"] to prevent maintenance issues if query key naming changes
  2. Add loading state feedback in the UI while the refresh is in progress
-			await queryClient.invalidateQueries({
-				queryKey: ["runs"]
-			});
+			// Use a constant or imported query key to prevent future maintenance issues
+			const RUNS_QUERY_KEY = ["runs"];
+			await queryClient.invalidateQueries({
+				queryKey: RUNS_QUERY_KEY
+			});
src/components/MetadataCards.tsx (1)

14-14: Good UX improvement to add metadata copy functionality

Adding the ability to copy metadata as JSON is a useful enhancement for users who need to reference this data elsewhere.

Consider memoizing the JSON string to improve performance during re-renders:

+ import { useMemo } from 'react';

  export function UncategorizedCard({ metadata, title }: Props & { title?: string }) {
    // existing code...

    // sort nonDicts alphabetically by index 0
    nonDicts.sort((a, b) => a[0].localeCompare(b[0]));

    const nonDictsObject = nonDicts.reduce(
      (acc, [key, value]) => {
        acc[key] = value;
        return acc;
      },
      {} as Record<string, unknown>
    );
    
+   // Memoize the JSON string to prevent unnecessary recalculations
+   const jsonString = useMemo(() => {
+     try {
+       return JSON.stringify(nonDictsObject);
+     } catch (err) {
+       console.error('Failed to stringify metadata:', err);
+       return '{}';
+     }
+   }, [nonDictsObject]);

    return (
      <div>
        <CollapsibleCard
          headerClassName="flex items-center gap-2"
-         headerChildren={<CopyMetadataButton copyText={JSON.stringify(nonDictsObject)} />}
+         headerChildren={<CopyMetadataButton copyText={jsonString} />}
          initialOpen
          title={title || "Uncategorized"}
        >

Also applies to: 39-45, 49-54

src/components/runs/refresh-group/index.tsx (1)

1-28: Well-designed refresh component with clear separation of refresh types

The component provides a clean UI separating standard refresh from deep refresh options, with appropriate styling and intent.

Consider adding a loading state to prevent multiple refresh operations and adding a tooltip to explain the difference between refresh types:

import Refresh from "@/assets/icons/refresh.svg?react";
-import { Button } from "@zenml-io/react-component-library/components/server";
+import { Button, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@zenml-io/react-component-library/components/server";
import { RunRefreshDropdown } from "./dropdown";
import { usePipelineRun } from "@/data/pipeline-runs/pipeline-run-detail-query";

type Props = {
	runId: string;
};

export function RunRefreshGroup({ runId }: Props) {
-	const { refetch } = usePipelineRun({ runId });
+	const { refetch, isFetching } = usePipelineRun({ runId });

	return (
		<div className="flex">
+			<TooltipProvider>
+				<Tooltip>
+					<TooltipTrigger asChild>
						<Button
							className="rounded-r-sharp"
							intent="primary"
							emphasis="subtle"
							size="md"
							onClick={() => refetch()}
+							disabled={isFetching}
						>
-							<Refresh className="h-5 w-5 fill-theme-text-brand" />
+							<Refresh className={`h-5 w-5 fill-theme-text-brand ${isFetching ? 'animate-spin' : ''}`} />
							Refresh
						</Button>
+					</TooltipTrigger>
+					<TooltipContent>
+						<p>Refresh run data from cache</p>
+					</TooltipContent>
+				</Tooltip>
+			</TooltipProvider>
			<RunRefreshDropdown runId={runId} />
		</div>
	);
}
src/components/copy-metadata-button.tsx (2)

11-30: Well-implemented clipboard copy functionality.

The component is well-structured with:

  • Proper use of the useCopy hook
  • Visual feedback when text is copied
  • Appropriate button styling
  • Accessibility considerations

One minor suggestion would be to add a tooltip explaining what will be copied for better user experience.


16-17: Consider adding a tooltip for better UX.

While the button is clear, adding a tooltip that shows what content will be copied would enhance the user experience, especially for longer or complex data.

-			className={cn("flex items-center gap-1 bg-theme-surface-primary", className)}
+			className={cn("flex items-center gap-1 bg-theme-surface-primary", className)}
+			title={`Copy metadata to clipboard`}
src/components/stack-components/component-detail/Header.tsx (1)

102-126: Remove commented-out code

Consider removing the commented-out ComponentDetailDropdown function rather than keeping it in the codebase. Commented code adds noise and can become outdated over time. If needed for reference, consider documenting the pattern in comments or documentation instead.

-// function ComponentDetailDropdown({ componentId }: Props) {
-// 	const navigate = useNavigate();
-// 	return (
-// 		<DropdownMenu>
-// 			<DropdownMenuTrigger asChild>
-// 				<Button
-// 					intent="secondary"
-// 					emphasis="minimal"
-// 					className="flex aspect-square items-center justify-center"
-// 				>
-// 					<DotsIcon className="h-4 w-4 shrink-0 fill-theme-text-tertiary" />
-// 				</Button>
-// 			</DropdownMenuTrigger>
-// 			<DropdownMenuContent align="end" sideOffset={7}>
-// 				<DropdownMenuItem
-// 					onSelect={() => navigate(routes.components.edit(componentId))}
-// 					className="cursor-pointer space-x-2"
-// 				>
-// 					<Edit className="h-3 w-3 fill-neutral-400" />
-// 					<p>Edit</p>
-// 				</DropdownMenuItem>
-// 			</DropdownMenuContent>
-// 		</DropdownMenu>
-// 	);
-// }
-
src/app/runs/[id]/_Tabs/Configuration/EnvironmentCollapsible.tsx (1)

72-92: Improved terminology and documentation

Renaming "Orchestrator Environment" to "Execution Environment" and adding a descriptive tooltip improves clarity for users.

There's a small typo in the tooltip link text: "exectuion" should be "execution".

-										Learn more about exectuion environments
+										Learn more about execution environments
src/components/not-available.tsx (1)

1-3: Good addition of a reusable empty state component.

Creating a dedicated component for "Not available" states improves UI consistency across the application. This is a clean implementation that follows the single responsibility principle.

However, consider making this component more flexible for future use cases:

-export function NotAvailable() {
+export function NotAvailable({ 
+  className = "", 
+  text = "Not available" 
+}: { 
+  className?: string; 
+  text?: string 
+}) {
-	return <div className="text-theme-text-tertiary">Not available</div>;
+	return <div className={`text-theme-text-tertiary ${className}`}>{text}</div>;
}
src/layouts/AuthenticatedLayout/UserDropdown.tsx (1)

38-38: Simplified user name access but potential null safety concern.

Direct property access simplifies the code by removing the dependency on the getUsername helper function. However, be cautious about potential edge cases where currentUser.data.name might be undefined or null.

Consider adding a safeguard:

-<AvatarFallback size="lg">{currentUser.data.name[0]}</AvatarFallback>
+<AvatarFallback size="lg">{currentUser.data.name?.[0] || '?'}</AvatarFallback>
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3bc2631 and 36636a7.

📒 Files selected for processing (43)
  • src/app/components/columns.tsx (1 hunks)
  • src/app/pipelines/PipelinesTab/DeletePipelineAlert.tsx (1 hunks)
  • src/app/pipelines/RunsTab/DeleteRunAlert.tsx (1 hunks)
  • src/app/pipelines/RunsTab/columns.tsx (1 hunks)
  • src/app/runs/[id]/Header.tsx (2 hunks)
  • src/app/runs/[id]/RunActionMenu.tsx (2 hunks)
  • src/app/runs/[id]/_Tabs/Configuration/EnvironmentCollapsible.tsx (2 hunks)
  • src/app/runs/[id]/_Tabs/Configuration/ParameterCollapsible.tsx (2 hunks)
  • src/app/runs/[id]/_Tabs/Configuration/index.tsx (1 hunks)
  • src/app/settings/members/columns.tsx (1 hunks)
  • src/app/settings/page.tsx (2 hunks)
  • src/app/settings/profile/page.tsx (1 hunks)
  • src/app/settings/secrets/columns.tsx (1 hunks)
  • src/app/settings/service-accounts/DeleteAlert.tsx (1 hunks)
  • src/app/settings/service-accounts/[service-account-id]/DeleteApiKeyDialog.tsx (1 hunks)
  • src/app/stacks/columns.tsx (1 hunks)
  • src/app/stacks/create/components/sharedSchema.ts (1 hunks)
  • src/components/CollapsibleCard.tsx (3 hunks)
  • src/components/MetadataCards.tsx (2 hunks)
  • src/components/NestedCollapsible.tsx (5 hunks)
  • src/components/artifacts/artifact-node-sheet/DetailCards.tsx (4 hunks)
  • src/components/artifacts/artifact-node-sheet/MetadataTab.tsx (1 hunks)
  • src/components/artifacts/artifact-node-sheet/SheetContent.tsx (2 hunks)
  • src/components/buttons/update-button-content.tsx (1 hunks)
  • src/components/copy-metadata-button.tsx (1 hunks)
  • src/components/dag-visualizer/PreviewArtifact.tsx (1 hunks)
  • src/components/not-available.tsx (1 hunks)
  • src/components/runs/refresh-group/deep-refresh.ts (1 hunks)
  • src/components/runs/refresh-group/dropdown.tsx (1 hunks)
  • src/components/runs/refresh-group/index.tsx (1 hunks)
  • src/components/service-connectors/connector-tag.tsx (1 hunks)
  • src/components/sheet/SheetHeader.tsx (1 hunks)
  • src/components/stack-components/component-detail/ConfigTab.tsx (4 hunks)
  • src/components/stack-components/component-detail/Header.tsx (4 hunks)
  • src/components/stack-components/component-sheet/index.tsx (2 hunks)
  • src/components/stacks/Sheet/index.tsx (2 hunks)
  • src/components/stacks/Sheet/update-stacks-dialog.tsx (1 hunks)
  • src/components/steps/step-sheet/SheetContent.tsx (2 hunks)
  • src/data/pipeline-runs/fetch-orchestrator-run.ts (1 hunks)
  • src/data/pipeline-runs/pipeline-run-detail-query.ts (1 hunks)
  • src/layouts/AuthenticatedLayout/UserDropdown.tsx (1 hunks)
  • src/lib/copy.ts (1 hunks)
  • src/types/pipeline-runs.ts (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (16)
src/app/settings/page.tsx (1)
src/components/InlineAvatar.tsx (1)
  • InlineAvatar (7-16)
src/app/runs/[id]/_Tabs/Configuration/index.tsx (1)
src/data/pipeline-runs/pipeline-run-detail-query.ts (1)
  • usePipelineRun (43-52)
src/components/artifacts/artifact-node-sheet/MetadataTab.tsx (1)
src/components/EmptyState.tsx (1)
  • EmptyState (7-14)
src/app/stacks/columns.tsx (1)
src/components/InlineAvatar.tsx (1)
  • InlineAvatar (7-16)
src/components/steps/step-sheet/SheetContent.tsx (1)
src/components/sheet/SheetHeader.tsx (1)
  • SheetHeader (7-30)
src/components/runs/refresh-group/index.tsx (2)
src/data/pipeline-runs/pipeline-run-detail-query.ts (1)
  • usePipelineRun (43-52)
src/components/runs/refresh-group/dropdown.tsx (1)
  • RunRefreshDropdown (16-53)
src/app/runs/[id]/Header.tsx (2)
src/components/runs/refresh-group/index.tsx (1)
  • RunRefreshGroup (10-28)
src/app/runs/[id]/RunActionMenu.tsx (1)
  • RunActionsMenu (13-44)
src/components/artifacts/artifact-node-sheet/SheetContent.tsx (1)
src/components/sheet/SheetHeader.tsx (1)
  • SheetHeader (7-30)
src/data/pipeline-runs/fetch-orchestrator-run.ts (3)
src/types/pipeline-runs.ts (1)
  • PipelineRun (6-6)
src/lib/fetch-error.ts (1)
  • FetchError (1-20)
src/data/pipeline-runs/pipeline-run-detail-query.ts (1)
  • fetchPipelineRun (21-41)
src/app/components/columns.tsx (1)
src/components/InlineAvatar.tsx (1)
  • InlineAvatar (7-16)
src/app/runs/[id]/_Tabs/Configuration/ParameterCollapsible.tsx (1)
src/components/not-available.tsx (1)
  • NotAvailable (1-3)
src/components/stack-components/component-detail/ConfigTab.tsx (5)
src/components/stack-components/component-detail/hooks.ts (1)
  • useComponent (4-6)
src/components/KeyValue.tsx (1)
  • KeyValue (39-46)
src/lib/url.ts (1)
  • sanitizeUrl (30-32)
src/components/InlineAvatar.tsx (1)
  • InlineAvatar (7-16)
src/components/service-connectors/connector-tag.tsx (1)
  • ConnectorTag (8-15)
src/components/runs/refresh-group/deep-refresh.ts (2)
src/router/queryclient.ts (1)
  • queryClient (10-25)
src/data/pipeline-runs/fetch-orchestrator-run.ts (1)
  • useFetchOrchestratorPipelineRun (9-18)
src/components/stacks/Sheet/index.tsx (3)
src/components/CopyButton.tsx (1)
  • CopyButton (16-64)
src/components/stacks/Sheet/update-stacks-dialog.tsx (1)
  • UpdateStackDialog (11-23)
src/app/stacks/DialogItems.tsx (1)
  • UpdateStackDialog (11-33)
src/components/stack-components/component-sheet/index.tsx (2)
src/components/sheet/SheetHeader.tsx (1)
  • SheetHeader (7-30)
src/router/routes.tsx (1)
  • routes (1-55)
src/app/settings/secrets/columns.tsx (1)
src/components/InlineAvatar.tsx (1)
  • InlineAvatar (7-16)
🔇 Additional comments (69)
src/app/stacks/create/components/sharedSchema.ts (1)

8-8: Improved stack name validation by increasing maximum length

Great enhancement to increase the maximum allowed stack name length from 32 to 255 characters. This provides users with more flexibility in naming their stacks and aligns with common string length limits in databases and APIs.

src/components/dag-visualizer/PreviewArtifact.tsx (1)

29-29: Added text size styling for better readability

Adding the text-text-sm class improves visual hierarchy and ensures consistent text styling across the application.

src/app/settings/service-accounts/DeleteAlert.tsx (1)

24-24: Improved border styling consistency

Changing from border-none to border-y-0 maintains the left and right borders while removing top and bottom borders, creating a more consistent button appearance across the application.

src/app/settings/service-accounts/[service-account-id]/DeleteApiKeyDialog.tsx (1)

24-24: Improved border styling consistency

Changing from border-none to border-y-0 maintains the left and right borders while removing top and bottom borders, creating a more consistent button appearance across the application.

src/components/artifacts/artifact-node-sheet/SheetContent.tsx (1)

16-16: Simplified header implementation using the SheetHeader component

Replaced the custom header implementation with the reusable SheetHeader component, which improves code maintainability and ensures UI consistency across sheets in the application.

This refactoring aligns with similar changes in other sheet components, creating a unified approach to header rendering throughout the application.

Also applies to: 33-33

src/app/settings/members/columns.tsx (1)

73-73: Simplified user name access

Removed dependency on the getUsername helper function by directly accessing row.name, which simplifies the code and makes it more maintainable.

This change is part of a broader effort to standardize how user names are accessed throughout the application.

src/app/pipelines/PipelinesTab/DeletePipelineAlert.tsx (2)

18-18: Improved component composition with asChild prop

The addition of the asChild prop to AlertDialogTrigger eliminates an unnecessary wrapper element, improving both performance and DOM structure. This is a good practice when working with compound components.


20-20: Refined border styling for better visual consistency

Changing from border-none to border-y-0 allows the button to maintain left and right borders while removing top and bottom borders. This creates a more consistent styling pattern with other similar components throughout the application.

src/app/pipelines/RunsTab/DeleteRunAlert.tsx (2)

18-18: Improved component composition with asChild prop

The addition of the asChild prop to AlertDialogTrigger eliminates an unnecessary wrapper element, improving both performance and DOM structure. This matches the pattern now used in DeletePipelineAlert.tsx and other dialog components.


20-20: Refined border styling for better visual consistency

Changing from border-none to border-y-0 maintains left and right borders while removing top and bottom borders, creating a more consistent styling pattern across alert dialogs in the application.

src/app/settings/page.tsx (2)

1-3: Improved import organization

Reordering imports to group related components together improves readability and maintenance. The removal of the getUsername import aligns with the simplified approach to accessing user data.


22-22:

✅ Verification successful

Simplified user data access

Directly using data.name instead of calling getUsername(data) simplifies the code and reduces unnecessary abstraction. This change aligns with similar simplifications across the codebase.

Consider adding a safeguard against potential undefined or null values, as the component would fail if data.name is undefined:


🏁 Script executed:

#!/bin/bash
# Check if there are any safeguards for undefined name properties elsewhere
rg -A2 -B2 "data.name" --type=tsx --type=jsx

Length of output: 72


Let's search all JSX/TSX files without type filters to see if data.name is ever guarded:


🏁 Script executed:

#!/bin/bash
# Search for any occurrences of data.name in TSX/JSX to check for optional chaining or default handling
rg -A2 -B2 "data\.name" -g "*.tsx" -g "*.jsx"

Length of output: 7786


To confirm that data.name is always defined (e.g., after handling loading/error states), let’s inspect how data is fetched and guarded in src/app/settings/page.tsx.


🏁 Script executed:

#!/bin/bash
# Show the top of the settings page to verify loading/error handling around `data`
sed -n '1,200p' src/app/settings/page.tsx

Length of output: 1446


Safe to use data.name as-is

The <InlineAvatar> is only rendered inside a data ? (…) : <Skeleton /> check, so data (and by extension data.name) is guaranteed to be defined before it’s passed in. This matches the existing pattern across the codebase, where we rely on the loading/error guard around user data rather than per-property fallbacks. No additional nullish safeguard is needed here.

src/app/settings/profile/page.tsx (1)

17-17: Simplified user data access for avatar fallback

Directly using user.name[0] instead of getUsername(user)[0] is a good simplification that reduces unnecessary abstraction. However, this change assumes that user.name is always a non-empty string.

Consider adding a safeguard against potential empty strings or undefined values:

-{user.name[0]}
+{user.name?.[0] || '?'}

This would prevent rendering issues if the user's name is empty or undefined.

src/app/pipelines/RunsTab/columns.tsx (3)

140-141: Type-safe and consistent user data access.

This change correctly simplifies the accessor function for the author name, aligning with similar standardizations across the codebase.


144-145: Type safety improvement.

Changing name from a required string to an optional string | undefined more accurately reflects the possible values from the accessor function.


147-148: Proper null checking prevents component errors.

Adding a guard clause to check if name is falsy before rendering the InlineAvatar component prevents potential runtime errors.

src/app/runs/[id]/Header.tsx (2)

10-10: LGTM: Importing the new refresh component.

The import for the RunRefreshGroup component is correctly added.


46-49: Enhanced UI with run refresh controls.

Good improvement to the header UI by grouping the refresh controls with the actions menu in a flex container. This provides users with direct access to both manual and deep refresh functionality alongside existing actions.

The implementation correctly passes the runId parameter to the RunRefreshGroup component, ensuring it refreshes the specific run being viewed.

src/app/runs/[id]/_Tabs/Configuration/index.tsx (1)

14-17: Enhanced data fetching for environment details.

Adding the include_python_packages: true query parameter ensures the EnvironmentCollapsible component receives complete Python package information for rendering.

This change aligns with the enhancements made to display more detailed environment information in the pipeline run configuration tab.

src/components/artifacts/artifact-node-sheet/MetadataTab.tsx (2)

22-22: Improved empty state condition check.

The condition now properly checks both for the existence of data?.metadata?.run_metadata and whether it contains any keys, providing a more accurate determination of when to show the empty state.


26-29: Enhanced empty state messaging.

The updated empty state UI provides clearer information with a primary message and supporting text, improving the user experience when no metadata is available.

The styling with different text sizes and colors creates a good visual hierarchy between the main message and the supporting information.

src/app/stacks/columns.tsx (1)

53-57: LGTM! Code simplification improves readability.

The refactoring simplifies how user information is accessed by directly using the user's name string instead of the full user object and removing the dependency on the getUsername helper function. This aligns with similar simplifications made across the application.

src/components/stack-components/component-sheet/index.tsx (1)

2-35: Good refactoring to use standardized SheetHeader component.

Using the SheetHeader component improves consistency across the application and follows the pattern used in other sheet components. The SheetHeader already includes a close button (as seen in the relevant code snippets), and the expand button is now properly styled and positioned.

src/components/steps/step-sheet/SheetContent.tsx (1)

7-7: Great refactoring to use the shared SheetHeader component!

This change improves code reuse by replacing the custom close button implementation with the standardized SheetHeader component. This reduces duplication across sheet components and ensures consistent styling and accessibility features.

Also applies to: 53-53

src/app/components/columns.tsx (1)

88-92: Code simplification: Direct user name access for author display

The author column has been refactored to directly use the user's name string instead of using an intermediary helper function. This simplification aligns with similar changes across the application and removes unnecessary abstraction.

src/components/stacks/Sheet/update-stacks-dialog.tsx (1)

1-23: Well-structured component for stack updates

This new dialog component is cleanly implemented with:

  • Proper typing and props definition
  • Local state management for dialog open/close
  • Appropriate component composition with Dialog and Button
  • Good styling with responsive design considerations

The component follows the application's UI patterns and provides a clean interface for updating stacks.

src/app/runs/[id]/RunActionMenu.tsx (1)

23-33: Improved trigger button with proper styling and accessibility

The dropdown trigger has been enhanced by:

  1. Using a proper Button component with appropriate styling
  2. Adding screen reader text for better accessibility
  3. Maintaining the same functionality with improved UI structure

This change aligns with best practices for accessible UI components and creates consistency with other action buttons in the application.

src/app/settings/secrets/columns.tsx (1)

55-60: Simplified author column implementation

The author column has been refactored to:

  1. Directly access the user's name string through the accessor function
  2. Pass that string directly to the InlineAvatar component
  3. Remove dependency on a helper function

This change maintains the same functionality while simplifying the code, aligning with similar simplifications throughout the application.

src/components/CollapsibleCard.tsx (4)

19-20: Good addition of header customization props.

These new props enhance the component's flexibility by allowing custom styling and additional elements in the header section.


29-31: Appropriate default value for intent.

Adding a default value for intent ensures consistent rendering behavior when the prop is omitted.


36-36: Header className properly applied.

The headerClassName is now correctly applied to the CollapsibleHeader component.


45-46: Good placement of headerChildren.

Rendering the headerChildren after the CollapsibleTrigger ensures a logical layout where the title and chevron remain primary elements while allowing for additional content.

src/components/copy-metadata-button.tsx (1)

7-9: Well-defined props interface.

The component's props are clearly defined with proper types, extending ButtonProps while adding the required copyText property.

src/components/sheet/SheetHeader.tsx (4)

5-5: Good use of HTML attributes extension.

Extending from HTMLAttributes provides proper typing for all standard HTML div properties, improving component flexibility and type safety.


7-15: Well-refactored header component.

The component now:

  • Properly spreads additional props to the div element
  • Uses the cn utility for className composition
  • Maintains a clean interface while enhancing flexibility

16-26: Improved close button implementation.

The refactored close button:

  • Uses the Button component with asChild for better accessibility
  • Has proper semantic markup with type="button"
  • Includes screen reader text for accessibility
  • Uses consistent styling with the design system

27-27: Good addition of children rendering.

Adding children rendering makes the component more reusable across different contexts.

src/components/runs/refresh-group/dropdown.tsx (4)

16-19: Good state management and hook usage.

The component correctly:

  • Manages dropdown state with useState
  • Uses the useDeepRefresh hook with proper callback
  • Maintains clean separation of concerns

23-31: Well-designed dropdown trigger.

The dropdown trigger is:

  • Properly structured with asChild
  • Includes screen reader text for accessibility
  • Has appropriate styling

43-48: Good descriptive text for deep refresh.

The dropdown item includes helpful descriptive text that explains the purpose and behavior of the deep refresh functionality, which improves the user experience.


34-42:

❓ Verification inconclusive

Check icon and className consistency.

The classes "size-5" used in lines 29 and 36 might be custom utility classes. Ensure these are defined in your CSS framework or consider using standard classes like "h-5 w-5" for consistency with other components.


🏁 Script executed:

#!/bin/bash
# Check for usage of 'size-5' class in the codebase
echo "Checking for size utility class usage..."
rg -i "size-\d+" --type=tsx --type=jsx --type=css
echo "Checking tailwind or CSS configuration for size utilities..."
fd -e js -e ts -e json "tailwind\.config|tailwind-config" | xargs cat

Length of output: 999


Verify custom “size-5” utility

I didn’t find any size-<n> utilities in your Tailwind config. Unless your zenmlPreset provides a size-5 class, you should replace:

- className="size-5 shrink-0"
+ className="h-5 w-5 shrink-0"

to stay consistent with standard Tailwind sizing.

• File: src/components/runs/refresh-group/dropdown.tsx
• Lines: 29 & 36

src/components/stacks/Sheet/index.tsx (2)

26-26: Well-structured import addition

The import for UpdateStackDialog is properly added to support the new stack update feature.


64-82: Good UI enhancement with Update Stack feature

The layout changes effectively incorporate the new update stack functionality while maintaining the original structure. The flex container with justify-between provides clean separation between the stack information and the action button.

The implementation correctly uses the stack name from the API response and passes it to the UpdateStackDialog component, ensuring proper integration with the rest of the stack management functionality.

src/data/pipeline-runs/pipeline-run-detail-query.ts (4)

4-8: Clean import organization for query parameter handling

The imports are properly updated to support the new query parameter functionality, including PipelineRunDetailQueryParams type and the objectToSearchParams utility.


11-11: Well-defined type extension

Good addition of optional query parameters to the PipelineRunDetailOverview type, maintaining backward compatibility while enabling enhanced querying capabilities.


14-19: Clean query key implementation

The function properly incorporates query parameters into the query key, ensuring proper cache management when parameters change.


21-23: Robust URL construction with query parameters

The implementation correctly handles query parameter conversion and URL construction, including the edge case when no parameters are provided.

src/components/stack-components/component-detail/Header.tsx (3)

1-7: Clean import updates for UI simplification

The imports are properly updated to support the new button-based edit functionality, including UpdateButtonContent and React Router's useLocation.


20-22: Improved navigation awareness

Good use of useLocation to determine the current path segment and conditionally render the edit button only when not already on the edit page.

Also applies to: 32-32


128-136: Clean implementation of edit button

The new ComponentEditButton is well-implemented, using declarative routing with Link instead of imperative navigation, and properly integrating the new UpdateButtonContent component for consistent UI.

src/components/stack-components/component-detail/ConfigTab.tsx (4)

1-17: Well-organized imports

The imports are properly updated to include the new ConnectorTag component and reorganize related imports.


36-45: Improved variable naming and data access patterns

Excellent renaming of component to componentQuery to clarify its nature as a query result, with proper destructuring of data properties for cleaner access throughout the component.


70-70: Cleaner data access in JSX

The component now accesses data properties directly from the destructured variables, leading to more readable and maintainable code.

Also applies to: 83-87


92-97: Enhanced UI with proper conditional rendering

The "Author" field now properly handles the case when user information is not available, and the new "Service Connector" field with ConnectorTag enhances the component configuration display with valuable information.

src/components/NestedCollapsible.tsx (8)

14-15: Good addition of component imports

Adding the NotAvailable and CopyMetadataButton components improves the code organization and reusability.


17-17: Well-structured regex extraction

Moving the regex pattern for class detection to a module-level constant improves maintainability and performance.


54-55: Good readability improvement

Creating a dedicated hasNoData flag improves code readability and avoids duplicate checks.


63-64: Enhanced UI with copy functionality

The addition of the copy button in the header provides valuable functionality for users working with metadata, and the flex layout properly aligns the items.


67-67: Improved empty state handling

Replacing the empty message with the standardized NotAvailable component creates a more consistent user experience across the application.


82-82: Good refactoring of value rendering

Using the newly created RenderSimpleValue component reduces duplication and ensures consistent rendering of values.


107-122: Improved array rendering with consistent styling

The updates to RenderArray enhance user experience by adding a copy button and ensuring consistent styling with the main component. The use of RenderSimpleValue also reduces code duplication.


142-165: Well-structured value rendering component

The RenderSimpleValue component is a good abstraction that handles different value types appropriately:

  1. Class representation strings as code snippets
  2. Null values with clear representation
  3. URLs as clickable links
  4. Other values as either strings or formatted JSON

This reduces code duplication and ensures consistent rendering.

src/app/runs/[id]/_Tabs/Configuration/EnvironmentCollapsible.tsx (5)

8-13: Good addition of tooltip components

Adding tooltip-related imports allows for enhanced user context and information.


20-20: Good constant declaration

Defining a constant for the Python packages key improves code maintainability.


25-29: Improved variable naming and data normalization

Renaming variables for better clarity and adding normalization for Python packages ensures consistent data structure before rendering.


47-66: Enhanced user experience with informative tooltips

Adding descriptive tooltips with documentation links for the Client Environment provides valuable context to users.


99-108: Well-implemented data normalization function

The normalizePythonPackages function effectively handles the conversion of newline-separated strings to arrays, ensuring consistent data structure regardless of the original format.

src/app/runs/[id]/_Tabs/Configuration/ParameterCollapsible.tsx (2)

3-3: Good import addition for the new component.

The NotAvailable component import is correctly added to support the UI enhancement.


41-41: Improved UI consistency by using the NotAvailable component.

Replacing the hardcoded text with the standardized NotAvailable component improves UI consistency across the application. This change aligns with the broader effort to standardize empty state representations.

src/types/pipeline-runs.ts Show resolved Hide resolved
src/lib/copy.ts Show resolved Hide resolved
@Cahllagerfeld Cahllagerfeld merged commit e386f46 into main Apr 29, 2025
5 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Jul 29, 2025
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.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.