Skip to content

Refactor marketing app mockup into components - #2626

Merged
Kitenite merged 10 commits into
ParadevAI:mainfrom
Kitenite:kitenite/compare-our-demo-t
Mar 19, 2026
Merged

Kitenite merged 10 commits into
ParadevAI:mainfrom
Kitenite:kitenite/compare-our-demo-t

Conversation

@Kitenite

@Kitenite Kitenite commented Mar 19, 2026 •

Copy link
Copy Markdown
Member

Summary

  • split the marketing AppMockup into co-located section components and shared helpers
  • extract demo data and types into dedicated files to make the mockup easier to extend
  • preserve the current demo styling and behavior while matching the existing folder conventions

Testing

  • bunx biome check apps/marketing/src/app/components/HeroSection/components/AppMockup
  • bunx tsc -p apps/marketing/tsconfig.json --noEmit

Summary by cubic

Refactored the marketing AppMockup into small, co-located components with shared data and types, preserving behavior while polishing visuals and icons.

  • Refactors

    • Split monolith into LeftSidebar, MainPanel, RightSidebar, ExternalIdePopup, WindowChrome, WorkspaceItem, FileChangeItem, AsciiSpinner, and StatusIndicator.
    • Centralized demo data and types in constants.ts and types.ts; updated index.ts to re-export AppMockup and ActiveDemo; reduced AppMockup.tsx by ~900 LOC.
  • UI Polish

    • Refined window chrome, typography hierarchy, lower inactive contrast, and control radii; unified tones across the demo.
    • Polished ExternalIdePopup header and file tree icons; switched FileChangeItem to VS Code diff icons and added a "delete" change type.

Written for commit b4eec5d. Summary will update on new commits.

Summary by CodeRabbit

  • Refactor
    • Broke the interactive product demo into modular subcomponents for improved maintainability while preserving behavior.
    • Simplified root and overlay styling for cleaner visuals.
  • New Features
    • Added multiple dedicated UI pieces (window chrome, sidebars, main panel, file/change items, status indicators, spinner, external IDE popup) to enhance the mockup demo’s structure and animations.

@coderabbitai

coderabbitai Bot commented Mar 19, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

AppMockup was refactored into composable subcomponents (WindowChrome, LeftSidebar, MainPanel, RightSidebar, ExternalIdePopup) with types moved to types.ts and data to constants.ts. The root component now delegates rendering to these new modules and re-exports ActiveDemo from types.ts.

Changes

Cohort / File(s) Summary
Core refactor & types
apps/marketing/src/app/components/HeroSection/components/AppMockup/AppMockup.tsx, apps/marketing/src/app/components/HeroSection/components/AppMockup/index.ts, apps/marketing/src/app/components/HeroSection/components/AppMockup/types.ts, apps/marketing/src/app/components/HeroSection/components/AppMockup/constants.ts
Replaced monolithic mockup with a delegating AppMockup that imports new types and constants. ActiveDemo type moved to types.ts; static datasets extracted to constants.ts.
Main panel set
apps/marketing/src/app/components/HeroSection/components/AppMockup/components/WindowChrome/..., .../LeftSidebar/..., .../MainPanel/..., .../RightSidebar/..., .../ExternalIdePopup/...
Added five major UI components (each with index re-export) implementing chrome, sidebar(s), main terminal panel, and external IDE popup with framer-motion animations driven by activeDemo.
Utility subcomponents
apps/marketing/src/app/components/HeroSection/components/AppMockup/components/WorkspaceItem/..., .../StatusIndicator/..., .../FileChangeItem/..., .../AsciiSpinner/...
Added workspace row, status dot, file-change row, and ASCII spinner components (with index re-exports) used across the new panels.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 I hopped through lines and split the mockup fine,
Little windows now line up in a row,
Types tucked away and constants in line,
Animations hum and new components glow.
Reusable pieces—tiny, bright—hop, hop, go!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main refactoring effort: splitting a monolithic component into smaller, reusable components.
Description check ✅ Passed The description includes a clear summary of changes, testing performed, and additional context, mostly aligning with the template despite missing explicit Type of Change checkboxes.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

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.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 22 files

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (4)
apps/marketing/src/app/components/HeroSection/components/AppMockup/components/MainPanel/MainPanel.tsx (1)

14-190: Add a co-located test for the activeDemo state transitions.

