Skip to content

Conversation

@amhsirak
Copy link
Member

@amhsirak amhsirak commented Nov 25, 2025

Summary by CodeRabbit

  • Refactor

    • Reorganized module import paths across the codebase to align with the new project layout.
    • Standardized component imports to improve build consistency.
    • Consolidated modal styling by centralizing its definition.
  • Chores

    • Removed an obsolete server route related to credential uploads.

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

@amhsirak amhsirak marked this pull request as draft November 25, 2025 10:40
@coderabbitai
Copy link

coderabbitai bot commented Nov 25, 2025

Walkthrough

Import paths were updated across multiple legacy UI and context components to reference files under src/.... modalStyle was moved/exported from ColapsibleRow.tsx and RunSettings.tsx updated to import it. One server route file server/src/routes/integration.ts was removed. No runtime logic or public APIs were changed.

Changes

Cohort / File(s) Summary
Legacy components — import path updates
legacy/src/AddWhatCondModal.tsx, legacy/src/AddWhereCondModal.tsx, legacy/src/DisplayWhereConditionSettings.tsx, legacy/src/LeftSidePanel.tsx, legacy/src/LeftSidePanelContent.tsx, legacy/src/LeftSidePanelSettings.tsx, legacy/src/PairDetail.tsx, legacy/src/Pair.tsx
Repointed imports from relative project paths to ../../src/... (e.g., UI components, context hooks, API imports). No changes to logic or exported signatures.
Modal style relocation
src/components/run/ColapsibleRow.tsx, src/components/run/RunSettings.tsx
modalStyle constant is now defined and exported from ColapsibleRow.tsx; RunSettings.tsx imports it from the new location instead of AddWhereCondModal.
Server route removed
server/src/routes/integration.ts
Deleted Express route file that previously defined POST /upload-credentials (validation and placeholder credential handling removed).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20–30 minutes

  • Verify all updated import paths resolve correctly in build and TypeScript (tsconfig paths/aliases if used).
  • Confirm there are no remaining imports referencing the removed server/src/routes/integration.ts.
  • Check ColapsibleRow.tsx export signature for modalStyle and ensure RunSettings.tsx import matches.

Possibly related PRs

  • fix: abort operation #629 — Modifies src/components/run/ColapsibleRow.tsx (related to modalStyle changes and nearby run control code).

Suggested labels

Type: Chore

Suggested reviewers

  • RohitR311

Poem

🐇 I hopped through folders, neat and quick,
I nudged the paths, made imports stick.
A modal moved, a route said goodbye —
I tidy the branches, then munch a carrot pie. 🥕

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 title accurately reflects the main changes—archiving legacy recorder components by updating import paths and restructuring module organization.
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 legacy-recorder

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7a424d1 and 2d44b55.

📒 Files selected for processing (1)
  • server/src/routes/integration.ts (0 hunks)
💤 Files with no reviewable changes (1)
  • server/src/routes/integration.ts

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.

@amhsirak amhsirak marked this pull request as ready for review November 30, 2025 13:49
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 (3)
legacy/src/LeftSidePanelContent.tsx (1)

44-49: Socket listener cleanup never removes the registered handler

In the useEffect that subscribes to "activePairId", the cleanup uses a new arrow function:

socket?.on("activePairId", (data) => activePairIdHandler(data, socket));
return () => {
  socket?.off("activePairId", (data) => activePairIdHandler(data, socket));
};

Because socket.off receives a different function reference, the original listener isn’t actually detached. If the socket instance ever changes and this effect re‑runs, you can end up with multiple active listeners.

A safer pattern is to reuse the same handler reference:

-  useEffect(() => {
-    socket?.on("activePairId", (data) => activePairIdHandler(data, socket));
-    return () => {
-      socket?.off("activePairId", (data) => activePairIdHandler(data, socket));
-    }
-  }, [socket, setActiveId]);
+  useEffect(() => {
+    if (!socket) return;
+
+    const handler = (data: string) => activePairIdHandler(data, socket);
+
+    socket.on("activePairId", handler);
+    return () => {
+      socket.off("activePairId", handler);
+    };
+  }, [socket, activePairIdHandler]);

This ensures off sees the exact same function instance that was passed to on.

legacy/src/DisplayWhereConditionSettings.tsx (1)

2-7: Import path migration to src/components looks consistent

The updated imports for MuiDropdown, AddButton, RemoveButton, KeyValueForm, and WarningText all correctly point two levels up from legacy/src into src/components/.... This aligns with the described refactor and doesn’t affect runtime logic.

If you expect more of these legacy files to keep living for a while, you might later consider TS path aliases (e.g. @components/ui/...) instead of deep ../../src/... hops to make future moves cheaper, but that’s optional for this chore PR.

legacy/src/AddWhatCondModal.tsx (1)

2-8: Updated imports correctly target centralized src modules

The imports for GenericModal, KeyValueForm, ClearButton, and useSocketStore now consistently reference the src/... structure using ../../src/... from legacy/src, which matches the overall migration pattern and keeps behavior unchanged.

