Skip to content

Conversation

@0ubbe
Copy link
Contributor

@0ubbe 0ubbe commented Dec 18, 2025

Changes πŸ—οΈ

Use the Design System <Dialog /> on the old builder, which supports long content scrolling ( the current one does not, causing issues in graphs with many run inputs )...

Checklist πŸ“‹

For code changes:

  • I have clearly listed my changes in the PR description
  • I have made a test plan
  • I have tested my changes according to the test plan:
    • Run locally and test the above

Summary by CodeRabbit

  • New Features

    • Added Enhanced Rendering toggle for improved output handling and display (controlled via feature flag)
  • Improvements

    • Refined dialog layouts and user interactions
    • Enhanced copy-to-clipboard functionality with toast notifications upon copying

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

@0ubbe 0ubbe requested review from Abhi1992002 and ntindle December 18, 2025 18:45
@0ubbe 0ubbe requested a review from a team as a code owner December 18, 2025 18:45
@0ubbe 0ubbe requested review from majdyz and removed request for a team December 18, 2025 18:45
@github-project-automation github-project-automation bot moved this to πŸ†• Needs initial review in AutoGPT development kanban Dec 18, 2025
@netlify
Copy link

netlify bot commented Dec 18, 2025

βœ… Deploy Preview for auto-gpt-docs-dev canceled.

Name Link
πŸ”¨ Latest commit 0136b22
πŸ” Latest deploy log https://app.netlify.com/projects/auto-gpt-docs-dev/deploys/694528d7ef49d900086d3c47

@coderabbitai
Copy link

coderabbitai bot commented Dec 18, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

Two legacy dialog components in the build interface were refactored to use a unified Dialog API. ExpandableOutputDialog now supports an enhanced rendering mode controlled by a feature flag, while RunnerInputUI migrated to the new Dialog structure with simplified layout and controlled open/close handling.

Changes

Cohort / File(s) Summary
Dialog API Migration
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/ExpandableOutputDialog.tsx
Replaced monolithic Dialog composition with new unified Dialog API. Added enhanced rendering toggle via feature flag ENABLE_ENHANCED_OUTPUT_HANDLING. Introduced registry-based rendering system with OutputItem components, conditional OutputActions display, and dual rendering paths (enhanced vs. standard). Reworked copy logic and toast notifications. Maintained existing footer data display with conditional Copy All visibility.
Dialog API Refactoring
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerInputUI.tsx
Migrated to new Dialog API with controlled open/close via onClose handler. Simplified JSX structure and replaced DialogHeader/DialogTitle/DialogDescription with direct Dialog.Content layout. Updated width constraints and removed legacy Dialog subcomponent imports.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • ExpandableOutputDialog: Pay close attention to the new rendering registry system and the interaction between enhanced/non-enhanced rendering paths
  • Feature flag integration: Verify ENABLE_ENHANCED_OUTPUT_HANDLING flag is properly wired and fallback behavior is sound
  • Copy logic refactoring: Ensure per-item and copy-all functionality work correctly in both rendering modes
  • OutputActions component: Confirm it renders and functions properly when enhanced rendering is active

Poem

🐰 Boing! The dialogs bounce anew,
Dialog APIs shine through and through,
With enhanced rendering flags so keen,
Output items dance in patterns clean,
Legacy chains fade to the pastβ€”hooray! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
βœ… Passed checks (2 passed)
Check name Status Explanation
Description Check βœ… Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check βœ… Passed The title 'fix(frontend): use DS Dialog on old builder' directly aligns with the main objective of replacing legacy dialog with Design System Dialog component to enable scrolling support.

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.

@github-actions github-actions bot added the platform/frontend AutoGPT Platform - Front end label Dec 18, 2025
@netlify
Copy link

netlify bot commented Dec 18, 2025

βœ… Deploy Preview for auto-gpt-docs canceled.

Name Link
πŸ”¨ Latest commit 0136b22
πŸ” Latest deploy log https://app.netlify.com/projects/auto-gpt-docs/deploys/694528d790e5f7000901f4c7

@deepsource-io
Copy link

deepsource-io bot commented Dec 18, 2025

Here's the code health analysis summary for commits c5e8b0b..c3c1432. View details on DeepSourceΒ β†—.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource JavaScript LogoJavaScriptβœ…Β Success
❗ 4 occurences introduced
🎯 4 occurences resolved
View CheckΒ β†—
DeepSource Python LogoPythonβœ…Β SuccessView CheckΒ β†—

πŸ’‘ If you’re a repository administrator, you can configure the quality gates from the settings.

Comment on lines +67 to +75
<Dialog
title="Run your agent"
controlled={{
isOpen,
set: (open) => {
if (!open) doClose();
},
}}
onClose={doClose}

This comment was marked as outdated.

@0ubbe
Copy link
Contributor Author

0ubbe commented Dec 19, 2025

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Dec 19, 2025

βœ… 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

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/ExpandableOutputDialog.tsx (1)

10-17: Use Phosphor Icons instead of lucide-react.

Per coding guidelines, only Phosphor Icons should be used in the frontend. Replace Clipboard and Maximize2 from lucide-react with their Phosphor equivalents.