This component now owns multiple animated UI branches; adding MainPanel.test.tsx next to it would reduce regression risk for the "Use Any Agents" vs "Create Parallel Branches" paths.

As per coding guidelines **/*.{ts,tsx}: Co-locate tests with their implementation files (e.g., Component.test.tsx next to Component.tsx).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@apps/marketing/src/app/components/HeroSection/components/AppMockup/components/MainPanel/MainPanel.tsx`
around lines 14 - 190, Add a co-located test file MainPanel.test.tsx to cover
MainPanel's activeDemo-driven UI branches: assert that when prop activeDemo ===
"Use Any Agents" the AGENT_TABS motion divs are visible/animated and when
activeDemo === "Create Parallel Branches" the setup motion panel (which renders
SETUP_STEPS and AsciiSpinner) is visible while the Claude panel is hidden; use
the MainPanel component, pass appropriate activeDemo values, and query for
unique text/icons (e.g., "claude", "setup", elements from SETUP_STEPS or
"Setting up new parallel environment...") to verify transitions and
pointerEvents behavior.
apps/marketing/src/app/components/HeroSection/components/AppMockup/components/RightSidebar/RightSidebar.tsx (1)

66-75: Prefer using file.path alone as the key.

The static analysis tool flags the use of index in the key. Since FILE_CHANGES contains unique path values (as seen in constants.ts), using file.path alone is sufficient and avoids the linting warning.

🔧 Suggested fix
 {FILE_CHANGES.map((file, index) => (
 	<FileChangeItem
-		key={`${file.path}-${index}`}
+		key={file.path}
 		path={file.path}
 		add={file.add}
 		del={file.del}
 		indent={file.indent}
 		type={file.type}
 	/>
 ))}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@apps/marketing/src/app/components/HeroSection/components/AppMockup/components/RightSidebar/RightSidebar.tsx`
around lines 66 - 75, The map uses a composite key `${file.path}-${index}` which
triggers a lint warning for using the index; replace that with the unique path
only by setting the key to file.path in the FILE_CHANGES mapping where
FileChangeItem is rendered (look for FILE_CHANGES.map(...) and the
FileChangeItem component) so each FileChangeItem uses key={file.path} instead of
including the index.
apps/marketing/src/app/components/HeroSection/components/AppMockup/components/LeftSidebar/LeftSidebar.tsx (1)

67-84: Consider extracting magic strings to constants.

The comparison workspace.name === "use any agents" uses a magic string that must match the value in WORKSPACES. If the constant changes, this logic could silently break.

♻️ Optional improvement

Consider adding a constant or using the first workspace reference:

const FIRST_WORKSPACE_NAME = WORKSPACES[0]?.name;
// ...
const isFirstItem = workspace.name === FIRST_WORKSPACE_NAME;

Or add an id field to WorkspaceData for stable identification.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@apps/marketing/src/app/components/HeroSection/components/AppMockup/components/LeftSidebar/LeftSidebar.tsx`
around lines 67 - 84, Replace the hard-coded magic string "use any agents" used
in the isFirstItem check with a stable constant or reference: define a constant
(e.g., FIRST_WORKSPACE_NAME = WORKSPACES[0]?.name or a named constant matching
WORKSPACES) and update the isFirstItem computation in the map to use
FIRST_WORKSPACE_NAME; alternatively add and use a stable identifier field (e.g.,
workspace.id) on the WORKSPACES entries and compare against that. Ensure you
update the isFirstItem declaration and any related logic (the isFirstItem
variable used to compute shouldHideActiveState and the props passed into
WorkspaceItem) to reference the new constant/ID.
apps/marketing/src/app/components/HeroSection/components/AppMockup/components/FileChangeItem/FileChangeItem.tsx (1)

27-35: Consider extracting icon mapping to a constant for readability.

The nested ternary works but a lookup object would be more maintainable as new file types are added.

♻️ Optional refactor
const FILE_TYPE_ICONS = {
  folder: VscChevronRight,
  add: VscDiffAdded,
  edit: VscDiffModified,
  delete: VscDiffRemoved,
} as const;

// Then use:
const Icon = FILE_TYPE_ICONS[type] ?? VscDiffModified;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@apps/marketing/src/app/components/HeroSection/components/AppMockup/components/FileChangeItem/FileChangeItem.tsx`
around lines 27 - 35, The nested ternary that assigns Icon in FileChangeItem.tsx
(using isFolder and type) should be replaced with a lookup constant for
readability and future extensibility: create a FILE_TYPE_ICONS mapping constant
that maps "folder"->VscChevronRight, "add"->VscDiffAdded,
"edit"->VscDiffModified, "delete"->VscDiffRemoved, then set Icon by checking
isFolder first (or by mapping a "folder" key) and falling back to
VscDiffModified when no match; update the Icon assignment in the FileChangeItem
component to use this lookup instead of the nested ternary.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@apps/marketing/src/app/components/HeroSection/components/AppMockup/components/ExternalIdePopup/ExternalIdePopup.tsx`:
- Around line 13-23: The popup stays mounted in ExternalIdePopup and only
animates opacity/scale via the motion.div even when inactive, allowing it to
intercept pointer events; update the motion.div (the element using activeDemo
=== "Open in Any IDE" for animate) to prevent interaction when hidden by adding
pointer-events: active ? 'auto' : 'none' (or a conditional class like
'pointer-events-none' when inactive), and also set aria-hidden or entirely
unmount the motion.div when activeDemo !== "Open in Any IDE" if you prefer
removing it from the DOM to avoid focus/trap issues; modify the motion.div
render logic around the animate prop and activeDemo check to implement one of
these fixes.

---

Nitpick comments:
In
`@apps/marketing/src/app/components/HeroSection/components/AppMockup/components/FileChangeItem/FileChangeItem.tsx`:
- Around line 27-35: The nested ternary that assigns Icon in FileChangeItem.tsx
(using isFolder and type) should be replaced with a lookup constant for
readability and future extensibility: create a FILE_TYPE_ICONS mapping constant
that maps "folder"->VscChevronRight, "add"->VscDiffAdded,
"edit"->VscDiffModified, "delete"->VscDiffRemoved, then set Icon by checking
isFolder first (or by mapping a "folder" key) and falling back to
VscDiffModified when no match; update the Icon assignment in the FileChangeItem
component to use this lookup instead of the nested ternary.

In
`@apps/marketing/src/app/components/HeroSection/components/AppMockup/components/LeftSidebar/LeftSidebar.tsx`:
- Around line 67-84: Replace the hard-coded magic string "use any agents" used
in the isFirstItem check with a stable constant or reference: define a constant
(e.g., FIRST_WORKSPACE_NAME = WORKSPACES[0]?.name or a named constant matching
WORKSPACES) and update the isFirstItem computation in the map to use
FIRST_WORKSPACE_NAME; alternatively add and use a stable identifier field (e.g.,
workspace.id) on the WORKSPACES entries and compare against that. Ensure you
update the isFirstItem declaration and any related logic (the isFirstItem
variable used to compute shouldHideActiveState and the props passed into
WorkspaceItem) to reference the new constant/ID.

In
`@apps/marketing/src/app/components/HeroSection/components/AppMockup/components/MainPanel/MainPanel.tsx`:
- Around line 14-190: Add a co-located test file MainPanel.test.tsx to cover
MainPanel's activeDemo-driven UI branches: assert that when prop activeDemo ===
"Use Any Agents" the AGENT_TABS motion divs are visible/animated and when
activeDemo === "Create Parallel Branches" the setup motion panel (which renders
SETUP_STEPS and AsciiSpinner) is visible while the Claude panel is hidden; use
the MainPanel component, pass appropriate activeDemo values, and query for
unique text/icons (e.g., "claude", "setup", elements from SETUP_STEPS or
"Setting up new parallel environment...") to verify transitions and
pointerEvents behavior.

In
`@apps/marketing/src/app/components/HeroSection/components/AppMockup/components/RightSidebar/RightSidebar.tsx`:
- Around line 66-75: The map uses a composite key `${file.path}-${index}` which
triggers a lint warning for using the index; replace that with the unique path
only by setting the key to file.path in the FILE_CHANGES mapping where
FileChangeItem is rendered (look for FILE_CHANGES.map(...) and the
FileChangeItem component) so each FileChangeItem uses key={file.path} instead of
including the index.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 03f56921-8486-4a07-b1b8-df31b0df2d9c

📥 Commits

Reviewing files that changed from the base of the PR and between 0140720 and ae2da13.

📒 Files selected for processing (22)
  • apps/marketing/src/app/components/HeroSection/components/AppMockup/AppMockup.tsx
  • apps/marketing/src/app/components/HeroSection/components/AppMockup/components/AsciiSpinner/AsciiSpinner.tsx
  • apps/marketing/src/app/components/HeroSection/components/AppMockup/components/AsciiSpinner/index.ts
  • apps/marketing/src/app/components/HeroSection/components/AppMockup/components/ExternalIdePopup/ExternalIdePopup.tsx
  • apps/marketing/src/app/components/HeroSection/components/AppMockup/components/ExternalIdePopup/index.ts
  • apps/marketing/src/app/components/HeroSection/components/AppMockup/components/FileChangeItem/FileChangeItem.tsx
  • apps/marketing/src/app/components/HeroSection/components/AppMockup/components/FileChangeItem/index.ts
  • apps/marketing/src/app/components/HeroSection/components/AppMockup/components/LeftSidebar/LeftSidebar.tsx
  • apps/marketing/src/app/components/HeroSection/components/AppMockup/components/LeftSidebar/index.ts
  • apps/marketing/src/app/components/HeroSection/components/AppMockup/components/MainPanel/MainPanel.tsx
  • apps/marketing/src/app/components/HeroSection/components/AppMockup/components/MainPanel/index.ts
  • apps/marketing/src/app/components/HeroSection/components/AppMockup/components/RightSidebar/RightSidebar.tsx
  • apps/marketing/src/app/components/HeroSection/components/AppMockup/components/RightSidebar/index.ts
  • apps/marketing/src/app/components/HeroSection/components/AppMockup/components/StatusIndicator/StatusIndicator.tsx
  • apps/marketing/src/app/components/HeroSection/components/AppMockup/components/StatusIndicator/index.ts
  • apps/marketing/src/app/components/HeroSection/components/AppMockup/components/WindowChrome/WindowChrome.tsx
  • apps/marketing/src/app/components/HeroSection/components/AppMockup/components/WindowChrome/index.ts
  • apps/marketing/src/app/components/HeroSection/components/AppMockup/components/WorkspaceItem/WorkspaceItem.tsx
  • apps/marketing/src/app/components/HeroSection/components/AppMockup/components/WorkspaceItem/index.ts
  • apps/marketing/src/app/components/HeroSection/components/AppMockup/constants.ts
  • apps/marketing/src/app/components/HeroSection/components/AppMockup/index.ts
  • apps/marketing/src/app/components/HeroSection/components/AppMockup/types.ts

Comment on lines +13 to +23
<motion.div
className="absolute bottom-6 right-6 w-[55%] overflow-hidden rounded-xl bg-black/50 shadow-[0_8px_40px_-8px_rgba(0,0,0,0.6)] backdrop-blur-xl"
style={{ aspectRatio: "16/10" }}
initial={{ opacity: 0, scale: 0.9, y: 20 }}
animate={{
opacity: activeDemo === "Open in Any IDE" ? 1 : 0,
scale: activeDemo === "Open in Any IDE" ? 1 : 0.9,
y: activeDemo === "Open in Any IDE" ? 0 : 20,
}}
transition={{ duration: 0.3, ease: "easeOut" }}
>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Hidden popup can still block interactions.

Line 13 keeps the popup mounted, but Lines 18–20 only animate visibility. When hidden, it can still capture pointer events over underlying UI.

Proposed fix
 		<motion.div
 			className="absolute bottom-6 right-6 w-[55%] overflow-hidden rounded-xl bg-black/50 shadow-[0_8px_40px_-8px_rgba(0,0,0,0.6)] backdrop-blur-xl"
-			style={{ aspectRatio: "16/10" }}
+			style={{
+				aspectRatio: "16/10",
+				pointerEvents: activeDemo === "Open in Any IDE" ? "auto" : "none",
+			}}
+			aria-hidden={activeDemo !== "Open in Any IDE"}
 			initial={{ opacity: 0, scale: 0.9, y: 20 }}
 			animate={{
 				opacity: activeDemo === "Open in Any IDE" ? 1 : 0,
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<motion.div
className="absolute bottom-6 right-6 w-[55%] overflow-hidden rounded-xl bg-black/50 shadow-[0_8px_40px_-8px_rgba(0,0,0,0.6)] backdrop-blur-xl"
style={{ aspectRatio: "16/10" }}
initial={{ opacity: 0, scale: 0.9, y: 20 }}
animate={{
opacity: activeDemo === "Open in Any IDE" ? 1 : 0,
scale: activeDemo === "Open in Any IDE" ? 1 : 0.9,
y: activeDemo === "Open in Any IDE" ? 0 : 20,
}}
transition={{ duration: 0.3, ease: "easeOut" }}
>
<motion.div
className="absolute bottom-6 right-6 w-[55%] overflow-hidden rounded-xl bg-black/50 shadow-[0_8px_40px_-8px_rgba(0,0,0,0.6)] backdrop-blur-xl"
style={{
aspectRatio: "16/10",
pointerEvents: activeDemo === "Open in Any IDE" ? "auto" : "none",
}}
aria-hidden={activeDemo !== "Open in Any IDE"}
initial={{ opacity: 0, scale: 0.9, y: 20 }}
animate={{
opacity: activeDemo === "Open in Any IDE" ? 1 : 0,
scale: activeDemo === "Open in Any IDE" ? 1 : 0.9,
y: activeDemo === "Open in Any IDE" ? 0 : 20,
}}
transition={{ duration: 0.3, ease: "easeOut" }}
>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@apps/marketing/src/app/components/HeroSection/components/AppMockup/components/ExternalIdePopup/ExternalIdePopup.tsx`
around lines 13 - 23, The popup stays mounted in ExternalIdePopup and only
animates opacity/scale via the motion.div even when inactive, allowing it to
intercept pointer events; update the motion.div (the element using activeDemo
=== "Open in Any IDE" for animate) to prevent interaction when hidden by adding
pointer-events: active ? 'auto' : 'none' (or a conditional class like
'pointer-events-none' when inactive), and also set aria-hidden or entirely
unmount the motion.div when activeDemo !== "Open in Any IDE" if you prefer
removing it from the DOM to avoid focus/trap issues; modify the motion.div
render logic around the animate prop and activeDemo check to implement one of
these fixes.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
apps/marketing/src/app/components/HeroSection/components/AppMockup/components/LeftSidebar/LeftSidebar.tsx (1)

67-84: Consider using an identifier instead of magic string comparison.

The comparison workspace.name === "use any agents" creates a fragile coupling—if the workspace name changes in constants.ts, this special-case logic silently breaks. Consider adding an id field to the workspace type or comparing by index if this is always the first item.

💡 Suggested approach

Option 1 – Use index:

-               {WORKSPACES.map((workspace) => {
-                       const isFirstItem = workspace.name === "use any agents";
+               {WORKSPACES.map((workspace, index) => {
+                       const isFirstItem = index === 0;

Option 2 – Add an id field to Workspace in types.ts and use that for comparison.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@apps/marketing/src/app/components/HeroSection/components/AppMockup/components/LeftSidebar/LeftSidebar.tsx`
around lines 67 - 84, The code uses a fragile magic string comparison
workspace.name === "use any agents" to special-case the first workspace; update
the data shape and logic to avoid string coupling: add a stable identifier
(e.g., id) to each workspace in WORKSPACES and Workspace type, then replace the
comparison with workspace.id === "<stable-id>" (or use the index from
WORKSPACES.map((workspace, i) => ...) and check i === 0 if this is always the
first item) inside the rendering block that sets
isFirstItem/shouldHideActiveState so WorkspaceItem receives the correct
isActive/status values; adjust any types/initialization where WORKSPACES is
defined to include the new id field.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@apps/marketing/src/app/components/HeroSection/components/AppMockup/components/RightSidebar/RightSidebar.tsx`:
- Around line 13-177: Create a new co-located test file RightSidebar.test.tsx
that verifies RightSidebar's behavior: import RightSidebar and render with
different activeDemo values ("", "See Changes", "Create Parallel Branches");
assert the main elements render (the Review Changes header, FileChangeItem list
rendered from FILE_CHANGES), assert the overlay panel appears when activeDemo
=== "See Changes" and that its pointer-events style is "auto" while the
underlying panel pointer-events is "none"; also assert the alternate fade for
"Create Parallel Branches" hides the file list (check opacity/presence or
conditional classes) and verify the animated width change by asserting the
wrapper receives the expected inline style/class when activeDemo toggles. Use
React Testing Library (render, screen) and, if needed, mock framer-motion or
advance timers to avoid animation flakiness; reference the RightSidebar
component, activeDemo prop, FILE_CHANGES mapping and FileChangeItem usage to
locate the code under test.
- Around line 66-69: The list key currently uses the array index via
key={`${file.path}-${index}`} which can break React reconciliation; update the
FileChangeItem key to use a stable unique identifier such as key={file.path} (or
file.id if available) in the FILE_CHANGES.map callback, ensuring the
FileChangeItem rendering uses that stable unique key so reordering doesn’t cause
incorrect DOM updates.

---

Nitpick comments:
In
`@apps/marketing/src/app/components/HeroSection/components/AppMockup/components/LeftSidebar/LeftSidebar.tsx`:
- Around line 67-84: The code uses a fragile magic string comparison
workspace.name === "use any agents" to special-case the first workspace; update
the data shape and logic to avoid string coupling: add a stable identifier
(e.g., id) to each workspace in WORKSPACES and Workspace type, then replace the
comparison with workspace.id === "<stable-id>" (or use the index from
WORKSPACES.map((workspace, i) => ...) and check i === 0 if this is always the
first item) inside the rendering block that sets
isFirstItem/shouldHideActiveState so WorkspaceItem receives the correct
isActive/status values; adjust any types/initialization where WORKSPACES is
defined to include the new id field.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5c612f20-0fc5-4d01-9649-e003237df337

📥 Commits

Reviewing files that changed from the base of the PR and between ae2da13 and b4eec5d.

📒 Files selected for processing (4)
  • apps/marketing/src/app/components/HeroSection/components/AppMockup/components/ExternalIdePopup/ExternalIdePopup.tsx
  • apps/marketing/src/app/components/HeroSection/components/AppMockup/components/LeftSidebar/LeftSidebar.tsx
  • apps/marketing/src/app/components/HeroSection/components/AppMockup/components/MainPanel/MainPanel.tsx
  • apps/marketing/src/app/components/HeroSection/components/AppMockup/components/RightSidebar/RightSidebar.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/marketing/src/app/components/HeroSection/components/AppMockup/components/ExternalIdePopup/ExternalIdePopup.tsx

Comment on lines +13 to +177
export function RightSidebar({ activeDemo }: RightSidebarProps) {
return (
<motion.div
className="relative flex shrink-0 flex-col overflow-hidden border-l border-white/[0.06] bg-white/[0.02] backdrop-blur-lg"
initial={{ width: 230 }}
animate={{
width: activeDemo === "See Changes" ? 380 : 230,
}}
transition={{ duration: 0.3, ease: "easeOut" }}
>
<motion.div
className="absolute inset-0 flex flex-col"
initial={{ opacity: 1 }}
animate={{
opacity: activeDemo === "See Changes" ? 0 : 1,
}}
transition={{ duration: 0.2, ease: "easeOut" }}
style={{
pointerEvents: activeDemo === "See Changes" ? "none" : "auto",
}}
>
<div className="flex items-center justify-between border-b border-white/[0.06] px-5 py-3.5 h-12">
<span className="text-[10px] font-normal tracking-[0.14em] text-foreground/52">
Review Changes
</span>
<div className="flex items-center gap-1 text-[11px]">
<LuGitPullRequest className="size-4 text-emerald-300/70" />
<span className="text-muted-foreground/36">#827</span>
</div>
</div>

<div className="space-y-3 border-b border-white/[0.06] px-5 py-3.5">
<div className="flex h-10 items-center rounded-xs border border-white/[0.06] bg-black/20 px-4 text-[11px] text-muted-foreground/30">
Commit message...
</div>
<button
type="button"
className="flex w-full items-center justify-center gap-2 rounded-xs border border-white/[0.06] bg-white/[0.04] px-4 py-2.5 text-[11px] font-medium text-foreground/70 hover:bg-white/[0.07]"
>
<span>↑</span>
<span>Push</span>
<span className="text-[10px] text-muted-foreground/30">26</span>
</button>
</div>

<motion.div
className="flex-1 overflow-hidden"
initial={{ opacity: 1 }}
animate={{
opacity: activeDemo === "Create Parallel Branches" ? 0 : 1,
}}
transition={{ duration: 0.3, ease: "easeOut" }}
>
{FILE_CHANGES.map((file, index) => (
<FileChangeItem
key={`${file.path}-${index}`}
path={file.path}
add={file.add}
del={file.del}
indent={file.indent}
type={file.type}
/>
))}
</motion.div>
</motion.div>

<motion.div
className="absolute inset-0 flex flex-col bg-black/30 backdrop-blur-md"
initial={{ opacity: 0 }}
animate={{
opacity: activeDemo === "See Changes" ? 1 : 0,
}}
transition={{
duration: 0.3,
ease: "easeOut",
delay: activeDemo === "See Changes" ? 0.1 : 0,
}}
style={{
pointerEvents: activeDemo === "See Changes" ? "auto" : "none",
}}
>
<div className="flex items-center justify-between border-b border-white/[0.06] px-5 py-3.5">
<div className="flex items-center gap-2">
<LuGitPullRequest className="size-4.5 text-emerald-300/75" />
<span className="text-[13px] font-medium text-foreground/72">
Review PR #827
</span>
</div>
<span className="rounded-xs border border-orange-500/[0.10] bg-orange-500/[0.08] px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.12em] text-orange-500/75">
Open
</span>
</div>

<div className="flex items-center gap-1.5 border-b border-white/[0.06] px-5 py-3 text-[11px]">
<span className="rounded-xs border border-white/[0.06] bg-white/[0.04] px-3 py-1.5 font-medium text-foreground/64">
cloud-workspace.ts
</span>
<span className="px-3 py-1.5 text-muted-foreground/30">enums.ts</span>
<span className="px-3 py-1.5 text-muted-foreground/30">+4 more</span>
</div>

<div className="flex-1 overflow-hidden p-5 font-mono text-[11px]">
<div className="space-y-1">
<div className="py-1 text-muted-foreground/40">@@ -1,4 +1,6 @@</div>
<div className="flex">
<span className="w-7 shrink-0 text-muted-foreground/25">1</span>
<span className="text-muted-foreground/60">
import {"{"} db {"}"} from "../db"
</span>
</div>
<div className="flex bg-emerald-300/[0.08]">
<span className="w-7 shrink-0 text-emerald-300/75">+</span>
<span className="text-emerald-300/75">
import {"{"} CloudWorkspace {"}"} from "./types"
</span>
</div>
<div className="flex bg-emerald-300/[0.08]">
<span className="w-7 shrink-0 text-emerald-300/75">+</span>
<span className="text-emerald-300/75">
import {"{"} createSSHConnection {"}"} from "./ssh"
</span>
</div>
<div className="flex">
<span className="w-7 shrink-0 text-muted-foreground/25">2</span>
<span className="text-muted-foreground/60"></span>
</div>
<div className="flex bg-rose-300/[0.08]">
<span className="w-7 shrink-0 text-rose-300/75">-</span>
<span className="text-rose-300/75">
export const getWorkspaces = () ={">"} {"{"}
</span>
</div>
<div className="flex bg-emerald-300/[0.08]">
<span className="w-7 shrink-0 text-emerald-300/75">+</span>
<span className="text-emerald-300/75">
export const getWorkspaces = async () ={">"} {"{"}
</span>
</div>
<div className="flex">
<span className="w-7 shrink-0 text-muted-foreground/25">4</span>
<span className="text-muted-foreground/60">
{" "}return db.query.workspaces
</span>
</div>
</div>
</div>

<div className="flex items-center gap-3 border-t border-white/[0.06] px-5 py-3.5">
<button
type="button"
className="rounded-xs border border-emerald-300/[0.10] bg-emerald-300/[0.10] px-4 py-2 text-[11px] font-medium text-emerald-300/75 hover:bg-emerald-300/[0.16]"
>
Approve
</button>
<button
type="button"
className="rounded-xs border border-white/[0.06] bg-white/[0.04] px-4 py-2 text-[11px] font-medium text-foreground/50 hover:bg-white/[0.07]"
>
Comment
</button>
</div>
</motion.div>
</motion.div>
);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
# Check whether a co-located test already exists for RightSidebar.
fd 'RightSidebar\.test\.(ts|tsx)$' apps/marketing/src/app/components/HeroSection/components/AppMockup

Repository: superset-sh/superset

Length of output: 46


Add a co-located test file for this component

No RightSidebar.test.tsx exists next to RightSidebar.tsx. Per the coding guidelines for **/*.{ts,tsx}, tests must be co-located with their implementation files. This component's multiple activeDemo states, pointer-event gating, and animations warrant test coverage.

