Skip to content

Conversation

@anthhub
Copy link
Contributor

@anthhub anthhub commented Dec 17, 2025

nodeData parsing to skip invalid entries.

Summary by CodeRabbit

  • Bug Fixes

    • Skip invalid node executions without interrupting processing.
    • Order products according to workflow result configuration while preserving backward compatibility when none is specified.
    • Ensure runtime drive files are included in result ordering.
  • Refactor

    • Stabilized selected-results grid ordering by mapping selections to their source entries for consistent display.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 17, 2025

Walkthrough

Reworks product consolidation and ordering in the workflow app to use source-node-driven ordering via resultNodeIds and changes node-execution parsing to skip invalid entries. Also updates selected-results-grid to build selectedNodes from an ID->node map to preserve ordering from selectedResults.

Changes

Cohort / File(s) Summary
Product consolidation & node execution parsing
packages/web-core/src/pages/workflow-app/index.tsx
Node execution parsing now skips invalid nodeData entries instead of returning early. Replaces simple deduplication with a multi-path product ordering driven by workflowApp?.resultNodeIds: collects candidates from legacyNodeProducts, legacySkillProducts, and driveProducts; groups by source node ID (resolving df- drive-file IDs to parent source IDs); orders products per resultNodeIds; appends remaining candidates for backward compatibility. Expands useMemo/useEffect dependencies (e.g., canvasFilesById, canvasNodesByResultId) and preserves runtime drive-file integration.
Selected results ordering fix
packages/ai-workspace-common/src/components/workflow-app/selected-results-grid.tsx
Builds selectedNodes by mapping selectedResults through a Map of options by id, filtering undefineds, ensuring display order follows selectedResults and stabilizing ordering independent of options sequence.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Verify all backward-compatibility branches and that remaining candidates are appended correctly.
  • Inspect drive-file ID -> source ID resolution in edge cases (missing mappings, duplicated IDs).
  • Confirm useMemo/useEffect dependency updates avoid stale values or excess renders.
  • Review selected-results-grid mapping for any performance impacts with large option sets.

Possibly related PRs

Suggested reviewers

  • mrcfps
  • CH1111

Poem

🐰 Hopping through code with a curious twitch,

Nodes now skip errors without a glitch,
Products line up, source-first and neat,
Drive files find home where results meet,
A carrot for testers — quick, concise, and spry! 🥕

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title clearly and specifically describes the main changes: adding custom product ordering based on resultNodeIds and refining nodeData parsing to skip invalid entries.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ 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 fix/workflow-product-ordering

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.

Copy link

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

🧹 Nitpick comments (1)
packages/web-core/src/pages/workflow-app/index.tsx (1)

508-526: Add null checks for product.nodeId to match backward compatibility path.

