-
Notifications
You must be signed in to change notification settings - Fork 18
Release #740
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
Release #740
Conversation
* feat: updates for client env * feat: init deep refresh (#738)
WalkthroughThis 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
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
Poem
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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 IDsShowing 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 handlingThe implementation provides appropriate UI feedback and properly invalidates queries after the operation completes.
Consider these improvements:
- Use a constant for the query key instead of hardcoding
["runs"]
to prevent maintenance issues if query key naming changes- 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 functionalityAdding 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 typesThe 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 codeConsider 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 documentationRenaming "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 environmentssrc/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 wherecurrentUser.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
📒 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 lengthGreat 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 readabilityAdding 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 consistencyChanging from
border-none
toborder-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 consistencyChanging from
border-none
toborder-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 componentReplaced 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 accessRemoved dependency on the
getUsername
helper function by directly accessingrow.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 withasChild
propThe addition of the
asChild
prop toAlertDialogTrigger
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 consistencyChanging from
border-none
toborder-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 withasChild
propThe addition of the
asChild
prop toAlertDialogTrigger
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 consistencyChanging from
border-none
toborder-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 organizationReordering 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 callinggetUsername(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=jsxLength 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 howdata
is fetched and guarded insrc/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.tsxLength of output: 1446
Safe to use
data.name
as-isThe
<InlineAvatar>
is only rendered inside adata ? (…) : <Skeleton />
check, sodata
(and by extensiondata.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 fallbackDirectly using
user.name[0]
instead ofgetUsername(user)[0]
is a good simplification that reduces unnecessary abstraction. However, this change assumes thatuser.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 requiredstring
to an optionalstring | 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 theInlineAvatar
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 theRunRefreshGroup
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 theEnvironmentCollapsible
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. TheSheetHeader
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 displayThe 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 updatesThis 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 accessibilityThe dropdown trigger has been enhanced by:
- Using a proper Button component with appropriate styling
- Adding screen reader text for better accessibility
- 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 implementationThe author column has been refactored to:
- Directly access the user's name string through the accessor function
- Pass that string directly to the InlineAvatar component
- 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 catLength of output: 999
Verify custom “size-5” utility
I didn’t find any
size-<n>
utilities in your Tailwind config. Unless yourzenmlPreset
provides asize-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 & 36src/components/stacks/Sheet/index.tsx (2)
26-26
: Well-structured import additionThe import for
UpdateStackDialog
is properly added to support the new stack update feature.
64-82
: Good UI enhancement with Update Stack featureThe 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 handlingThe imports are properly updated to support the new query parameter functionality, including
PipelineRunDetailQueryParams
type and theobjectToSearchParams
utility.
11-11
: Well-defined type extensionGood addition of optional query parameters to the
PipelineRunDetailOverview
type, maintaining backward compatibility while enabling enhanced querying capabilities.
14-19
: Clean query key implementationThe function properly incorporates query parameters into the query key, ensuring proper cache management when parameters change.
21-23
: Robust URL construction with query parametersThe 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 simplificationThe imports are properly updated to support the new button-based edit functionality, including
UpdateButtonContent
and React Router'suseLocation
.
20-22
: Improved navigation awarenessGood 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 buttonThe new
ComponentEditButton
is well-implemented, using declarative routing withLink
instead of imperative navigation, and properly integrating the newUpdateButtonContent
component for consistent UI.src/components/stack-components/component-detail/ConfigTab.tsx (4)
1-17
: Well-organized importsThe imports are properly updated to include the new
ConnectorTag
component and reorganize related imports.
36-45
: Improved variable naming and data access patternsExcellent renaming of
component
tocomponentQuery
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 JSXThe 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 renderingThe "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 importsAdding the
NotAvailable
andCopyMetadataButton
components improves the code organization and reusability.
17-17
: Well-structured regex extractionMoving the regex pattern for class detection to a module-level constant improves maintainability and performance.
54-55
: Good readability improvementCreating a dedicated
hasNoData
flag improves code readability and avoids duplicate checks.
63-64
: Enhanced UI with copy functionalityThe 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 handlingReplacing the empty message with the standardized
NotAvailable
component creates a more consistent user experience across the application.
82-82
: Good refactoring of value renderingUsing the newly created
RenderSimpleValue
component reduces duplication and ensures consistent rendering of values.
107-122
: Improved array rendering with consistent stylingThe updates to
RenderArray
enhance user experience by adding a copy button and ensuring consistent styling with the main component. The use ofRenderSimpleValue
also reduces code duplication.
142-165
: Well-structured value rendering componentThe
RenderSimpleValue
component is a good abstraction that handles different value types appropriately:
- Class representation strings as code snippets
- Null values with clear representation
- URLs as clickable links
- 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 componentsAdding tooltip-related imports allows for enhanced user context and information.
20-20
: Good constant declarationDefining a constant for the Python packages key improves code maintainability.
25-29
: Improved variable naming and data normalizationRenaming variables for better clarity and adding normalization for Python packages ensures consistent data structure before rendering.
47-66
: Enhanced user experience with informative tooltipsAdding descriptive tooltips with documentation links for the Client Environment provides valuable context to users.
99-108
: Well-implemented data normalization functionThe
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.
Summary by CodeRabbit
New Features
UI Improvements
Bug Fixes
Chores