Skip to content

refactor: remove dead upload/record props and orphaned string - #866

Merged
nabalone merged 16 commits into
developfrom
remove-dead-upload-code
Nov 12, 2026
Merged

nabalone merged 16 commits into
developfrom
remove-dead-upload-code

Conversation

@nabalone

Copy link
Copy Markdown
Collaborator

Follow-up to #853 (stacked on it; retarget to develop once #853 merges). Pure dead-code removal, no behavior change.

What

  • Uploader / MediaUploadDialog / MediaUploadContent / TitleUploader: drop props no caller passes since the Add Resource wizard (metaData, beforeUpload, cancelReset, onFiles, eafUrl, inValue + Faithbridge split, team, uploadDialogBp/bp, validationMessage, hideUploadCancel/hideCancel, ready, unused showMessage, etc.).
  • MediaRecord: drop setCanCancel, onLoaded, hideControls, onProgress, onDuration, hasRecording, unread cancelMethod (kept controlsRef, used by Cypress).
  • WSAudioPlayer: drop hideControls and hasRecording — MediaRecord was their only passer. The record button's showText always resolved to false (its default), so it's dropped too.
  • ResourceData: every caller passed catRequired={false} / catAllowNew={true}; hard-coded.
  • Localization: remove passageDetailArtifacts.createResources (only used by SelectSections' removed visual mode); regenerated.

Test plan

  • npm run typecheck
  • jest: WSAudioPlayer + MediaRecord suites (80 tests) pass
  • Smoke: upload media from the plan sheet, record a passage, add a resource via the wizard

🤖 Generated with Claude Code

nabalone and others added 11 commits November 10, 2026 15:33
General resources are no longer queued for pending-upload retry, so remove
the now-dead restore/resume chain (projectresource restore kind,
pendingProjectResourceConfig, useResumePendingProjectResourceConfig).
Fix the no-op gutterBottom CSS key in PassageRecordPanel, add a cleanup
TODO for MediaRecord's setHasTake effect, and clarify that unfinished
wizard work is dropped on save-all.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- WSAudioPlayer: remove hideControls and hasRecording; MediaRecord was
  their only passer and no longer forwards them.
- Remove passageDetailArtifacts.createResources; its only consumer was
  SelectSections' removed visual mode. Regenerated localization.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI 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.

Note

Copilot was unable to complete this review at the selected tier due to model policy or plan restrictions.

🟡 Changes recommended

A lingering react-hooks/exhaustive-deps suppression in web/src/components/MediaRecord.tsx lacks the required explanatory comment about intentionally omitted dependencies, so it doesn’t meet the documented hook dependency suppression standard.

1 open issue
What changed in this PR

Removes dead props and orphaned localization strings across media upload/record components and the internalization resource flow, aiming to simplify component APIs without behavior changes.

Changes:

  • Pruned unused props and wiring across upload/record UI components (Uploader, dialogs/content, MediaRecord, WSAudioPlayer).
  • Simplified ResourceData by hard-coding category behavior that was constant across callers.
  • Removed an orphaned localization key and updated generated localization artifacts/bundle pointer.
File Description
web/​src/​store/​localization/​reducers.tsx Removes the unused passageDetailArtifacts.createResources entry from the generated localization reducer data.
web/​src/​store/​localization/​model.tsx Drops the createResources field from the typed localization interface/model.
web/​src/​store/​localization/​exported-strings-name.json Updates the generated localization bundle filename pointer used at runtime.
web/​src/​components/​WSAudioPlayer.tsx Removes dead hideControls/hasRecording plumbing and simplifies related UI logic.
web/​src/​components/​Uploader.tsx Eliminates unused uploader props and dead branching that no callers use anymore.
web/​src/​components/​TitleUploader.tsx Simplifies the Title upload wrapper by removing unused props and fixing the upload type.
web/​src/​components/​TitleTabs.tsx Updates TitleUploader usage to stop passing props that were removed.
web/​src/​components/​Sheet/​ScriptureTable.tsx Stops passing the removed showMessage prop to Uploader.
web/​src/​components/​ProvideRights.tsx Stops passing the removed showMessage prop to Uploader.
web/​src/​components/​PassageDetail/​PassageDetailRecord.tsx Removes unused snackbar usage and updates Uploader props after API cleanup.
web/​src/​components/​PassageDetail/​PassageDetailItem.tsx Updates Uploader usage by removing the no-longer-supported showMessage prop.
web/​src/​components/​PassageDetail/​Internalization/​ResourceData.tsx Hard-codes category defaults that were constant and removes now-dead category props.
web/​src/​components/​PassageDetail/​Internalization/​PassageDetailsArtifactsMobile.tsx Updates ResourceData usage to match the simplified category prop API.
web/​src/​components/​PassageDetail/​Internalization/​PassageDetailArtifacts.tsx Updates ResourceData usage to align with removed category props.
web/​src/​components/​PassageDetail/​Internalization/​AddResourceWizard.tsx Removes no-longer-needed ResourceData category props from the wizard flow.
web/​src/​components/​MediaUploadDialog.tsx Removes unused dialog configuration props and simplifies dialog setup.
web/​src/​components/​MediaUploadContent.tsx Removes unused prop forwarding (e.g., team) through upload content components.
web/​src/​components/​MediaRecord.tsx Removes multiple unused recorder props and cleans up related internal wiring to the audio player.
web/​src/​components/​AudioTab/​AudioTab.tsx Stops passing removed showMessage prop to Uploader after the uploader API cleanup.
localization/​TranscriberAdmin-en.xlf Removes the passageDetailArtifacts.createResources translation unit from the English catalog.
localization/​TranscriberAdmin-en-1.2.xliff Removes the passageDetailArtifacts.createResources translation unit from the legacy English XLIFF export.

Review effort: Balanced

@@ -730,7 +703,7 @@ function MediaRecord(props: IProps) {
setOriginalBlob(undefined);
},
// eslint-disable-next-line react-hooks/exhaustive-deps

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

we decided as a team that we don't need to do these

@nabalone
nabalone marked this pull request as ready for review November 12, 2026 04:00
Base automatically changed from upload-pipeline-use-media-upload_2 to develop November 12, 2026 14:03
nabalone and others added 3 commits November 12, 2026 09:05
# Conflicts:
#	web/src/store/localization/exported-strings-name.json
…-code

# Conflicts:
#	web/src/components/MediaRecord.tsx
#	web/src/components/MediaUploadDialog.tsx
#	web/src/components/PassageDetail/Internalization/AddResourceWizard.tsx
#	web/src/components/PassageDetail/Internalization/ResourceData.tsx
#	web/src/components/TitleUploader.tsx
#	web/src/components/Uploader.tsx
#	web/src/store/localization/exported-strings-name.json
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-code

Resolve exported-strings-name.json conflict by regenerating localization.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nabalone
nabalone merged commit e6c0475 into develop Nov 12, 2026
2 checks passed
@nabalone
nabalone deleted the remove-dead-upload-code branch November 12, 2026 18:05
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.

3 participants