The backward compatibility path (line 462) defensively checks product?.nodeId before using it, but the new ordering logic at lines 511 and 522 uses product.nodeId directly without this check. For consistency and defensive coding, add the same null check.

       const candidates = productsBySourceId.get(targetSourceId);
       if (candidates && candidates.length > 0) {
         for (const product of candidates) {
-          if (!usedProducts.has(product.nodeId)) {
+          if (product?.nodeId && !usedProducts.has(product.nodeId)) {
             orderedProducts.push(product);
             usedProducts.add(product.nodeId);
           }
         }
       }
     }

     // IMPORTANT: Add remaining products that weren't in resultNodeIds
     // This ensures backward compatibility - no products are lost
     for (const product of allCandidates) {
-      if (!usedProducts.has(product.nodeId)) {
+      if (product?.nodeId && !usedProducts.has(product.nodeId)) {
         orderedProducts.push(product);
         usedProducts.add(product.nodeId);
       }
     }

As per coding guidelines, always use optional chaining when accessing object properties.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6a6eb4f and 1f697f0.

📒 Files selected for processing (1)
  • packages/web-core/src/pages/workflow-app/index.tsx (2 hunks)
🧰 Additional context used
📓 Path-based instructions (20)
**/*.{jsx,tsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{jsx,tsx}: Always use tailwind css to style the component
Always wrap pure components with React.memo to prevent unnecessary re-renders
Always use useMemo for expensive computations or complex object creation
Always use useCallback for function props to maintain referential equality
Always specify proper dependency arrays in useEffect to prevent infinite loops
Always avoid inline object/array creation in render to prevent unnecessary re-renders
Always use proper key props when rendering lists
Always split nested components with closures into separate components to avoid performance issues and improve code maintainability

**/*.{jsx,tsx}: Always wrap pure components with React.memo to prevent unnecessary re-renders
Always use useMemo for expensive computations or complex object creation in React
Always use useCallback for function props to maintain referential equality in React
Always specify proper dependency arrays in useEffect to prevent infinite loops in React
Always avoid inline object/array creation in render to prevent unnecessary re-renders in React
Always use proper key props when rendering lists in React (avoid using index when possible)
Always split nested components with closures into separate components in React
Use lazy loading for components that are not immediately needed in React
Debounce handlers for events that might fire rapidly (resize, scroll, input) in React
Implement fallback UI for components that might fail in React
Use error boundaries to catch and handle runtime errors in React

**/*.{jsx,tsx}: Place each attribute on a new line when a component has multiple attributes in JSX
Use self-closing tags for elements without children in JSX
Keep JSX expressions simple, extract complex logic to variables
Put closing brackets for multi-line JSX on a new line

**/*.{jsx,tsx}: Component file names should match the component name
Organize function components in order: imports, type definitions, constants, component function, hook calls, e...

Files:

  • packages/web-core/src/pages/workflow-app/index.tsx
**/*.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{js,ts,jsx,tsx}: Always use optional chaining (?.) when accessing object properties
Always use nullish coalescing (??) or default values for potentially undefined values
Always check array existence before using array methods
Always validate object properties before destructuring
Always use single quotes for string literals in JavaScript/TypeScript code

**/*.{js,ts,jsx,tsx}: Use semicolons at the end of statements
Include spaces around operators (e.g., a + b instead of a+b)
Always use curly braces for control statements
Place opening braces on the same line as their statement

**/*.{js,ts,jsx,tsx}: Group import statements in order: React/framework libraries, third-party libraries, internal modules, relative path imports, type imports, style imports
Sort imports alphabetically within each import group
Leave a blank line between import groups
Extract complex logic into custom hooks
Use functional updates for state (e.g., setCount(prev => prev + 1))
Split complex state into multiple state variables rather than single large objects
Use useReducer for complex state logic instead of multiple useState calls

Files:

  • packages/web-core/src/pages/workflow-app/index.tsx
**/*.{js,ts,tsx,jsx,py,java,cpp,c,cs,rb,go,rs,php,swift,kt,scala,r,m,mm,sql}

📄 CodeRabbit inference engine (.cursor/rules/00-language-priority.mdc)

**/*.{js,ts,tsx,jsx,py,java,cpp,c,cs,rb,go,rs,php,swift,kt,scala,r,m,mm,sql}: All code comments MUST be written in English
All variable names, function names, class names, and other identifiers MUST use English words
Comments should be concise and explain 'why' rather than 'what'
Use proper grammar and punctuation in comments
Keep comments up-to-date when code changes
Document complex logic, edge cases, and important implementation details
Use clear, descriptive names that indicate purpose
Avoid abbreviations unless they are universally understood

Files:

  • packages/web-core/src/pages/workflow-app/index.tsx
**/*.{js,ts,tsx,jsx}

📄 CodeRabbit inference engine (.cursor/rules/00-language-priority.mdc)

Use JSDoc style comments for functions and classes in JavaScript/TypeScript

Files:

  • packages/web-core/src/pages/workflow-app/index.tsx
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/01-code-style.mdc)