As with the other legacy file, consider path aliases in the future to avoid long relative segments, but it’s not necessary to merge this PR.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ad8df66 and cab8d6c.

📒 Files selected for processing (10)
  • legacy/src/AddWhatCondModal.tsx (1 hunks)
  • legacy/src/AddWhereCondModal.tsx (1 hunks)
  • legacy/src/DisplayWhereConditionSettings.tsx (1 hunks)
  • legacy/src/LeftSidePanel.tsx (1 hunks)
  • legacy/src/LeftSidePanelContent.tsx (1 hunks)
  • legacy/src/LeftSidePanelSettings.tsx (1 hunks)
  • legacy/src/PairDetail.tsx (1 hunks)
  • src/components/recorder/Pair.tsx (1 hunks)
  • src/components/run/ColapsibleRow.tsx (1 hunks)
  • src/components/run/RunSettings.tsx (1 hunks)
🔇 Additional comments (8)
legacy/src/LeftSidePanelSettings.tsx (1)

3-5: Import normalization to src/ modules looks consistent*

Repointing Dropdown, RunSettings, and useSocketStore to the ../../src/... locations keeps this legacy panel wired into the shared UI/context implementations without changing behavior. The types and props used below still match, so this path refactor looks good.

src/components/run/RunSettings.tsx (1)

6-6: RunSettings now consuming modalStyle from CollapsibleRow is safe

Wiring modalStyle in from ../run/ColapsibleRow keeps run‑related modal styling in one place and doesn’t introduce a circular dependency. GenericModal usage is unchanged, so this is a clean, non‑behavioral refactor.

legacy/src/LeftSidePanelContent.tsx (1)

2-8: Path updates to src/ recorder and UI modules are coherent*

Pair, useSocketStore, AddButton, AddPair, and GenericModal now all resolve via ../../src/..., which keeps this legacy content panel wired into the shared, non‑legacy implementations. The usage of each import below hasn’t changed, so this is a straightforward path normalization.

legacy/src/AddWhereCondModal.tsx (1)

1-1: UI and socket imports now consistently use src/ modules*

Pointing MuiDropdown, GenericModal, and useSocketStore at ../../src/... keeps this legacy modal using the shared UI and socket store implementations, while still relying on its own local modalStyle. The component logic and emitted socket payloads are unchanged, so this is a safe structural cleanup.

Also applies to: 8-8, 12-12

legacy/src/LeftSidePanel.tsx (1)

3-5: Import normalization to src/ for workflow, context, and settings*

getActiveWorkflow, getParamsOfActiveWorkflow, useSocketStore, emptyWorkflow, useGlobalInfoStore, and RunSettings now all come from the src tree, which centralizes shared logic while leaving panel behavior intact. The way these symbols are used (API calls, context access, and RunSettings state) hasn’t changed, so this is a clean path refactor.

Also applies to: 7-7, 9-9, 11-11

src/components/run/ColapsibleRow.tsx (1)

233-243: Exporting modalStyle from CollapsibleRow for shared run modals

Defining and exporting modalStyle here matches how it’s used inside this component and by RunSettingsModal, and keeps run‑related modal styling co‑located with the runs UI rather than in an unrelated recorder module. Since it’s a plain object at module scope, referencing it from JSX above is safe.

legacy/src/PairDetail.tsx (1)

9-12: WarningText import path is correct

The import import { WarningText } from "../../src/components/ui/texts" correctly resolves to src/components/ui/texts.tsx, which exports WarningText at line 3. This import will work at build time; no changes are needed.

src/components/recorder/Pair.tsx (1)

7-8: The legacy imports resolve correctly. Both PairEditForm.tsx and PairDisplayDiv.tsx exist at legacy/src/ and the relative paths from src/components/recorder/Pair.tsx are correct.

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)
legacy/src/Pair.tsx (1)

3-10: Import path updates are consistent with the new src layout

The updated imports to "../../src/api/..." and "../../src/components/ui/..." are internally consistent and match what we’d expect from moving shared code under src/. No behavior change is introduced here, so this looks safe.

If you plan more work on these legacy files later, you might eventually consider using TS path aliases (e.g. @/api, @/components/ui) instead of long relative hops, but that’s optional and outside the scope of this PR.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cab8d6c and 7a424d1.

📒 Files selected for processing (2)
  • legacy/src/LeftSidePanelContent.tsx (1 hunks)
  • legacy/src/Pair.tsx (1 hunks)
🔇 Additional comments (1)
legacy/src/LeftSidePanelContent.tsx (1)

4-8: All import paths resolve correctly.

The updated import paths from legacy/src/LeftSidePanelContent.tsx to the main src/ directory are valid and properly structured. All target files exist:

  • src/context/socket.tsx
  • src/components/ui/buttons/AddButton.tsx
  • src/api/workflow.ts
  • src/components/ui/GenericModal.tsx

The reorganization aligns with the PR objective.

@amhsirak amhsirak merged commit bad7fcb into develop Nov 30, 2025
1 check passed
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