trackslash
VAULT-28 P2

Make choosing a new item's type the first step of the create sheet

0
All issues

Description

Going from the "New Item" picker to the first step of creating an item is clunky. The picker is a separate sheet with its own design, so the first step appears as a whole new sheet instead of sliding in like the steps after it.

Why:

  • The + button opens CreateItemPickerView, a sheet with a "New Item" title and option cards, but no step header and no action bar.
  • Choosing a type changes VaultListView's modal from .choosingItemType to .creatingItem. SwiftUI then dismisses the picker's sheet and presents a second sheet for the editor.
  • That dismiss-and-present is the jump you see.

What to change:

  • Make choosing the type the first screen of the same sheet as the editor steps, in the same design. That means a step header (icon, title, one line), the option cards on the sheet's glass, and a sheet sized to fit.
  • Choosing a type slides to that type's first step within the same sheet, and the sheet resizes, just as it does between steps. With Reduce Motion on, it fades instead.
  • Back on the first step returns to the type choice.
  • The progress bar probably shouldn't count the type choice, since the number of steps depends on the type chosen. Show it once a type is picked.

Code to clean up: with one sheet, two workarounds in VaultListView should no longer be needed. Remove them if so.

  • presenting the editor by changing the modal item
  • setting detents so the picker's height doesn't carry over into the editor

Tests:

  • A snapshot test of the type choice.
  • Flow tests for choosing a type, continuing to its first step, and going back.
  • Check it in the simulator with Reduce Motion both on and off.

GitHub

0

No branches or pull requests linked.

Comments

1
Bradley

Fixed in https://github.com/badbundle/vault-app/pull/636 (merged as b2d4d400).

One sheet: the + button now opens a single sheet whose first screen is the type choice. It has a step header ("Type") and the option cards on the sheet's glass, and it's sized to fit.

Moving between steps:

  • Choosing a type slides its first step in while the sheet resizes. With Reduce Motion on, it fades instead.
  • Back on the first step returns to the type choice.
  • The progress bar only appears once a type is chosen.

Code cleanup: both VaultListView workarounds are gone: presenting the editor by switching modal, and resetting detents.

Sheet sizing:

  • The sheet now sets its own height from what each screen reports, measured without the bottom safe area. That stopped the jitter, and fitted steps are no longer 34 pt too tall.
  • Tall steps, such as a code's Key step, use .large.

Judgement calls:

  • Back from the first step discards what was entered, the same as Cancel.
  • A second tap during the slide is ignored.
  • The recovery phrase "Passcode Required" screen sits on the sheet's glass, with Back instead of Cancel.

Tests:

  • CreateItemFlowTests covers choosing, going back, a second tap, and choosing again.
  • Type-choice snapshots (light and dark, three text sizes).
  • CreateItemFlowViewSnapshotTests.
  • Checked in the simulator with Reduce Motion on and off, in light and dark.