**/*.{js,jsx,ts,tsx}: Use single quotes for string literals in TypeScript/JavaScript
Always use optional chaining (?.) when accessing object properties in TypeScript/JavaScript
Always use nullish coalescing (??) or default values for potentially undefined values in TypeScript/JavaScript
Always check array existence before using array methods in TypeScript/JavaScript
Validate object properties before destructuring in TypeScript/JavaScript
Use ES6+ features like arrow functions, destructuring, and spread operators in TypeScript/JavaScript
Avoid magic numbers and strings - use named constants in TypeScript/JavaScript
Use async/await instead of raw promises for asynchronous code in TypeScript/JavaScript

Files:

  • packages/web-core/src/pages/workflow-app/index.tsx
**/*.{jsx,tsx,css}

📄 CodeRabbit inference engine (.cursor/rules/01-code-style.mdc)

**/*.{jsx,tsx,css}: Use Tailwind CSS for styling components
Follow the utility-first approach with Tailwind CSS
Group related utility classes together in Tailwind CSS
Prefer Tailwind utilities over custom CSS when possible

Files:

  • packages/web-core/src/pages/workflow-app/index.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/03-typescript-guidelines.mdc)

**/*.{ts,tsx}: Avoid using any type whenever possible - use unknown type instead with proper type guards
Always define explicit return types for functions, especially for public APIs
Prefer extending existing types over creating entirely new types
Use TypeScript utility types (Partial<T>, Pick<T, K>, Omit<T, K>, Readonly<T>, Record<K, T>) to derive new types
Use union types and intersection types to combine existing types
Always import types explicitly using the import type syntax
Group type imports separately from value imports
Minimize creating local type aliases for imported types

Files:

  • packages/web-core/src/pages/workflow-app/index.tsx
**/*.{js,ts,jsx,tsx,css,json}

📄 CodeRabbit inference engine (.cursor/rules/04-code-formatting.mdc)

Maximum line length of 100 characters

Files:

  • packages/web-core/src/pages/workflow-app/index.tsx
**/*.{js,ts,jsx,tsx,css,json,yml,yaml}

📄 CodeRabbit inference engine (.cursor/rules/04-code-formatting.mdc)

Use 2 spaces for indentation, no tabs

Files:

  • packages/web-core/src/pages/workflow-app/index.tsx
**/*.{js,ts,jsx,tsx,css,json,yml,yaml,md}

📄 CodeRabbit inference engine (.cursor/rules/04-code-formatting.mdc)

No trailing whitespace at the end of lines

Files:

  • packages/web-core/src/pages/workflow-app/index.tsx
**/*.{jsx,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/05-code-organization.mdc)

Each component file should contain only one main component

Files:

  • packages/web-core/src/pages/workflow-app/index.tsx
**/index.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (.cursor/rules/05-code-organization.mdc)

Use index files to export multiple components from a directory

Files:

  • packages/web-core/src/pages/workflow-app/index.tsx
**/*.tsx

📄 CodeRabbit inference engine (.cursor/rules/05-code-organization.mdc)

Explicitly type props with interfaces or types in React components

Files:

  • packages/web-core/src/pages/workflow-app/index.tsx
**/*.{css,scss,sass,less,js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/09-design-system.mdc)

**/*.{css,scss,sass,less,js,jsx,ts,tsx}: Primary color (#155EEF) should be used for main brand color in buttons, links, and accents
Error color (#F04438) should be used for error states and destructive actions
Success color (#12B76A) should be used for success states and confirmations
Warning color (#F79009) should be used for warnings and important notifications
Info color (#0BA5EC) should be used for informational elements

Files:

  • packages/web-core/src/pages/workflow-app/index.tsx
**/*.{tsx,ts}

📄 CodeRabbit inference engine (.cursor/rules/09-i18n-guidelines.mdc)

**/*.{tsx,ts}: Use the translation wrapper component and useTranslation hook in components
Ensure all user-facing text is translatable

Files:

  • packages/web-core/src/pages/workflow-app/index.tsx
**/*.{tsx,ts,json}

📄 CodeRabbit inference engine (.cursor/rules/09-i18n-guidelines.mdc)

Support dynamic content with placeholders in translations

Files:

  • packages/web-core/src/pages/workflow-app/index.tsx
**/*.{tsx,ts,jsx,js,vue,css,scss,less}

📄 CodeRabbit inference engine (.cursor/rules/11-ui-design-patterns.mdc)

**/*.{tsx,ts,jsx,js,vue,css,scss,less}: Use the primary blue (#155EEF) for main UI elements, CTAs, and active states
Use red (#F04438) only for errors, warnings, and destructive actions
Use green (#12B76A) for success states and confirmations
Use orange (#F79009) for warning states and important notifications
Use blue (#0BA5EC) for informational elements
Primary buttons should be solid with the primary color
Secondary buttons should have a border with transparent or light background
Danger buttons should use the error color
Use consistent padding, border radius, and hover states for all buttons
Follow fixed button sizes based on their importance and context
Use consistent border radius (rounded-lg) for all cards
Apply light shadows (shadow-sm) for card elevation
Maintain consistent padding inside cards (p-4 or p-6)
Use subtle borders for card separation
Ensure proper spacing between card elements
Apply consistent styling to all form inputs
Use clear visual indicators for focus, hover, and error states in form elements
Apply proper spacing between elements using 8px, 16px, 24px increments
Ensure proper alignment of elements (left, center, or right)
Use responsive layouts that work across different device sizes
Maintain a minimum contrast ratio of 4.5:1 for text

Files:

  • packages/web-core/src/pages/workflow-app/index.tsx
**/*.{tsx,ts,jsx,js,vue}

📄 CodeRabbit inference engine (.cursor/rules/11-ui-design-patterns.mdc)

**/*.{tsx,ts,jsx,js,vue}: Include appropriate loading states for async actions in buttons
Group related form elements with appropriate spacing
Provide clear validation feedback for forms
Ensure proper labeling and accessibility for form elements
Ensure all interactive elements are keyboard accessible
Include appropriate ARIA attributes for complex components
Provide alternative text for images and icons
Support screen readers with semantic HTML elements

Files:

  • packages/web-core/src/pages/workflow-app/index.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/08-contributing-guidelines.mdc)

**/*.{ts,tsx,js,jsx}: Follow the TypeScript/JavaScript style guidelines
Ensure code is well-tested and documented

Files:

  • packages/web-core/src/pages/workflow-app/index.tsx
**/*.{tsx,jsx}

📄 CodeRabbit inference engine (.cursor/rules/08-contributing-guidelines.mdc)

Use React best practices for frontend code

Files:

  • packages/web-core/src/pages/workflow-app/index.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build / Build
🔇 Additional comments (2)
packages/web-core/src/pages/workflow-app/index.tsx (2)

393-408: LGTM! Correct behavior change for resilient parsing.

Changing from early return to continue ensures that invalid entries don't prevent parsing of subsequent valid executions. This improves robustness when nodeData may be missing or malformed for some entries.


529-537: LGTM! Dependencies are complete and correctly specified.

The useMemo dependencies properly include all referenced values: the source collections (nodeExecutions, runtimeDriveFiles), derived maps (sourceDriveFiles, parsedNodeExecutions, canvasFilesById, canvasNodesByResultId), and the ordering configuration (workflowApp?.resultNodeIds).

… `nodeData` parsing to skip invalid entries.
@anthhub anthhub force-pushed the fix/workflow-product-ordering branch from 1f697f0 to f6067d4 Compare December 17, 2025 14:21
Copy link

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

🧹 Nitpick comments (2)
packages/ai-workspace-common/src/components/workflow-app/selected-results-grid.tsx (1)

32-39: Wrap Map creation and array derivation in useMemo to prevent unnecessary recomputation.

The optionsById Map and selectedNodes array are recreated on every render. Since these operations involve iterating over arrays and creating new data structures, they should be memoized to avoid redundant work when props haven't changed.

As per coding guidelines, always use useMemo for expensive computations or complex object creation in React.

Apply this diff:

-    // Map options by ID for quick lookup
-    const optionsById = new Map(options.map((node) => [node.id, node]));
-
-    // Filter and order nodes according to selectedResults array order
-    // This ensures the display order matches the configured resultNodeIds order
-    const selectedNodes = selectedResults
-      .map((id) => optionsById.get(id))
-      .filter((node): node is CanvasNode => node !== undefined);
+    // Map options by ID for quick lookup
+    const optionsById = useMemo(
+      () => new Map(options.map((node) => [node.id, node])),
+      [options]
+    );
+
+    // Filter and order nodes according to selectedResults array order
+    // This ensures the display order matches the configured resultNodeIds order
+    const selectedNodes = useMemo(
+      () =>
+        selectedResults
+          .map((id) => optionsById.get(id))
+          .filter((node): node is CanvasNode => node !== undefined),
+      [selectedResults, optionsById]
+    );
packages/web-core/src/pages/workflow-app/index.tsx (1)

453-541: Consider safer array access and extracting helper functions for improved maintainability.

The ordering logic is correct and handles backward compatibility well. However, there are opportunities to improve code safety and readability:

  1. Line 489: The non-null assertion productsBySourceId.get(sourceId)!.push(product) is technically safe due to the check on line 486, but could be written more defensively.

  2. Overall complexity: The nested loops and conditionals increase cognitive load. Extracting helper functions would improve maintainability.

Safer alternative for line 489:

       if (!productsBySourceId.has(sourceId)) {
         productsBySourceId.set(sourceId, []);
       }
-      productsBySourceId.get(sourceId)!.push(product);
+      const products = productsBySourceId.get(sourceId);
+      if (products) {
+        products.push(product);
+      }

Optional: Extract helper functions to reduce complexity:

Consider extracting the source ID resolution logic (lines 476-484, 496-508) into a reusable helper function:

const resolveSourceId = (
  id: string,
  entityId: string | undefined,
  parsedNodeExecutions: Map<string, string>,
  sourceDriveFiles: Set<string>,
  canvasFilesById: Map<string, DriveFile>,
  canvasNodesByResultId: Map<string, string>
): string => {
  // Resolution logic here
};

This would make the main logic flow clearer and reduce duplication.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1f697f0 and f6067d4.

📒 Files selected for processing (2)
  • packages/ai-workspace-common/src/components/workflow-app/selected-results-grid.tsx (1 hunks)
  • packages/web-core/src/pages/workflow-app/index.tsx (2 hunks)
🧰 Additional context used
📓 Path-based instructions (20)
**/*.{jsx,tsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{jsx,tsx}: Always use tailwind css to style the component
Always wrap pure components with React.memo to prevent unnecessary re-renders
Always use useMemo for expensive computations or complex object creation
Always use useCallback for function props to maintain referential equality
Always specify proper dependency arrays in useEffect to prevent infinite loops
Always avoid inline object/array creation in render to prevent unnecessary re-renders
Always use proper key props when rendering lists
Always split nested components with closures into separate components to avoid performance issues and improve code maintainability

**/*.{jsx,tsx}: Always wrap pure components with React.memo to prevent unnecessary re-renders
Always use useMemo for expensive computations or complex object creation in React
Always use useCallback for function props to maintain referential equality in React
Always specify proper dependency arrays in useEffect to prevent infinite loops in React
Always avoid inline object/array creation in render to prevent unnecessary re-renders in React
Always use proper key props when rendering lists in React (avoid using index when possible)
Always split nested components with closures into separate components in React
Use lazy loading for components that are not immediately needed in React
Debounce handlers for events that might fire rapidly (resize, scroll, input) in React
Implement fallback UI for components that might fail in React
Use error boundaries to catch and handle runtime errors in React

**/*.{jsx,tsx}: Place each attribute on a new line when a component has multiple attributes in JSX
Use self-closing tags for elements without children in JSX
Keep JSX expressions simple, extract complex logic to variables
Put closing brackets for multi-line JSX on a new line

**/*.{jsx,tsx}: Component file names should match the component name
Organize function components in order: imports, type definitions, constants, component function, hook calls, e...

Files:

  • packages/ai-workspace-common/src/components/workflow-app/selected-results-grid.tsx
  • packages/web-core/src/pages/workflow-app/index.tsx
**/*.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{js,ts,jsx,tsx}: Always use optional chaining (?.) when accessing object properties
Always use nullish coalescing (??) or default values for potentially undefined values
Always check array existence before using array methods
Always validate object properties before destructuring
Always use single quotes for string literals in JavaScript/TypeScript code

**/*.{js,ts,jsx,tsx}: Use semicolons at the end of statements
Include spaces around operators (e.g., a + b instead of a+b)
Always use curly braces for control statements
Place opening braces on the same line as their statement

**/*.{js,ts,jsx,tsx}: Group import statements in order: React/framework libraries, third-party libraries, internal modules, relative path imports, type imports, style imports
Sort imports alphabetically within each import group
Leave a blank line between import groups
Extract complex logic into custom hooks
Use functional updates for state (e.g., setCount(prev => prev + 1))
Split complex state into multiple state variables rather than single large objects
Use useReducer for complex state logic instead of multiple useState calls

Files:

  • packages/ai-workspace-common/src/components/workflow-app/selected-results-grid.tsx
  • packages/web-core/src/pages/workflow-app/index.tsx
**/*.{js,ts,tsx,jsx,py,java,cpp,c,cs,rb,go,rs,php,swift,kt,scala,r,m,mm,sql}

📄 CodeRabbit inference engine (.cursor/rules/00-language-priority.mdc)

**/*.{js,ts,tsx,jsx,py,java,cpp,c,cs,rb,go,rs,php,swift,kt,scala,r,m,mm,sql}: All code comments MUST be written in English
All variable names, function names, class names, and other identifiers MUST use English words
Comments should be concise and explain 'why' rather than 'what'
Use proper grammar and punctuation in comments
Keep comments up-to-date when code changes
Document complex logic, edge cases, and important implementation details
Use clear, descriptive names that indicate purpose
Avoid abbreviations unless they are universally understood

Files:

  • packages/ai-workspace-common/src/components/workflow-app/selected-results-grid.tsx
  • packages/web-core/src/pages/workflow-app/index.tsx
**/*.{js,ts,tsx,jsx}

📄 CodeRabbit inference engine (.cursor/rules/00-language-priority.mdc)

Use JSDoc style comments for functions and classes in JavaScript/TypeScript

Files:

  • packages/ai-workspace-common/src/components/workflow-app/selected-results-grid.tsx
  • packages/web-core/src/pages/workflow-app/index.tsx
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/01-code-style.mdc)

**/*.{js,jsx,ts,tsx}: Use single quotes for string literals in TypeScript/JavaScript
Always use optional chaining (?.) when accessing object properties in TypeScript/JavaScript
Always use nullish coalescing (??) or default values for potentially undefined values in TypeScript/JavaScript
Always check array existence before using array methods in TypeScript/JavaScript
Validate object properties before destructuring in TypeScript/JavaScript
Use ES6+ features like arrow functions, destructuring, and spread operators in TypeScript/JavaScript
Avoid magic numbers and strings - use named constants in TypeScript/JavaScript
Use async/await instead of raw promises for asynchronous code in TypeScript/JavaScript

Files:

  • packages/ai-workspace-common/src/components/workflow-app/selected-results-grid.tsx
  • packages/web-core/src/pages/workflow-app/index.tsx
**/*.{jsx,tsx,css}

📄 CodeRabbit inference engine (.cursor/rules/01-code-style.mdc)

**/*.{jsx,tsx,css}: Use Tailwind CSS for styling components
Follow the utility-first approach with Tailwind CSS
Group related utility classes together in Tailwind CSS
Prefer Tailwind utilities over custom CSS when possible

Files:

  • packages/ai-workspace-common/src/components/workflow-app/selected-results-grid.tsx
  • packages/web-core/src/pages/workflow-app/index.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/03-typescript-guidelines.mdc)

**/*.{ts,tsx}: Avoid using any type whenever possible - use unknown type instead with proper type guards
Always define explicit return types for functions, especially for public APIs
Prefer extending existing types over creating entirely new types
Use TypeScript utility types (Partial<T>, Pick<T, K>, Omit<T, K>, Readonly<T>, Record<K, T>) to derive new types
Use union types and intersection types to combine existing types
Always import types explicitly using the import type syntax
Group type imports separately from value imports
Minimize creating local type aliases for imported types

Files:

  • packages/ai-workspace-common/src/components/workflow-app/selected-results-grid.tsx
  • packages/web-core/src/pages/workflow-app/index.tsx
**/*.{js,ts,jsx,tsx,css,json}

📄 CodeRabbit inference engine (.cursor/rules/04-code-formatting.mdc)

Maximum line length of 100 characters

Files:

  • packages/ai-workspace-common/src/components/workflow-app/selected-results-grid.tsx
  • packages/web-core/src/pages/workflow-app/index.tsx
**/*.{js,ts,jsx,tsx,css,json,yml,yaml}

📄 CodeRabbit inference engine (.cursor/rules/04-code-formatting.mdc)

Use 2 spaces for indentation, no tabs

Files:

  • packages/ai-workspace-common/src/components/workflow-app/selected-results-grid.tsx
  • packages/web-core/src/pages/workflow-app/index.tsx
**/*.{js,ts,jsx,tsx,css,json,yml,yaml,md}

📄 CodeRabbit inference engine (.cursor/rules/04-code-formatting.mdc)

No trailing whitespace at the end of lines

Files:

  • packages/ai-workspace-common/src/components/workflow-app/selected-results-grid.tsx
  • packages/web-core/src/pages/workflow-app/index.tsx
**/*.{jsx,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/05-code-organization.mdc)

Each component file should contain only one main component

Files:

  • packages/ai-workspace-common/src/components/workflow-app/selected-results-grid.tsx
  • packages/web-core/src/pages/workflow-app/index.tsx
**/*.tsx

📄 CodeRabbit inference engine (.cursor/rules/05-code-organization.mdc)

Explicitly type props with interfaces or types in React components

Files:

  • packages/ai-workspace-common/src/components/workflow-app/selected-results-grid.tsx
  • packages/web-core/src/pages/workflow-app/index.tsx
**/*.{css,scss,sass,less,js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/09-design-system.mdc)

**/*.{css,scss,sass,less,js,jsx,ts,tsx}: Primary color (#155EEF) should be used for main brand color in buttons, links, and accents
Error color (#F04438) should be used for error states and destructive actions
Success color (#12B76A) should be used for success states and confirmations
Warning color (#F79009) should be used for warnings and important notifications
Info color (#0BA5EC) should be used for informational elements

Files:

  • packages/ai-workspace-common/src/components/workflow-app/selected-results-grid.tsx
  • packages/web-core/src/pages/workflow-app/index.tsx
**/*.{tsx,ts}

📄 CodeRabbit inference engine (.cursor/rules/09-i18n-guidelines.mdc)

**/*.{tsx,ts}: Use the translation wrapper component and useTranslation hook in components
Ensure all user-facing text is translatable

Files:

  • packages/ai-workspace-common/src/components/workflow-app/selected-results-grid.tsx
  • packages/web-core/src/pages/workflow-app/index.tsx
**/*.{tsx,ts,json}

📄 CodeRabbit inference engine (.cursor/rules/09-i18n-guidelines.mdc)

Support dynamic content with placeholders in translations

Files:

  • packages/ai-workspace-common/src/components/workflow-app/selected-results-grid.tsx
  • packages/web-core/src/pages/workflow-app/index.tsx
**/*.{tsx,ts,jsx,js,vue,css,scss,less}

📄 CodeRabbit inference engine (.cursor/rules/11-ui-design-patterns.mdc)

**/*.{tsx,ts,jsx,js,vue,css,scss,less}: Use the primary blue (#155EEF) for main UI elements, CTAs, and active states
Use red (#F04438) only for errors, warnings, and destructive actions
Use green (#12B76A) for success states and confirmations
Use orange (#F79009) for warning states and important notifications
Use blue (#0BA5EC) for informational elements
Primary buttons should be solid with the primary color
Secondary buttons should have a border with transparent or light background
Danger buttons should use the error color
Use consistent padding, border radius, and hover states for all buttons
Follow fixed button sizes based on their importance and context
Use consistent border radius (rounded-lg) for all cards
Apply light shadows (shadow-sm) for card elevation
Maintain consistent padding inside cards (p-4 or p-6)
Use subtle borders for card separation
Ensure proper spacing between card elements
Apply consistent styling to all form inputs
Use clear visual indicators for focus, hover, and error states in form elements
Apply proper spacing between elements using 8px, 16px, 24px increments
Ensure proper alignment of elements (left, center, or right)
Use responsive layouts that work across different device sizes
Maintain a minimum contrast ratio of 4.5:1 for text

Files:

  • packages/ai-workspace-common/src/components/workflow-app/selected-results-grid.tsx
  • packages/web-core/src/pages/workflow-app/index.tsx
**/*.{tsx,ts,jsx,js,vue}

📄 CodeRabbit inference engine (.cursor/rules/11-ui-design-patterns.mdc)

**/*.{tsx,ts,jsx,js,vue}: Include appropriate loading states for async actions in buttons
Group related form elements with appropriate spacing
Provide clear validation feedback for forms
Ensure proper labeling and accessibility for form elements
Ensure all interactive elements are keyboard accessible
Include appropriate ARIA attributes for complex components
Provide alternative text for images and icons
Support screen readers with semantic HTML elements

Files:

  • packages/ai-workspace-common/src/components/workflow-app/selected-results-grid.tsx
  • packages/web-core/src/pages/workflow-app/index.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/08-contributing-guidelines.mdc)

**/*.{ts,tsx,js,jsx}: Follow the TypeScript/JavaScript style guidelines
Ensure code is well-tested and documented

Files:

  • packages/ai-workspace-common/src/components/workflow-app/selected-results-grid.tsx
  • packages/web-core/src/pages/workflow-app/index.tsx
**/*.{tsx,jsx}

📄 CodeRabbit inference engine (.cursor/rules/08-contributing-guidelines.mdc)

Use React best practices for frontend code

Files:

  • packages/ai-workspace-common/src/components/workflow-app/selected-results-grid.tsx
  • packages/web-core/src/pages/workflow-app/index.tsx
**/index.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (.cursor/rules/05-code-organization.mdc)

Use index files to export multiple components from a directory

Files:

  • packages/web-core/src/pages/workflow-app/index.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build / Build
🔇 Additional comments (2)
packages/web-core/src/pages/workflow-app/index.tsx (2)

393-408: LGTM! Skip invalid entries instead of stopping all processing.

The change from early return to continue is correct. This allows the loop to process remaining valid node executions instead of stopping entirely when encountering a missing nodeData entry. The try-catch block below provides appropriate error handling for parse failures.


533-541: LGTM! Dependency array is complete and correct.

The useMemo dependency array properly includes all values used within the computation: nodeExecutions, runtimeDriveFiles, sourceDriveFiles, parsedNodeExecutions, workflowApp?.resultNodeIds, canvasFilesById, and canvasNodesByResultId. This ensures the products are recomputed whenever any relevant data changes.

@anthhub anthhub closed this Dec 18, 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