🧰 Tools
🪛 Biome (2.4.7)

[error] 68-68: Avoid using the index of an array as key property in an element.

(lint/suspicious/noArrayIndexKey)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@apps/marketing/src/app/components/HeroSection/components/AppMockup/components/RightSidebar/RightSidebar.tsx`
around lines 13 - 177, Create a new co-located test file RightSidebar.test.tsx
that verifies RightSidebar's behavior: import RightSidebar and render with
different activeDemo values ("", "See Changes", "Create Parallel Branches");
assert the main elements render (the Review Changes header, FileChangeItem list
rendered from FILE_CHANGES), assert the overlay panel appears when activeDemo
=== "See Changes" and that its pointer-events style is "auto" while the
underlying panel pointer-events is "none"; also assert the alternate fade for
"Create Parallel Branches" hides the file list (check opacity/presence or
conditional classes) and verify the animated width change by asserting the
wrapper receives the expected inline style/class when activeDemo toggles. Use
React Testing Library (render, screen) and, if needed, mock framer-motion or
advance timers to avoid animation flakiness; reference the RightSidebar
component, activeDemo prop, FILE_CHANGES mapping and FileChangeItem usage to
locate the code under test.

Comment on lines +66 to +69
{FILE_CHANGES.map((file, index) => (
<FileChangeItem
key={`${file.path}-${index}`}
path={file.path}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
# Verify index-based React keys are not used in AppMockup components.
rg -nP --type=tsx 'map\(\([^)]*,\s*index\)\s*=>|key=\{[^}]*index[^}]*\}' apps/marketing/src/app/components/HeroSection/components/AppMockup

Repository: superset-sh/superset

Length of output: 91


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# First, check the actual file content around lines 66-69
echo "=== File content around line 66-69 ==="
cat -n "apps/marketing/src/app/components/HeroSection/components/AppMockup/components/RightSidebar/RightSidebar.tsx" | sed -n '60,75p'

# Search for index-based keys in AppMockup components using proper ripgrep syntax
echo ""
echo "=== Searching for index-based map patterns in AppMockup ==="
rg 'map\(\([^)]*,\s*index\)\s*=>' apps/marketing/src/app/components/HeroSection/components/AppMockup/ -A 2 -t ts || echo "No matches found with ripgrep"

# Also search for index in key props
echo ""
echo "=== Searching for index used in key attributes ==="
rg 'key=.*index' apps/marketing/src/app/components/HeroSection/components/AppMockup/ -t ts || echo "No matches found"

Repository: superset-sh/superset

Length of output: 1315


Use unique key for file list instead of array index

Line 68 uses key={${file.path}-${index}}, which includes the array index and can cause incorrect reconciliation if list order changes. Use the unique path instead:

Suggested fix
-					{FILE_CHANGES.map((file, index) => (
+					{FILE_CHANGES.map((file) => (
 						<FileChangeItem
-							key={`${file.path}-${index}`}
+							key={file.path}
 							path={file.path}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{FILE_CHANGES.map((file, index) => (
<FileChangeItem
key={`${file.path}-${index}`}
path={file.path}
{FILE_CHANGES.map((file) => (
<FileChangeItem
key={file.path}
path={file.path}
🧰 Tools
🪛 Biome (2.4.7)

[error] 68-68: Avoid using the index of an array as key property in an element.

(lint/suspicious/noArrayIndexKey)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@apps/marketing/src/app/components/HeroSection/components/AppMockup/components/RightSidebar/RightSidebar.tsx`
around lines 66 - 69, The list key currently uses the array index via
key={`${file.path}-${index}`} which can break React reconciliation; update the
FileChangeItem key to use a stable unique identifier such as key={file.path} (or
file.id if available) in the FILE_CHANGES.map callback, ensuring the
FileChangeItem rendering uses that stable unique key so reordering doesn’t cause
incorrect DOM updates.

@Kitenite
Kitenite merged commit 9c6d236 into ParadevAI:main Mar 19, 2026
12 of 15 checks passed
@Kitenite
Kitenite deleted the kitenite/compare-our-demo-t branch March 19, 2026 22:32

This branch had an error being deployed

1 failed deployment
preview — b4eec5d6 Deployed Mar 19, 2026 by Kitenite via Deploy Database (Neon) #3045
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.

1 participant