Skip to content

feat: add customization layer for duplicate file functionality#9953

Merged
jordanrfrazier merged 3 commits intorelease-1.6.0from
feat/duplicate-file-customization-layer
Sep 24, 2025
Merged

feat: add customization layer for duplicate file functionality#9953
jordanrfrazier merged 3 commits intorelease-1.6.0from
feat/duplicate-file-customization-layer

Conversation

@italojohnny
Copy link
Contributor

@italojohnny italojohnny commented Sep 23, 2025

  • Create use-custom-duplicate-file.ts in customization/hooks
  • Update import path in filesContextMenuComponent to use customization layer
  • Maintains original functionality while enabling desktop-specific overrides

Summary by CodeRabbit

  • Refactor

    • Streamlined the Duplicate File action by routing it through the customization hooks layer for improved extensibility and consistency. No functional changes.
    • Users should experience the same Duplicate action without interruptions.
  • Chores

    • Updated internal imports in the file manager context menu to use the new hook location, aligning with the customization namespace.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 23, 2025

Important

Review skipped

Auto incremental 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

Adds a new customization hook that re-exports useDuplicateFileV2 and updates a component to import the hook from the customization path instead of the API path. No behavioral changes; only import source and module exposure are adjusted.

Changes

Cohort / File(s) Summary
Customization hook export
src/frontend/src/customization/hooks/use-custom-duplicate-file.ts
New module that re-exports useDuplicateFileV2 from ../../controllers/API/queries/file-management/use-duplicate-file.
Files Context Menu refactor
src/frontend/src/modals/fileManagerModal/components/filesContextMenuComponent/index.tsx
Updated import path to use @/customization/hooks/use-custom-duplicate-file instead of the direct API query path; no functional changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

size:M, lgtm, refactor

Suggested reviewers

  • lucaseduoli

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 clearly and concisely describes the primary change: adding a customization layer for the duplicate-file feature (creating use-custom-duplicate-file and updating import sites). It is a single, specific sentence using the conventional "feat:" prefix and will be understandable to teammates scanning the history.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

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 enhancement New feature or request label Sep 23, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Sep 23, 2025

Frontend Unit Test Coverage Report

Coverage Summary

Lines Statements Branches Functions
Coverage: 9%
9.61% (2522/26241) 3.92% (793/20187) 4.05% (229/5648)

Unit Test Results

Tests Skipped Failures Errors Time
831 0 💤 0 ❌ 0 🔥 16.241s ⏱️

@codecov
Copy link

codecov bot commented Sep 23, 2025

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 35.75%. Comparing base (43750b5) to head (eccdd7e).
⚠️ Report is 1 commits behind head on release-1.6.0.

Files with missing lines Patch % Lines
...c/customization/hooks/use-custom-duplicate-file.ts 0.00% 2 Missing ⚠️
...dal/components/filesContextMenuComponent/index.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                @@
##           release-1.6.0    #9953      +/-   ##
=================================================
- Coverage          35.76%   35.75%   -0.01%     
=================================================
  Files               1218     1220       +2     
  Lines              58134    58150      +16     
  Branches            5530     5530              
=================================================
+ Hits               20793    20794       +1     
- Misses             37180    37195      +15     
  Partials             161      161              
Flag Coverage Δ
frontend 8.83% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...dal/components/filesContextMenuComponent/index.tsx 0.00% <0.00%> (ø)
...c/customization/hooks/use-custom-duplicate-file.ts 0.00% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Sep 23, 2025
Copy link
Contributor

@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)
src/frontend/src/customization/hooks/use-custom-duplicate-file.ts (1)

1-3: Use a direct re-export from '@/controllers'

Only src/frontend/src/customization/hooks/use-custom-duplicate-file.ts imports the controller path directly; consumers use the customization hook, so the re-export is safe to apply.

Apply this diff:

-import { useDuplicateFileV2 } from "../../controllers/API/queries/file-management/use-duplicate-file";
-
-export { useDuplicateFileV2 };
+export { useDuplicateFileV2 } from "@/controllers/API/queries/file-management/use-duplicate-file";
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ca3425e and cb0af7b.

