trackslash
VAULT-151 P3 For an agent

Keep content out of the crease on the iPhone Duo's partly folded inner screen

0
All issues

Description

Bradley (2026-10-18): on the iPhone Duo's inner screen, partly folded, items sit across the crease. Move them out of it.

Change

  • Research first:
    • Find what iOS 27 offers for the Duo's fold: how an app learns the hinge's position and posture (partly folded or flat), and whether there's a system safe area, layout guide or trait for the crease.
    • Note how Apple's own apps lay out across it.
    • Record what you find in this issue before building anything.
  • Then check each screen on the partly folded inner screen, and move content out of the crease: the lock screen (door, text, field, Unlock button), the item list (tiles split by the fold), an item's page (the code, the recovery phrase's words), the editors, Settings and Backups.
    • Prefer the system's own guide or safe area, if there is one, over hard-coded geometry.
    • Flat, the inner screen keeps its normal layout.
  • Tests: snapshot or UI tests for at least the lock screen and the list in the partly folded posture, if the simulator can show it.

Done when

Nothing important sits across the crease on the partly folded inner screen. The flat and outer screens are unchanged, and make validate passes.

Sub-issues

0

Linked issues

0

GitHub

0

No branches or pull requests linked.

Comments

3
Bradley

Done in https://github.com/badbundle/vault-app/pull/751 (merged as c0d57b00).

  • How it's found: a hinge observer (UIHingeInteraction, iOS 27.1+) sets \.crease while the screen is partly folded. The crease is assumed to run through the middle, parallel to the shorter sides, with a 24 pt band.
  • What moves:
    • The lock screen and covers lay out as two pages held like a book, or as top and bottom halves on a table.
    • The sidebar meets the content at the crease.
    • The feed becomes two pages of cards with a gutter.
    • An item's page, the new-item sheets, and Tags, Settings, About and Backups keep to one page.
  • Tests: 21 new snapshots with the band shaded, and no existing snapshot changed.
  • Validation: validated with the Mac UI tests skipped, at Bradley's request.
  • What's left (comment-2 above): tabletop on scrolling screens; narrow centred sheets; system chrome. It also still needs checking on a real fold, or with Simulator's fold controls.
Bradley

Built (branch feat/duo-crease, commit d1b98d11, no PR yet)

  • Crease and observesCrease() (VaultiOS/Views/General/Crease.swift): a UIHingeInteraction, used only on iOS 27.1 and later, at the root of the app's window and of the lock's overlay window. It publishes \.crease (axis, plus position in window coordinates) only while the hinge is partiallyOpen. A value set from outside wins, for tests and previews. The doc comment records the assumption: the crease runs through the middle of the screen, parallel to its shorter sides, with a 24 pt band.
  • Lock screen and covers: held like a book, the door and words are on the leading page and the action on the trailing page. Stood on a table, the door and words are in the top half and the action in the bottom half. The door sits a third of the way down its page, so the cover and the lock screen still swap without it moving.
  • Sidebar: as wide as the leading page, so it meets the content at the crease.
  • Feed filling the window: two pages of same-size cards, either side of a gutter over the crease. The bar moves to the trailing page.
  • One page: the item page sheet, the new item flow, and Tags/Settings/About/Backups (when they fill the window) keep to one page.
  • Tests: snapshots of lock, password, covers (book and tabletop), feed at two text sizes, and the sidebar. They shade the crease band. All 534 VaultiOSTests pass, and existing snapshots are unchanged.

Left

  • Not seen on a folded screen. The simulator can't be folded from the CLI. Check in Simulator (Device menu) or on a device. In particular, check the sidebar width and whether the Duo's inner screen is regular width.
  • Tabletop on scrolling screens (feed, item page, Settings, Backups, editors): content scrolls across the horizontal crease. Only the lock screen and covers lay out around it.
  • A sheet narrower than 2 × 320 pt centred on the screen (a form sheet, if that's how the Duo presents sheets) is left straddling the crease, as each side is too narrow for the item page.
  • System chrome is left as it is: navigation bar titles centred across the crease when a view fills the window, alerts, confirmation dialogs, menus and toasts.
  • Lock screen in tabletop at the largest text sizes: the words can reach the band if they're taller than the top half.
  • AutoFill extension: no observer, so it's unchanged.
  • Assumptions to revisit: the crease's position, and the 24 pt band, are unconfirmed. Replace them with the system's geometry if Apple adds an API for it.
Bradley

Research (iOS 27.1 SDK, Xcode 27.1)

What the system offers

  • UIKit: UIHingeInteraction (UIHingeInteraction.h) and UIHinge (UIHinge.h), iOS 27.1+. You add the interaction to a view. Its handler is called with the initial state and again on every change, with update.hinge. That is nil when the view's hierarchy has no hinge (any other iPhone, or the outer screen). UIHinge has a status (unknown, closed, partiallyOpen, fullyOpen) and an angle in radians. Apple says to prefer status over the angle, whose update rate and precision are system policy.
  • SwiftUI: View.onHingeChange(isEnabled:_:) passes the old and new DeviceHingeContext (hinge: DeviceHinge?, which has status and angle: Angle), also iOS 27.1+. Unlike the UIKit interaction, it doesn't promise a call with the initial state, so the app uses the UIKit interaction.
  • Nothing gives the crease's position or size. There's no safe area, layout guide, trait or "display feature" for it. I searched the UIKit headers and the SwiftUI/SwiftUICore interfaces for hinge, crease and fold. So the app has to assume where the crease is.
  • The screens (simulator): inner 951×669 pt, landscape with the book open; outer 466×678 pt, with no crease. The app deploys to iOS 26, so all of this is behind #available(iOS 27.1, *).
  • Apple's own apps: I couldn't check them. The simulator can't be partly folded from the command line, so how Apple lays out across the crease is still to be seen on a device or in Simulator's UI.

Assumption adopted (documented in code): the crease runs through the middle of the inner screen, parallel to its shorter side. It's vertical when the screen is wider than tall (book), horizontal when taller than wide (tabletop). It counts only while the hinge is partiallyOpen; flat (fullyOpen), closed or unknown, the layout is unchanged. Content keeps out of a 24 pt band centred on it.

Plan: an observer at the root of the app's window and of the lock's overlay window publishes \.crease in the environment (injectable for tests). The lock screen and covers lay out like an open book, or top and bottom when tabletop. The sidebar meets the content column at the crease. The feed adds a gutter over the crease when it spans it. The item page keeps its content to one page.