Skip to content

191 improve add studies form#192

Merged
InfinityBowman merged 3 commits into
mainfrom
191-improve-add-studies-form
Dec 29, 2025
Merged

191 improve add studies form#192
InfinityBowman merged 3 commits into
mainfrom
191-improve-add-studies-form

Conversation

@InfinityBowman
Copy link
Copy Markdown
Owner

@InfinityBowman InfinityBowman commented Dec 29, 2025

Summary by CodeRabbit

  • Refactor

    • Restructured study management system for improved modularity and maintainability
    • Migrated component state management to enhance code organization
  • New Features

    • Automatic study deduplication and matching across PDFs, references, DOI lookups, and Google Drive sources
    • Enhanced state persistence and serialization for improved data handling
  • Bug Fixes

    • Improved file upload parameter handling

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

@InfinityBowman InfinityBowman linked an issue Dec 29, 2025 that may be closed by this pull request
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Dec 29, 2025

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

This PR refactors the "add studies" feature from context-based state management to a prop-driven, modularized architecture. It removes AddStudiesContext, converts form sections to accept props directly, and introduces a new useAddStudies hook decomposed into submodules for PDFs, references, lookups, Drive operations, deduplication, and serialization. Minor formatting updates are applied to unrelated components.

Changes

Cohort / File(s) Summary
FileUpload component
packages/ui/src/components/FileUpload.tsx
Passes acceptedFiles to onFilesChange handler by default; renames parameter details in handleFileAccept; initializes acceptedFiles as empty array in Ark UI Root component.
Context removal
packages/web/src/components/project/add-studies/AddStudiesContext.jsx
Entire file deleted; removes AddStudiesProvider, useStudiesContext, and useFormPersistenceContext exports.
Form and section components refactoring
packages/web/src/components/project/add-studies/AddStudiesForm.jsx, PdfUploadSection.jsx, ReferenceImportSection.jsx, DoiLookupSection.jsx, GoogleDriveSection.jsx
Converts from context-based to prop-driven architecture; AddStudiesForm threads studies state through props to child sections; each section now accepts props and accesses state via function accessors (studies(), onSaveFormState(), etc.) instead of context hooks.
New useAddStudies hook modules
packages/web/src/primitives/useAddStudies.js, useAddStudies/index.js, useAddStudies/pdfs.js, useAddStudies/references.js, useAddStudies/lookup.js, useAddStudies/drive.js, useAddStudies/deduplication.js, useAddStudies/matching.js, useAddStudies/serialization.js
Introduces modularized hook system with submodules for PDF operations, reference imports, DOI/PMID lookups, Google Drive file handling, deduplication logic, matching utilities, and ArrayBuffer serialization; main hook coordinates all sub-operations with reactive effects for auto-matching and state persistence.
Minor formatting updates
packages/web/src/components/charts/AMSTARDistribution.jsx, packages/web/src/components/project/overview-tab/OverviewTab.jsx
Single-line reformatting of title calculation and JSX component rendering; no functional changes.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related issues

  • Improve add studies form #191 — PR directly implements the "Improve add studies form" feature goal through comprehensive context-to-props refactoring and modularized hook architecture.

Possibly related PRs

Poem

🐰 From context we hop to props so clear,
Each section takes what it holds dear,
Studies flow like streams through every part,
A modular refactor—a beautiful art!
Dedup and match with hooks so tight,
The add-studies form takes flight! ✨

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5ca44ef and ba75034.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (18)
  • packages/ui/src/components/FileUpload.tsx
  • packages/web/src/components/charts/AMSTARDistribution.jsx
  • packages/web/src/components/project/add-studies/AddStudiesContext.jsx
  • packages/web/src/components/project/add-studies/AddStudiesForm.jsx
  • packages/web/src/components/project/add-studies/DoiLookupSection.jsx
  • packages/web/src/components/project/add-studies/GoogleDriveSection.jsx
  • packages/web/src/components/project/add-studies/PdfUploadSection.jsx
  • packages/web/src/components/project/add-studies/ReferenceImportSection.jsx
  • packages/web/src/components/project/overview-tab/OverviewTab.jsx
  • packages/web/src/primitives/useAddStudies.js
  • packages/web/src/primitives/useAddStudies/deduplication.js
  • packages/web/src/primitives/useAddStudies/drive.js
  • packages/web/src/primitives/useAddStudies/index.js
  • packages/web/src/primitives/useAddStudies/lookup.js
  • packages/web/src/primitives/useAddStudies/matching.js
  • packages/web/src/primitives/useAddStudies/pdfs.js
  • packages/web/src/primitives/useAddStudies/references.js
  • packages/web/src/primitives/useAddStudies/serialization.js

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.

@InfinityBowman InfinityBowman merged commit f78c776 into main Dec 29, 2025
1 of 3 checks passed
@InfinityBowman InfinityBowman deleted the 191-improve-add-studies-form branch December 29, 2025 18:25
@coderabbitai coderabbitai Bot mentioned this pull request Jan 19, 2026
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.

Improve add studies form

2 participants