Repository navigation
Conversation
There was a problem hiding this comment.
Note
Copilot was unable to complete this review at the selected tier due to model policy or plan restrictions.
🟢 Approval recommended
The change is a non-behavioral refactor that standardizes uploader APIs (e.g., isOpen/onClose, controlsRef, metaData) across components and updates the affected unit tests and call sites accordingly, with no remaining issues noted in the review evidence.
No open issues 🎉
What changed in this PR
Refactors the web upload-related components and Add Resource wizard to use consistent prop and return-value naming across the “upload family,” with no intended behavior change.
Changes:
- Standardizes close semantics to
onClose(): void(replacingonOpen(false)/onVisible(false)) and renamesMediaUploadDialog.visibletoisOpen. - Unifies upload controls ref naming to
controlsRefacross uploaders, wizard deferred upload flow, and graphic picker/upload. - Renames
GraphicUploadermetadatatometaDataand alignsuseAddResourceWizardreturn names with the props they feed downstream.
| File | Description |
|---|---|
| web/src/utils/useCompression.ts | Updates the compression hook to use an onClose callback naming/shape consistent with the upload components. |
| web/src/components/Uploader.tsx | Renames visibility callback usage to onClose() and updates MediaUploadDialog integration to the isOpen/onClose API. |
| web/src/components/TitleUploader.tsx | Switches uploader close handling to onClose() and forwards it into MediaUploadContent consistently. |
| web/src/components/TitleTabs.tsx | Updates the TitleUploader call site to pass onClose instead of prior visibility callback patterns. |
| web/src/components/Sheet/ScriptureTable.tsx | Removes now-unneeded visibility wrapper logic and closes the uploader via an onClose callback. |
| web/src/components/ProvideRights.tsx | Simplifies uploader visibility handling by replacing wrapper setters with an onClose callback. |
| web/src/components/PassageRecordPanel.tsx | Normalizes deferred upload ref naming to controlsRef and removes no-op visibility callback usage. |
| web/src/components/PassageDetail/PassageDetailRecord.tsx | Refactors upload close wiring to use onClose and drops redundant visibility wrapper functions. |
| web/src/components/PassageDetail/PassageDetailItem.tsx | Refactors upload close wiring to use onClose and removes redundant wrapper handlers. |
| web/src/components/PassageDetail/Internalization/useAddResourceWizard.ts | Renames wizard hook return fields/refs to match the downstream component prop names used by the Add Resource flow. |
| web/src/components/PassageDetail/Internalization/ResourceUploadStep.tsx | Renames isAudioMode to isAddingAudioResource and updates the step to use the standardized onClose callback pattern. |
| web/src/components/PassageDetail/Internalization/ResourceUploadStep.test.tsx | Updates tests to match renamed ResourceUploadStep props and the adjusted naming conventions. |
| web/src/components/PassageDetail/Internalization/ProjectResourceConfigure.tsx | Updates configure-step close plumbing to use the standardized onClose callback naming. |
| web/src/components/PassageDetail/Internalization/AddResourceWizard.tsx | Wires the renamed wizard return values through the wizard steps and configure flow to keep naming consistent end-to-end. |
| web/src/components/PassageDetail/Internalization/AddResourceWizard.test.tsx | Updates wizard tests/mocks to reflect the controlsRef and onClose renames and related prop/return-name changes. |
| web/src/components/MediaUploadDialog.tsx | Renames dialog props from visible/onVisible to isOpen/onClose and forwards the new API into the content layer. |
| web/src/components/MediaUploadContent.tsx | Updates content close handling to an optional onClose() callback and aligns internal cancel/close behavior to that API. |
| web/src/components/ImportTab.tsx | Updates the import flow to use MediaUploadDialog’s isOpen/onClose props. |
| web/src/components/GraphicUploader.tsx | Renames uploader props to metaData, controlsRef, and onClose to match the rest of the upload components and hook usage. |
| web/src/components/GraphicPicker.tsx | Aligns graphic picker upload wiring to use controlsRef, metaData, and onClose consistently. |
| web/src/components/GraphicPicker.test.tsx | Updates graphic picker tests to match the renamed GraphicUploader prop surface (metaData, controlsRef, onClose). |
| web/src/components/AudioTab/AudioTab.tsx | Updates the audio tab uploader integration to close via the standardized onClose callback. |
Review effort: Balanced
Rename props that changed name hop-to-hop without reason: GraphicUploader's metadata -> metaData; submitRef/mediaUploadControlsRef -> controlsRef; onOpen/onVisible (only ever called with false) -> onClose across the upload family and ProjectResourceConfigure, with MediaUploadDialog's visible -> isOpen. useAddResourceWizard's return names now match the child props they feed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rename Uploader's performedBy/onSpeakerChange to speaker/onSpeaker, the names MediaUploadDialog, MediaUploadContent and the wizard already use. performedBy stays only as the useMediaUpload record field. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The ref that saves a typed (possibly new) category at form submission was catCommitRef / editCatCommitRef / commitRef depending on the hop. Use categorySaveRef (editCategorySaveRef) throughout, and rename SelectArtifactCategory's commit()/committingRef to saveCategory()/savingRef. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PassRes dates from when the choice was a passage-vs-section boolean; it now sets the three-way resourceKind. Rename ResourceData's onPassResChange to onResourceKindChange and the wizard's handlePassRes to handleResourceKind; the artifact screens' handlePassRes was a bare wrapper, so pass setResourceKind. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
7cc6a16 to
191f385
Compare
There was a problem hiding this comment.
Note
Copilot was unable to complete this review at the selected tier due to model policy or plan restrictions.
🟢 Approval recommended
The change is a broad, consistent prop/ref renaming and wiring standardization across affected upload components with corresponding updates in dependent code and tests, and no active issues are indicated in the provided review evidence.
No open issues 🎉
Review effort: Balanced
There was a problem hiding this comment.
Note
Copilot was unable to complete this review at the selected tier due to model policy or plan restrictions.
🔵 Needs a closer look
This change makes broad, user-critical refactors across multiple upload-related dialog flows via prop renames, so manual smoke testing is needed to ensure close-path behavior hasn’t regressed beyond what typechecking can catch.
No open issues 🎉
Review effort: Balanced
Pure renames from the prop audit of #853: props that changed name from one component to the next without a reason now keep one name. No behavior change intended.
Renames
metadatametaDatasubmitRefcontrolsRefmediaUploadControlsRefcontrolsRefonOpenonCloseonVisibleonClosevisibleisOpenperformedByspeakeronSpeakerChangeonSpeakerfilenamedefaultFilenamemarkdownValueinValueresourceReadyreadyresourceUploadValidationMessagevalidationMessageresourcePendingRestorependingRestoreprojMediamediaprojIdentityitemsprojCandidatecandidateItemsisAudioModeisAddingAudioResourceaddCategorySaveRefcategorySaveRefcatCommitRefcategorySaveRefcommitRefcategorySaveRefeditCatCommitRefeditCategorySaveRefcommit()saveCategory()committingRefsavingRefonPassResChangeonResourceKindChangehandlePassReshandleResourceKindPassResdates from when the choice was a passage-vs-section boolean; it now sets the three-wayresourceKind.Other cleanup
handleUploadVisible(several screens),Uploader'shandleSpeakerChange, and the one-linehandlePassResinPassageDetailArtifacts/PassageDetailsArtifactsMobile(they passsetResourceKinddirectly). The wizard'shandleResourceKindstays because it also switches the upload type.MediaUploadContent'sonCloseis optional, which drops theonVisible={() => {}}no-ops.Uploaderstill passes a no-oponSpeakerwhen the caller gives none on a vernacular media upload, so the speaker picker and its rights gate still show (as the oldhandleSpeakerChangewrapper did).BigDialog'sonOpen,MediaRecord'sperformedBy(it's the mediafile record field) andSpeakerName'sname/onChange.Test plan
npm run typecheck🤖 Generated with Claude Code