πŸ”Ž Proposed fix
-import { Clipboard, Maximize2 } from "lucide-react";
+import { ArrowsOut, ClipboardText } from "@phosphor-icons/react";

Then update usages:

  • <Maximize2 size={20} /> β†’ <ArrowsOut size={20} />
  • <Clipboard size={14} /> β†’ <ClipboardText size={14} />
  • <Clipboard size={16} /> β†’ <ClipboardText size={16} />

Based on learnings, only Phosphor Icons should be used in frontend code.

♻️ Duplicate comments (1)
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerInputUI.tsx (1)

67-79: Potential double invocation of doClose.

Both the controlled.set handler and the onClose prop invoke doClose(). Depending on the Dialog implementation, this may cause doClose to be called twice when the dialog closes. Consider removing the redundant onClose={doClose} prop since the controlled handler already handles the close logic.

πŸ”Ž Proposed fix
     <Dialog
       title="Run your agent"
       controlled={{
         isOpen,
         set: (open) => {
           if (!open) doClose();
         },
       }}
-      onClose={doClose}
       styling={{
         maxWidth: "56rem",
         width: "90vw",
       }}
     >

Please verify the Dialog component's implementation to confirm whether both handlers are invoked on close:

#!/bin/bash
# Search for Dialog component implementation to understand the onClose/controlled interaction
ast-grep --pattern $'function Dialog($_) {
  $$$
}'

# Also search for the Dialog component definition
rg -n "onClose|controlled" --type=tsx -A3 -B3 -g '**/Dialog.tsx'
🧹 Nitpick comments (3)
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/ExpandableOutputDialog.tsx (3)

140-151: Same potential double onClose invocation as RunnerInputUI.

The controlled.set handler calls onClose() when open is false, and onClose is also passed directly. Consider removing the redundant onClose prop.

πŸ”Ž Proposed fix
       controlled={{
         isOpen,
         set: (open) => {
           if (!open) onClose();
         },
       }}
-      onClose={onClose}
       styling={{

100-113: Add error handling for clipboard operation.

The navigator.clipboard.writeText() call can fail (e.g., due to permissions or secure context requirements). Consider adding a .catch() handler to notify the user of failures.

πŸ”Ž Proposed fix
     navigator.clipboard.writeText(formattedData).then(() => {
       toast({
         title: `"${beautifyString(pinName)}" data copied to clipboard!`,
         duration: 2000,
       });
-    });
+    }).catch(() => {
+      toast({
+        title: "Failed to copy to clipboard",
+        variant: "destructive",
+        duration: 2000,
+      });
+    });

205-217: Same clipboard error handling concern.

The per-item copy operation should also handle clipboard failures for consistency.

πŸ”Ž Proposed fix
                                 navigator.clipboard
                                   .writeText(itemData)
                                   .then(() => {
                                     toast({
                                       title: `Item ${index + 1} copied to clipboard!`,
                                       duration: 2000,
                                     });
+                                  })
+                                  .catch(() => {
+                                    toast({
+                                      title: "Failed to copy to clipboard",
+                                      variant: "destructive",
+                                      duration: 2000,
+                                    });
                                   });
πŸ“œ Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between c5e8b0b and c3c1432.

πŸ“’ Files selected for processing (2)
  • autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/ExpandableOutputDialog.tsx (2 hunks)
  • autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerInputUI.tsx (2 hunks)
🧰 Additional context used
πŸ““ Path-based instructions (8)
autogpt_platform/frontend/**/*.{ts,tsx}

πŸ“„ CodeRabbit inference engine (.github/copilot-instructions.md)

autogpt_platform/frontend/**/*.{ts,tsx}: Always run pnpm install before frontend development, then use pnpm dev to start development server on port 3000
For frontend code formatting and linting, always run pnpm format

If adding protected frontend routes, update frontend/lib/supabase/middleware.ts

autogpt_platform/frontend/**/*.{ts,tsx}: Use generated API hooks from @/app/api/__generated__/endpoints/ for data fetching in frontend
Use function declarations (not arrow functions) for components and handlers in frontend
Only use Phosphor Icons in frontend; never use other icon libraries
Never use src/components/__legacy__/* or deprecated BackendAPI in frontend

Files:

  • autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerInputUI.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/ExpandableOutputDialog.tsx
autogpt_platform/frontend/**/*.{ts,tsx,json}

πŸ“„ CodeRabbit inference engine (.github/copilot-instructions.md)

Use Node.js 21+ with pnpm package manager for frontend development

Files:

  • autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerInputUI.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/ExpandableOutputDialog.tsx
autogpt_platform/frontend/src/**/*.{ts,tsx}

πŸ“„ CodeRabbit inference engine (.github/copilot-instructions.md)

