TT-7334 feat: add Prompt tool functionality and components#318
Merged
Conversation
Contributor
gtryus
commented
May 21, 2026
- Introduced PassageDetailPrompt component to handle prompt-related UI.
- Added PassageDetailPromptAdmin and PassageDetailPromptMember for admin and member views respectively.
- Integrated prompt playback handling in PassageDetailPlayer and PassageDetailMobileFooter.
- Updated context to manage prompt playback completion state.
- Enhanced step permissions to include prompt-related checks.
- Implemented tests for prompt section resource functionality.
- Updated localization to support prompt strings.
- Refactored tool slug handling to accommodate the new Prompt tool.
- Introduced PassageDetailPrompt component to handle prompt-related UI. - Added PassageDetailPromptAdmin and PassageDetailPromptMember for admin and member views respectively. - Integrated prompt playback handling in PassageDetailPlayer and PassageDetailMobileFooter. - Updated context to manage prompt playback completion state. - Enhanced step permissions to include prompt-related checks. - Implemented tests for prompt section resource functionality. - Updated localization to support prompt strings. - Refactored tool slug handling to accommodate the new Prompt tool.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new Prompt workflow tool to the renderer so BOLD teams can record a section-level prompt (admin view) and require members to listen before advancing (member view), while keeping compatibility with legacy BOLD steps that were previously modeled as resource.
Changes:
- Introduces Prompt UI components and a hook to locate the prompt’s section resource, plus localization wiring for prompt strings.
- Extends playback/player plumbing and PassageDetail context to track “prompt playback complete”, and gates mobile step navigation accordingly.
- Adds
ToolSlug.Prompt, updates tool/step resolution (including legacy BOLD mapping), and includes tests for slug resolution + prompt section resource selection.
Reviewed changes
Copilot reviewed 24 out of 25 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/renderer/src/utils/useStepPermission.ts | Exposes permissionsOn to allow UI decisions based on whether step assignments are enabled. |
| src/renderer/src/store/localization/reducers.tsx | Adds prompt layout strings and includes it in localization fetch hydration. |
| src/renderer/src/store/localization/model.tsx | Adds IPromptStrings and extends tool strings with prompt. |
| src/renderer/src/store/localization/exported-strings-name.json | Updates exported strings bundle name to the newly generated file. |
| src/renderer/src/selector/selectors.tsx | Adds promptSelector for prompt localization strings. |
| src/renderer/src/routes/PassageDetail.tsx | Wires Prompt into mobile step rendering. |
| src/renderer/src/crud/useTools.ts | Adds Prompt to available tool slugs list. |
| src/renderer/src/crud/useStepTool.ts | Adds resolveToolSlug to map legacy BOLD Prompt steps from resource → prompt. |
| src/renderer/src/crud/useStepTool.test.ts | Tests for resolveToolSlug legacy mapping behavior. |
| src/renderer/src/crud/useSecResCreate.ts | Allows creating section resources tied to a provided orgWorkflowStep (needed for prompt). |
| src/renderer/src/crud/useOfflineSetup.ts | Updates offline BOLD workflow seed to use the prompt tool slug. |
| src/renderer/src/crud/toolSlug.ts | Adds ToolSlug.Prompt and allows empty vernacular audio for prompt. |
| src/renderer/src/context/PassageDetailContext.tsx | Adds prompt playback completion state + setter to context. |
| src/renderer/src/components/PassageDetail/Prompt/usePromptSectionResource.ts | Implements prompt section resource selection logic (step-linked with legacy fallback). |
| src/renderer/src/components/PassageDetail/Prompt/usePromptSectionResource.test.ts | Tests prompt row selection logic and edge cases. |
| src/renderer/src/components/PassageDetail/Prompt/PassageDetailPromptMember.tsx | Member UI: plays prompt audio and sets playback-complete when finished. |
| src/renderer/src/components/PassageDetail/Prompt/PassageDetailPromptAdmin.tsx | Admin UI: records/uploads prompt and creates the corresponding section resource. |
| src/renderer/src/components/PassageDetail/Prompt/PassageDetailPrompt.tsx | Chooses admin vs member prompt UI based on role/permissions. |
| src/renderer/src/components/PassageDetail/PassageDetailPlayer.tsx | Adds onDuration callback passthrough for consumers (Prompt member playback tracking). |
| src/renderer/src/components/PassageDetail/PassageDetailGrids.tsx | Wires Prompt into desktop PassageDetail grid rendering. |
| src/renderer/src/components/PassageDetail/mobile/PassageDetailMobileFooter.tsx | Gates “Next” on Prompt step until prompt exists and playback is complete. |
| src/renderer/src/components/PassageDetail/mobile/PassageDetailMobileFooter.cy.tsx | Adds Cypress coverage for Prompt-step “Next” gating behavior. |
| localization/TranscriberAdmin-en.xlf | Adds prompt string units (prompt.noAudio, tool.prompt). |
| localization/TranscriberAdmin-en-1.2.xliff | Adds prompt string units with sourcefile contexts. |
…props - Added orgRole and permissions parameters to mountFooter function for improved flexibility. - Updated defaultParams to utilize the new permissions prop. - Modified test cases to include orgRole and permissions settings for better coverage.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.