Restructure Train by Voice composer into a 3-step accordion#661
Restructure Train by Voice composer into a 3-step accordion#661shreeraman96 wants to merge 3 commits into
Conversation
|
The PR Policy check is blocking this PR because required template information is missing. Please update the PR description with:
Visual files detected:
Screenshots or video are required for UI, UX, settings, onboarding, overlay, menu bar, or visual behavior changes. If this PR has no visual changes, check the no-visual-change box in the template. If this remains incomplete for 48 hours after opening, the PR may be closed. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 903a026ba3
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| private var trainingVerifyStepBody: some View { | ||
| VStack(alignment: .leading, spacing: self.theme.metrics.spacing.sm) { | ||
| self.trainingFinalOutputPanel | ||
|
|
||
| Button { | ||
| Task { await self.addTrainedReplacement() } |
There was a problem hiding this comment.
Show verification errors in the Verify step
When advanced voice matching is enabled and addTrainedReplacement() fails to save the pronunciation profile, it sets trainingHasError and trainingStatusMessage while leaving the accordion on Verify. Because the footer that renders those errors is now only included in trainingRecordStepBody, this Verify body shows no failure feedback after the Add Replacement attempt fails, unlike the previous always-visible footer. Include the error/footer in this step as well so the user can see and recover from save failures.
Useful? React with 👍 / 👎.
Greptile SummaryThis PR fixes issue #648 by replacing the flat Train by Voice composer with a guided 3-step accordion (Word → Record → Verify & Save), and hardens the underlying step state machine so the Start button is no longer permanently inactive.
|
FluidVoice PR build readyDownload FluidVoice-PR-661-a99cfbd10957 The artifact contains the ad-hoc-signed app ZIP, Xcode archive, build manifest, and installation instructions. It expires 5 days after the build. Install the app
This build has its own app identity, so its permissions are separate from the release version of FluidVoice. |
Splits the flat replacement composer into Word -> Record -> Verify & Save steps with an extracted, unit-tested step-derivation model. - Extract pure step logic into DictionaryTrainingStepModel (SwiftUI-free) - Render composer as a 3-step accordion with per-step status glyphs - Reset hasReachedVerify latch on every teardown path (Try Again, capture removal, mode toggle) so Verify never dead-ends with Save disabled - Reset lastAnnouncedTrainingStep and announce any forward step edge (including word->verify) for correct VoiceOver cues - Make Record/Verify headers non-interactive while the word is empty - Move trainingReplacement onChange to the always-mounted accordion so programmatic word writes still reset progress - Add unit tests for step derivation, readiness predicates, and edges
- Reset lastAnnouncedTrainingStep on all teardown paths so the step-3 VoiceOver cue fires again on retry (resetTrainingVerificationAttempts, removeTrainingVariant) - Show save-failure errors in the Verify step body (footer previously lived only in the Record body) - Drop the unused trainingVariantsIsEmpty param from isOutputCovered - Introduce DictionaryTrainingSnapshot to collapse the step-model param packs (fixes function_parameter_count) and move accordion helpers into an extension (fixes type_body_length); no behavior change
6cac7d6 to
a99cfbd
Compare
Description
Fixes #648, where Train by Voice / Teach Pronunciation under Custom Dictionary showed no interactive prompts and left the Start button permanently inactive. This replaces the flat replacement composer with a guided 3-step accordion (① Word → ② Record → ③ Verify & Save) that always surfaces the next action, and hardens the underlying step state machine.
Changes:
DictionaryTrainingStepModel(DictionaryTrainingSnapshotgroups the training state)hasReachedVerifylatch on every teardown path (Try Again, capture removal, mode toggle) so Verify never dead-ends with Save disabledlastAnnouncedTrainingStepon teardown and announce any forward step edge (incl.word → verify) for correct VoiceOver cuestrainingReplacementonChangeonto the always-mounted accordion so programmatic word writes still reset progressType of Change
Related Issue or Discussion
Closes #648
Testing
swiftlint --strict --config .swiftlint.yml Sources— 0 violationsswiftformat --config .swiftformat— changed files passDictionaryTrainingStepModelTests— 20/20 passingScreenshots / Video
Step 1 : Enter the word to teach
Step 2 : Record
Step 3 : Verify & save
Manual Add
Research preview
Before all shown at once
Notes