autogpt_platform/frontend/src/**/*.{ts,tsx}: Use generated API hooks from @/app/api/generated/endpoints/ (generated via Orval from backend OpenAPI spec). Pattern: use{Method}{Version}{OperationName} (e.g., useGetV2ListLibraryAgents). Regenerate with: pnpm generate:api. Never use deprecated BackendAPI or src/lib/autogpt-server-api/*
Use function declarations for components and handlers (not arrow functions). Only arrow functions for small inline lambdas (map, filter, etc.)
Use PascalCase for components, camelCase with use prefix for hooks
No barrel files or index.ts re-exports in frontend
For frontend render errors, use component. For mutation errors, display with toast notifications. For manual exceptions, use Sentry.captureException()
Default to client components (use client). Use server components only for SEO or extreme TTFB needs. Use React Query for server state via generated hooks. Co-locate UI state in components/hooks

Files:

  • autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerInputUI.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/ExpandableOutputDialog.tsx
autogpt_platform/frontend/**/*.{js,ts,jsx,tsx}

πŸ“„ CodeRabbit inference engine (AGENTS.md)

Format frontend code using pnpm format

Files:

  • autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerInputUI.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/ExpandableOutputDialog.tsx
autogpt_platform/frontend/**

πŸ“„ CodeRabbit inference engine (autogpt_platform/CLAUDE.md)

autogpt_platform/frontend/**: Install frontend dependencies using pnpm i instead of npm
Generate API client from OpenAPI spec using pnpm generate:api
Regenerate API client hooks using pnpm generate:api when OpenAPI spec changes

Files:

  • autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerInputUI.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/ExpandableOutputDialog.tsx
autogpt_platform/frontend/src/**/*.tsx

πŸ“„ CodeRabbit inference engine (autogpt_platform/CLAUDE.md)

Use design system components from src/components/ (atoms, molecules, organisms) in frontend

Files:

  • autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerInputUI.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/ExpandableOutputDialog.tsx
autogpt_platform/frontend/src/app/**/*.tsx

πŸ“„ CodeRabbit inference engine (autogpt_platform/CLAUDE.md)

Create frontend pages in src/app/(platform)/feature-name/page.tsx with corresponding usePageName.ts hook and local components/ subfolder

Files:

  • autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerInputUI.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/ExpandableOutputDialog.tsx
autogpt_platform/frontend/**/*.{ts,tsx,css}

πŸ“„ CodeRabbit inference engine (autogpt_platform/CLAUDE.md)

Use only Tailwind CSS for styling in frontend, with design tokens and Phosphor Icons

Files:

  • autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerInputUI.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/ExpandableOutputDialog.tsx
🧠 Learnings (3)
πŸ“š Learning: 2025-11-25T08:49:03.583Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/CLAUDE.md:0-0
Timestamp: 2025-11-25T08:49:03.583Z
Learning: Applies to autogpt_platform/frontend/**/*.{ts,tsx} : Never use `src/components/__legacy__/*` or deprecated `BackendAPI` in frontend

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerInputUI.tsx
πŸ“š Learning: 2025-11-25T08:48:33.246Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T08:48:33.246Z
Learning: Applies to autogpt_platform/frontend/src/components/**/*.tsx : Separate frontend component render logic from data/behavior. Structure: ComponentName/ComponentName.tsx + useComponentName.ts + helpers.ts. Small components (3-4 lines) can be inline. Render-only components can be direct files without folders

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/ExpandableOutputDialog.tsx
πŸ“š Learning: 2025-11-25T08:49:03.583Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/CLAUDE.md:0-0
Timestamp: 2025-11-25T08:49:03.583Z
Learning: Applies to autogpt_platform/frontend/src/components/**/*.{ts,tsx} : Separate render logic from data/behavior in components

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/ExpandableOutputDialog.tsx
🧬 Code graph analysis (1)
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerInputUI.tsx (1)
autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/agent-run-draft-view.tsx (1)
  • AgentRunDraftView (46-724)
πŸ”‡ Additional comments (7)
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerInputUI.tsx (3)

1-8: LGTM!

Import paths are correct. The Dialog component is properly imported from the design system molecules path, and AgentRunDraftView is imported from the appropriate location.


33-64: LGTM!

The callback wrappers properly sequence the run/schedule actions before closing the dialog, and the dependency arrays are correctly specified.


81-93: LGTM!

The content structure is clean. The conditional prop passing for doRun/onRun and doCreateSchedule/onCreateSchedule correctly handles both scenarios where handlers are provided and when they're not.

autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/ExpandableOutputDialog.tsx (4)

41-98: LGTM!

The outputItems memoization logic correctly prepares data for the enhanced renderer with proper fallback to TextRenderer. The metadata extraction from object values is handled defensively.


117-139: LGTM!

The title layout with the Enhanced Rendering toggle is well-structured. The Switch has proper accessibility with matching htmlFor and id attributes, and the feature flag gating is correctly applied.


176-242: LGTM!

The conditional rendering logic correctly handles all three states (enhanced renderer, standard renderer, and empty data). The layout structure is clean and the ScrollArea provides proper overflow handling for long content.


245-262: LGTM!

The footer correctly displays the item count and conditionally shows the "Copy All" button only when enhanced rendering is disabled (since enhanced mode has its own OutputActions).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

platform/frontend AutoGPT Platform - Front end size/l

Projects

Status: πŸ†• Needs initial review
Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants