You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Refactor Add Resource into a single-dialog wizard; scope audio-player hotkeys - #741
Reworks the "Add Audio Resource" / general-resource flow and fixes the multi-player hotkey handling it exposed.
What changed
Single-dialog wizard. Extracted AddResourceWizard from PassageDetailArtifacts; the upload/record step, Select Sections, and Configure now live in one dialog. The upload/record UI is a chrome-less PassageRecordPanel (split out of PassageRecordDlg) that Uploader renders in an embedded mode; Select Sections stays mounted (CSS-hidden) across Back, Configure mounts only on its step.
Back buttons for everyone. Removed the developer-mode gate on the wizard's Back buttons (SelectSections, ProjectResourceConfigure).
Warn on app close with unsaved work (TT-7767). The wizard registers a save-less close-guard tool with the Unsaved context whenever closing would lose work (Configure step, a staged recording on Select Sections, or an unsaved take on Upload), so a browser/app close raises the usual unsaved-changes warning in addition to the dialog's own X confirm. The configure save tool id is renamed to AddResourceWizard-Save to distinguish it from the close guard.
Scoped hotkeys (opt-out).WSAudioPlayer gains a hotkeys prop (default true) that enables/disables all of a player's shortcuts together; the wizard passes hotkeys={active} so an off-screen step doesn't grab Alt+Space/F9. HotKeyContext is unchanged (most-recent-wins); default-true keeps every existing screen identical.
Fix: stuck upload progress bar. A deferred stage left MediaUploadContent's progress true; since the embedded panel stays mounted across Back, the indeterminate bar spun forever and disabled Next. Progress is now cleared after a successful deferred stage.
Removes the now-unused projectResourceConfigure ("Chunk into Resources") string.
Manual: Add Audio Resource → record a take → Next → Back lands on the Record tab with the take intact; select a file → Select Sections → Back leaves Next enabled (no stuck bar); keyboard transport in guided-phrase record still controlled by the source player; closing the browser mid-configure (or with a staged take) raises the unsaved-changes warning.
The reason will be displayed to describe this comment to others. Learn more.
Copilot review overview
🔵 Needs a closer look
This is a large, high-risk refactor of stateful dialog/close/hotkey plumbing across several large components, and it already exposes a subtle stale-state defect (uploadHasTake not reset in closeAll), so a human should review the full flow before approval.
This PR refactors the "Add Audio Resource" / general-resource flow in the passage-detail internalization UI. The previously inline, multi-dialog upload/record → select-sections → configure flow (duplicated inside PassageDetailArtifacts and its mobile twin) is extracted into a single reusable AddResourceWizard component driven by a launch request from the parent. As part of this, the record/upload body is split out of PassageRecordDlg into a chrome-less PassageRecordPanel that Uploader can render in a new embedded mode, and the audio player's keyboard shortcuts become opt-out (hotkeys prop) so an off-screen record step no longer steals Alt+Space/F9. It also fixes a stuck indeterminate progress bar on the embedded upload step and removes the now-unused projectResourceConfigure ("Chunk into Resources") string.
Changes:
Extract AddResourceWizard (single-dialog, step-state in one place) plus shared hooks (useResourceScopeLabels, useResourceArtifactTypes) and pure helpers (resourceScopeLabels), replacing the inline flow in both desktop and mobile artifact components.
Split PassageRecordPanel out of PassageRecordDlg; add Uploaderembedded mode; scope WSAudioPlayer/MediaRecord hotkeys via a hotkeys prop (default true); clear progress after a deferred stage in MediaUploadContent.
Remove the developer-mode gate on wizard Back buttons and delete the unused projectResourceConfigure localization string across model/reducers/xlf/xliff/tests.
File
Description
AddResourceWizard.tsx
New single-dialog wizard owning the upload→select→configure flow.
AddResourceWizard.test.tsx
Tests for wizard steps, Back/Next, close/confirm behavior.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The mobile host omits the per-launch remount key that the wizard's teardown design depends on, leaking stale flow state across opens, and this large stateful refactor warrants human verification.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
It is a large, high-risk refactor (new ~800-line wizard state machine, parallel desktop/mobile changes, recorder/dialog lifecycle, and hotkey-subscription changes) whose runtime behavior cannot be fully verified by static review, so it warrants final human review.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
It is a large cross-cutting dialog/state-machine refactor (an 800+ line new wizard, embedded Uploader mode, close-guard and scoped-hotkey behavior) whose many interacting UI states can only be partially verified statically and warrant human review.
Broken doc comment grammar and missing comment punctuation
web/src/components/MediaUploadContent.tsx:186
This doc comment is grammatically broken: "the selection survives is still there if the user hits next then back" has two verbs ("survives"/"is still there"), and the closing */ is missing a space before it and a sentence-ending period. Consider rewording for clarity.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
It is a large, intricate multi-file refactor of the upload/record/hotkey flows whose deferred-upload and callback-timing behavior warrants final human verification, and it ships several leftover review-conversation comments that should be cleaned up first.
…ype constants (#795)
* Rename MediaUpload to MediaUploadDialog and share content-type constants
Pure renames split out of the add-resource wizard refactor (#741), no
behavior change:
- MediaUpload.tsx -> MediaUploadDialog.tsx (component + importers)
- UriLinkType/MarkDownType/Mp3Type/FaithbridgeType move to utils/contentType
(drops the duplicate copies in resourceArtifactName and its test)
- MediaUploadContent prop saveText -> saveButtonText
- ResourceData prop allowProject -> allowGeneralResourceOption
- pullPlanMedia getPlanId -> getRemotePlanId
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* Point XLIFF sourcefile context at MediaUploadDialog.tsx
Follow-up to the MediaUpload -> MediaUploadDialog rename: the 30
mediaUpload.* trans-units still named MediaUpload.tsx as their source file
for translators (flagged by Devin review).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* refactor: add hotkeys prop to WSAudioPlayer and MediaRecord
Split out of the add-resource wizard refactor (#741). WSAudioPlayer gains a
`hotkeys` prop (default true) that enables/disables all of a player's
keyboard shortcuts together, so an off-screen player can yield them to the
visible one. MediaRecord forwards it. Default true keeps every existing
screen unchanged.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* refactor: keep passive players from touching shared hotkeys
Address Devin review on #796:
- Forward `hotkeys` to WSAudioPlayerRate/Zoom/Segment so a passive player
doesn't claim the speed, zoom, or segment shortcuts.
- Remove the mount-only unsubscribe list from the device-listener cleanup.
It predates TT-7283, which gave each hotkey effect its own cleanup, so it
was redundant for active players — and for a passive player it removed
keys owned by the active one (HotKeyContext tracks keys, not owners).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* feat: let the source player own hotkeys in Careful Speech and PBT
PassageDetailGuidedPhraseRecord (Careful Speech and Phrase Back Translate)
mounts the source player above the CarefulSpeechControls recorder. Both
subscribed the shared transport keys, and the recorder (mounted second)
won. Pass hotkeys={!allowSourcePlayer} through CarefulSpeechControls so
the top source player keeps them.
hotkeys is all-or-nothing, so the recorder also drops F9 and Ctrl+C/X/V
while the source player is shown; TT-7748 tracks making the prop specify
which hotkeys a player claims.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Revert Careful Speech hotkeys change; add TT-7748 TODO
Undo 28fc500 (the recorder in Careful Speech / PBT giving up all its
hotkeys to the source player) — not wanted as an all-off change. Instead
note on WSAudioPlayer's hotkeys prop that TT-7748 will let a player
specify which hotkeys it claims.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Jira: https://jira.sil.org/browse/TT-7767
Reworks the "Add Audio Resource" / general-resource flow and fixes the multi-player hotkey handling it exposed.
What changed
AddResourceWizardfromPassageDetailArtifacts; the upload/record step, Select Sections, and Configure now live in one dialog. The upload/record UI is a chrome-lessPassageRecordPanel(split out ofPassageRecordDlg) thatUploaderrenders in anembeddedmode; Select Sections stays mounted (CSS-hidden) across Back, Configure mounts only on its step.SelectSections,ProjectResourceConfigure).AddResourceWizard-Saveto distinguish it from the close guard.WSAudioPlayergains ahotkeysprop (default true) that enables/disables all of a player's shortcuts together; the wizard passeshotkeys={active}so an off-screen step doesn't grab Alt+Space/F9.HotKeyContextis unchanged (most-recent-wins); default-true keeps every existing screen identical.MediaUploadContent'sprogresstrue; since the embedded panel stays mounted across Back, the indeterminate bar spun forever and disabled Next. Progress is now cleared after a successful deferred stage.projectResourceConfigure("Chunk into Resources") string.Test plan
npm run typecheck(web) clean.🤖 Generated with Claude Code