Add StepFlow back navigation and invalid scan cooldown#909
Open
Vetle444 wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the StepFlow component with controlled back navigation from completed steps via StepFlowItem.CanGoBack and StepFlowController.GoBackTo, replacing the previous LockWhenCompleted API. It also improves the barcode scan overlay UX by ensuring invalid-scan reset animations finish before detection resumes, then applying a short cooldown to prevent immediate re-detection of the same barcode.
Changes:
- StepFlow: add back navigation for selected completed steps (
CanGoBack+GoBackTo) and disable back navigation after the flow is fully completed (breaking removal ofLockWhenCompleted). - Barcode scanner overlay: await bracket reset animation on failure and add a 500ms cooldown before rescanning.
- Update sample UI, wiki docs, changelog, and add focused controller unit tests.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| wiki/Components/StepFlow.md | Documents CanGoBack and GoBackTo, and updates GoTo behavior text. |
| src/tests/unittests/Components/StepFlow/StepFlowControllerTests.cs | Adds unit tests covering GoBackTo behavior and GoTo with completed steps. |
| src/library/DIPS.Mobile.UI/Components/StepFlow/StepFlowItem.Properties.cs | Replaces LockWhenCompleted with CanGoBack bindable property and refresh logic. |
| src/library/DIPS.Mobile.UI/Components/StepFlow/StepFlowItem.cs | Implements completed-step tap gating, refreshable tap targets, and animation cancellation handling. |
| src/library/DIPS.Mobile.UI/Components/StepFlow/StepFlowController.cs | Adds GoBackTo(int) to reactivate a completed step and reset subsequent steps. |
| src/library/DIPS.Mobile.UI/Components/StepFlow/StepFlow.Properties.cs | Refreshes item tap targets when AllowDirectStepActivation changes. |
| src/library/DIPS.Mobile.UI/Components/StepFlow/StepFlow.cs | Routes completed-step taps to GoBackTo, and disables back navigation after completion. |
| src/library/DIPS.Mobile.UI/API/Camera/BarcodeScanning/Overlay/BarcodeScanRectangleOverlay.cs | Awaits reset animation on invalid scans and adds a cooldown before rescanning. |
| src/app/Components/ComponentsSamples/StepFlow/StepFlowSamplesViewModel.cs | Adds CanGoBack toggle to the sample VM. |
| src/app/Components/ComponentsSamples/StepFlow/StepFlowSamples.xaml | Adds UI toggle and binds CanGoBack into sample steps. |
| CHANGELOG.md | Adds 62.0.0 entries for the StepFlow breaking change and barcode scanning fix. |
Comment on lines
+261
to
+268
| if (command is null && Touch.GetCommand(m_root) is not null) | ||
| { | ||
| Dispatcher.Dispatch(() => | ||
| { | ||
| if (!CanTapCard(State) && Touch.GetCommand(m_root) is not null) | ||
| { | ||
| Touch.SetCommand(m_root, null!); | ||
| } |
Comment on lines
+241
to
250
| if (State == StepFlowItemState.Completed) | ||
| { | ||
| var flow = FindParentStepFlow(); | ||
| if (flow?.CanGoBackFromCompletedSteps != true) | ||
| return; | ||
| if (!CanGoBack) | ||
| return; | ||
| } | ||
| if (State == StepFlowItemState.Disabled && FindParentStepFlow()?.AllowDirectStepActivation != true) | ||
| return; |
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.
Description of Change
Adds StepFlow back navigation through
StepFlowItem.CanGoBackandStepFlowController.GoBackTo. Completed steps can be reopened while the flow is still in progress, reopening resets that step and all following steps, and back navigation is disabled once every step is completed.BREAKING: Removes
StepFlowItem.LockWhenCompleted;CanGoBackis now the single API for completed-step navigation.Fixes invalid barcode validation so the scan rectangle waits for the bracket reset animation to finish, then applies a
500mscooldown before detection can resume. This keeps invalid scans from immediately restarting while the same barcode is still visible.Updates the StepFlow sample, wiki documentation, changelog, and focused controller tests.
Todos