📒 Files selected for processing (2)
  • src/frontend/src/customization/hooks/use-custom-duplicate-file.ts (1 hunks)
  • src/frontend/src/modals/fileManagerModal/components/filesContextMenuComponent/index.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
src/frontend/src/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/frontend_development.mdc)

src/frontend/src/**/*.{ts,tsx,js,jsx}: All frontend TypeScript and JavaScript code should be located under src/frontend/src/ and organized into components, pages, icons, stores, types, utils, hooks, services, and assets directories as per the specified directory layout.
Use React 18 with TypeScript for all UI components in the frontend.
Format all TypeScript and JavaScript code using the make format_frontend command.
Lint all TypeScript and JavaScript code using the make lint command.

Files:

  • src/frontend/src/customization/hooks/use-custom-duplicate-file.ts
  • src/frontend/src/modals/fileManagerModal/components/filesContextMenuComponent/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). (41)
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 36/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 31/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 40/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 35/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 33/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 34/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 37/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 38/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 39/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 29/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 32/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 14/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 27/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 21/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 30/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 28/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 25/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 20/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 24/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 23/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 26/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 22/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 13/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 19/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 15/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 18/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 17/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 6/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 16/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 9/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 10/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 4/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 12/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 3/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 7/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 11/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 8/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 2/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 1/40
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 5/40
  • GitHub Check: Test Starter Templates
🔇 Additional comments (1)
src/frontend/src/modals/fileManagerModal/components/filesContextMenuComponent/index.tsx (1)

10-10: LGTM: import now correctly goes through the customization layer

Keeps behavior intact while enabling overrides.

Copy link
Member

@Cristhianzl Cristhianzl left a comment

Choose a reason for hiding this comment

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

lgtm

@github-actions github-actions bot added the lgtm This PR has been approved by a maintainer label Sep 23, 2025
@Cristhianzl Cristhianzl changed the base branch from main to release-1.6.0 September 23, 2025 18:33
@Cristhianzl Cristhianzl changed the base branch from release-1.6.0 to main September 23, 2025 18:34
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Sep 23, 2025
- Create use-custom-duplicate-file.ts in customization/hooks
- Update import path in filesContextMenuComponent to use customization layer
- Maintains original functionality while enabling desktop-specific overrides
@italojohnny italojohnny force-pushed the feat/duplicate-file-customization-layer branch from cb0af7b to 49a7069 Compare September 23, 2025 18:36
@italojohnny italojohnny changed the base branch from main to release-1.6.0 September 23, 2025 18:36
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Sep 23, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Sep 24, 2025
@jordanrfrazier jordanrfrazier enabled auto-merge (squash) September 24, 2025 00:15
@jordanrfrazier jordanrfrazier added the fast-track Skip tests and sends PR into the merge queue label Sep 24, 2025
@jordanrfrazier
Copy link
Collaborator

Nightly is broken but all tests passed so adding fast track

@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Sep 24, 2025
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
B Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@jordanrfrazier jordanrfrazier merged commit 53366d4 into release-1.6.0 Sep 24, 2025
14 of 16 checks passed
@jordanrfrazier jordanrfrazier deleted the feat/duplicate-file-customization-layer branch September 24, 2025 00:46
jordanrfrazier added a commit that referenced this pull request Oct 6, 2025
* feat: add customization layer for duplicate file functionality

- Create use-custom-duplicate-file.ts in customization/hooks
- Update import path in filesContextMenuComponent to use customization layer
- Maintains original functionality while enabling desktop-specific overrides

* bump to run ci in the pr

---------

Co-authored-by: Jordan Frazier <122494242+jordanrfrazier@users.noreply.github.com>
Co-authored-by: Jordan Frazier <jordan.frazier@datastax.com>
github-merge-queue bot pushed a commit that referenced this pull request Oct 8, 2025
#10127)

* feat: add customization layer for duplicate file functionality

- Create use-custom-duplicate-file.ts in customization/hooks
- Update import path in filesContextMenuComponent to use customization layer
- Maintains original functionality while enabling desktop-specific overrides

* bump to run ci in the pr

---------

Co-authored-by: Ítalo Johnny <italojohnnydosanjos@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request fast-track Skip tests and sends PR into the merge queue lgtm This PR has been approved by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants