Skip to content

Add StepFlow back navigation and invalid scan cooldown#909

Open
Vetle444 wants to merge 1 commit into
mainfrom
vefi/feature-1842
Open

Add StepFlow back navigation and invalid scan cooldown#909
Vetle444 wants to merge 1 commit into
mainfrom
vefi/feature-1842

Conversation

@Vetle444

Copy link
Copy Markdown
Contributor

Description of Change

Adds StepFlow back navigation through StepFlowItem.CanGoBack and StepFlowController.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; CanGoBack is 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 500ms cooldown 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

  • I have tested on an Android device.
  • I have tested on an iOS device.
  • I have supported accessibility

Copilot AI review requested due to automatic review settings June 26, 2026 07:18
@Vetle444 Vetle444 enabled auto-merge (squash) June 26, 2026 07:21

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.

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 of LockWhenCompleted).
  • 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;
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.

2 participants