Skip to content

Add FlowIconText component for UI v2 migration#9

Open
tomerqodo wants to merge 3 commits intocoderabbit_full_base_add_flowicontext_component_for_ui_v2_migration_pr9from
coderabbit_full_head_add_flowicontext_component_for_ui_v2_migration_pr9
Open

Add FlowIconText component for UI v2 migration#9
tomerqodo wants to merge 3 commits intocoderabbit_full_base_add_flowicontext_component_for_ui_v2_migration_pr9from
coderabbit_full_head_add_flowicontext_component_for_ui_v2_migration_pr9

Conversation

@tomerqodo
Copy link
Copy Markdown

@tomerqodo tomerqodo commented Jan 30, 2026

Benchmark PR from agentic-review-benchmarks#9

Summary by CodeRabbit

  • New Features
    • Added FlowIconText component to display flows as interactive links with icons and flow names.

devin-ai-integration Bot and others added 3 commits January 25, 2026 12:10
Create a new FlowIconText component that displays a flow's icon and name
as a clickable link, fetching flow data by ID. This component follows the
existing Suspense pattern used in similar link components like FlowLink
and DeploymentLink.

Files added:
- flow-icon-text.tsx: Main component with Suspense wrapper
- flow-icon-text.stories.tsx: Storybook stories
- flow-icon-text.test.tsx: Unit tests
- index.ts: Export file

Co-Authored-By: alex.s@prefect.io <ajstreed1@gmail.com>
Add RouterProvider decorator to the Storybook story so the component
renders correctly in Storybook. The Link component from TanStack Router
requires a router context to function properly.

Co-Authored-By: alex.s@prefect.io <ajstreed1@gmail.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 30, 2026

📝 Walkthrough

Walkthrough

A new FlowIconText component has been added that fetches and displays flow details. The component uses React Query for data fetching with Suspense boundaries and renders a clickable link with an icon. Accompanying Storybook story and barrel export files have been created.

Changes

Cohort / File(s) Summary
FlowIconText Component
ui-v2/src/components/flows/flow-icon-text/flow-icon-text.tsx, ui-v2/src/components/flows/flow-icon-text/index.ts
New component that fetches flow details using useSuspenseQuery and renders a link with workflow icon. Includes barrel export for public API.
Storybook Story
ui-v2/src/components/flows/flow-icon-text/flow-icon-text.stories.tsx
Story file demonstrating FlowIconText with React Query and router setup, includes Suspense boundary and test configuration.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A new component hops into view,
With flow details fetched fresh and true,
Icons dance by the link's side,
Suspense and queries work with pride,
✨ Stories tell what this wonder can do!

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is minimal and does not follow the required template structure with checklist items for issue references, tests, docs, and docstrings. Complete the PR description using the repository template, including checklist items, issue reference, and confirmation that unit tests and docstrings are included.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding a new FlowIconText component for the UI v2 migration, which matches the primary change in the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch coderabbit_full_head_add_flowicontext_component_for_ui_v2_migration_pr9

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@tomerqodo
Copy link
Copy Markdown
Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 30, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@tomerqodo
Copy link
Copy Markdown
Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 30, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@tomerqodo
Copy link
Copy Markdown
Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 30, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@bar-qodo
Copy link
Copy Markdown

bar-qodo commented Feb 2, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 2, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@bar-qodo
Copy link
Copy Markdown

bar-qodo commented Feb 2, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 2, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@bar-qodo
Copy link
Copy Markdown

bar-qodo commented Feb 2, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 2, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown

@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: 2

🤖 Fix all issues with AI agents
In `@ui-v2/src/components/flows/flow-icon-text/flow-icon-text.stories.tsx`:
- Around line 12-18: The story uses two different QueryClient instances (the
module-level QueryClient and a second inline QueryClient passed to the router
context), causing cache inconsistencies and state leakage between stories;
update the decorator to create a fresh QueryClient per invocation and reuse that
same instance for both the QueryClientProvider and any router/test providers so
all hooks share one client and each story gets an isolated client (refer to
QueryClient, new QueryClient(...), and QueryClientProvider in the file).

In `@ui-v2/src/components/flows/flow-icon-text/flow-icon-text.tsx`:
- Line 6: The Suspense boundary in flow-icon-text.tsx is missing a fallback and
the imported Skeleton is unused; update the <Suspense> wrapping the async
content (look for the Suspense component in FlowIconText or
FlowIconTextSuspense) to pass a fallback prop that renders the imported Skeleton
component for loading state, and if you decide not to use Skeleton remove its
import to avoid the unused import warning; ensure the fallback matches the
component's size/props so the Skeleton visually fits the icon/text area.

Comment on lines +12 to +18
const queryClient = new QueryClient({
defaultOptions: {
queries: {
retry: false,
},
},
});
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Inconsistent QueryClient instances.

Two different QueryClient instances are used: one at module level (Line 12) passed to QueryClientProvider, and another created inline (Line 32) passed to the router context. This mismatch could cause cache inconsistencies if components or hooks expect data from the same client.

Additionally, the module-level QueryClient persists across story renders, potentially causing state pollution between stories.

Proposed fix: use consistent QueryClient
 const createTestRouter = (flowId: string) => {
 	const rootRoute = createRootRoute({
 		component: () => (
 			<Suspense fallback={<div>Loading...</div>}>
 				<FlowIconText flowId={flowId} />
 			</Suspense>
 		),
 	});

 	return createRouter({
 		routeTree: rootRoute,
 		history: createMemoryHistory({ initialEntries: ["/"] }),
-		context: { queryClient: new QueryClient() },
+		context: { queryClient },
 	});
 };

Alternatively, create a fresh QueryClient per decorator invocation to isolate story state.

Also applies to: 29-33

🤖 Prompt for AI Agents
In `@ui-v2/src/components/flows/flow-icon-text/flow-icon-text.stories.tsx` around
lines 12 - 18, The story uses two different QueryClient instances (the
module-level QueryClient and a second inline QueryClient passed to the router
context), causing cache inconsistencies and state leakage between stories;
update the decorator to create a fresh QueryClient per invocation and reuse that
same instance for both the QueryClientProvider and any router/test providers so
all hooks share one client and each story gets an isolated client (refer to
QueryClient, new QueryClient(...), and QueryClientProvider in the file).

import { Suspense } from "react";
import { buildFLowDetailsQuery } from "@/api/flows";
import { Icon } from "@/components/ui/icons";
import { Skeleton } from "@/components/ui/skeleton";
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Skeleton imported but unused; Suspense missing fallback.

The Skeleton component is imported but never used. The <Suspense> boundary has no fallback prop, so nothing renders while the query is pending. Consider using the imported Skeleton as the fallback for better loading UX.

Proposed fix
 export const FlowIconText = ({ flowId }: FlowIconTextProps) => {
 	return (
-		<Suspense>
+		<Suspense fallback={<Skeleton className="h-4 w-24" />}>
 			<FlowIconTextImplementation flowId={flowId} />
 		</Suspense>
 	);
 };

Also applies to: 14-14

🤖 Prompt for AI Agents
In `@ui-v2/src/components/flows/flow-icon-text/flow-icon-text.tsx` at line 6, The
Suspense boundary in flow-icon-text.tsx is missing a fallback and the imported
Skeleton is unused; update the <Suspense> wrapping the async content (look for
the Suspense component in FlowIconText or FlowIconTextSuspense) to pass a
fallback prop that renders the imported Skeleton component for loading state,
and if you decide not to use Skeleton remove its import to avoid the unused
import warning; ensure the fallback matches the component's size/props so the
Skeleton visually fits the icon/text area.

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