Platform Rules
These documents define behavior that differs across Windows, Linux, macOS, Android, iOS, and Web. Shared visual standards are defined in ../DESIGN.md; shared architecture is defined in ../ARCHITECTURE.md.
Architecture invariants
go_routerowns navigation state, route restoration, browser URLs, and platform back navigation.- Riverpod owns application state, dependencies, and asynchronous workflows.
- Platform rule documents must not contain business logic or duplicate feature state.
- Shared tokens and components remain the visual source of truth.
- Platform adapters expose capabilities such as file access, clipboard, lifecycle, and window behavior.
- Every platform-specific behavior must have a smoke-test scenario.
Platform comparison
| Platform | Primary input | Navigation concerns | Capability concerns | Release concerns |
|---|---|---|---|---|
| Windows | Keyboard, mouse, context menus | Desktop shell and shortcuts | Windows, file dialogs, high-DPI | Installer/package and resize smoke tests |
| Linux | Keyboard and mouse | Desktop shell and shortcuts | Window managers, file selection | Distribution packaging and environment coverage |
| macOS | Keyboard, mouse, trackpad | Command-key conventions | Permissions, file access, window lifecycle | Signing, notarization, and release validation |
| Android | Touch, system back, keyboard | Back stack and route restoration | Insets, lifecycle, keyboard | APK/AAB builds and device/API coverage |
| iOS | Touch, gestures, keyboard | Route restoration and system gestures | Safe areas, lifecycle, permissions | Signing, archive, and device coverage |
| Web | Mouse, keyboard, touch | URLs, refresh, history | Downloads, clipboard, browser APIs | Hosted build, deep links, and browser coverage |
Shared platform checklist
For every target:
- Verify the correct shell is selected for the available constraints and platform capabilities.
- Verify loading, success, empty, and recoverable error states.
- Verify keyboard or touch access for every primary interaction.
- Verify visible focus and accessibility labels.
- Verify text scaling and content that wraps at narrow widths.
- Verify unsaved work survives resize, route changes, and supported lifecycle transitions.
- Verify file and clipboard behavior using the platform adapter.
- Run the target's smoke tests before release.
Adding or changing a platform rule
- Describe the platform behavior and why the shared implementation is insufficient.
- Keep the change in the platform adapter or shell rather than in domain logic.
- Add or update a smoke test scenario.
- Check that the change does not duplicate
go_routeror Riverpod state. - Update the comparison table if capabilities or release requirements change.