diff --git a/README.md b/README.md index a9253d0..b98b878 100644 --- a/README.md +++ b/README.md @@ -11,9 +11,9 @@ is not — the same rule the OpenTofu modules follow. | [`app_report_client`](packages/app_report_client) | client half of [app-report-relay](https://github.com/DoYouHost/app-report-relay): ticket transport, on-disk outbox, log redaction | | [`app_diagnostics`](packages/app_diagnostics) | the other half — the recording session, the log record and its file mirror, the cross-isolate merge, the review summary, and the probes over taps, routes, requests, errors and lifecycle | | [`app_report_ui`](packages/app_report_ui) | the report screens — the guided flow, the recording bar that follows the user around the app, and the review that decides where the log goes | -| [`dash_ui`](packages/dash_ui) | the design system — tokens resolved per brightness and brand, the type scale, the screen chrome, the Material theme, and the contrast audit each app runs on its brand | +| [`dash_ui`](packages/dash_ui) | the design system — tokens resolved per brightness and brand, the type scale, the spacing scales (`DashSpace`, and Wear Material 3's `WearSpace` for a watch), the screen chrome, the Material theme, and the contrast audit each app runs on its brand | | [`dash_kit`](packages/dash_kit) | the Dash widgets that name themselves in the diagnostic log — the confirmation dialog, the load-error and empty views, the bottom sheet, the snack bar, the width cap, the spinners, the button pair, the logged app bar, the form fields — the select, the filter select and the picker field — the date pickers, the segmented toggle, the settings rows, the search field and bar, the stepper, the progress bar, the inline note, the sheet surfaces and the refresh-on-return wrapper | -| [`app_guards`](packages/app_guards) | source scans that hold an application to the Dash standards, for its tests to assert on — spacing from `DashSpace`, a `Wrap` that sets `runSpacing`, no one-letter word at a line end, no finder spelling out the copy — and the tools both applications run from their `justfile`: the one-letter-word glue, the LanguageTool check, the log-coverage scan, the translation-sync report, the Play bundle versions, Google Play publishing and the commit-message hook — each configured by a file in the application | +| [`app_guards`](packages/app_guards) | source scans that hold an application to the Dash standards, for its tests to assert on — spacing from `DashSpace` (or, on a watch, `WearSpace`), a `Wrap` that sets `runSpacing`, no one-letter word at a line end, no finder spelling out the copy — and the tools both applications run from their `justfile`: the one-letter-word glue, the LanguageTool check, the log-coverage scan, the translation-sync report, the Play bundle versions, Google Play publishing and the commit-message hook — each configured by a file in the application | | [`app_test_kit`](packages/app_test_kit) | the test harness both applications need the same way — a request log to assert on, an exact-body mock server, a scripted adapter, a clock and a timer the test drives, the diagnostic-id finders, a phone-shaped window and fixtures | | [`app_util`](packages/app_util) | small things both apps need the same way — tolerant JSON coercion, user-typed numbers, text measurement, platform-channel queries, byte sizes and hex colours, the demo-mode HTTP adapter, the server address, the web-link filter, the reconnect backoff, server reachability, currency symbols, name ordering and a stable digest, and the classification of a failed request | diff --git a/packages/app_guards/lib/src/spacing.dart b/packages/app_guards/lib/src/spacing.dart index e704d09..a0fa549 100644 --- a/packages/app_guards/lib/src/spacing.dart +++ b/packages/app_guards/lib/src/spacing.dart @@ -9,8 +9,9 @@ final _literal = RegExp( final _number = RegExp(r'(?- functions its own tests assert on: spacing from DashSpace, a Wrap that sets runSpacing, no one-letter word at a line end, and no finder spelling out the application's copy. Plus the tool that glues the one-letter words. -version: 0.1.0 +version: 0.1.1 publish_to: none environment: diff --git a/packages/app_guards/test/spacing_test.dart b/packages/app_guards/test/spacing_test.dart index 7993b78..ec88acf 100644 --- a/packages/app_guards/test/spacing_test.dart +++ b/packages/app_guards/test/spacing_test.dart @@ -19,10 +19,14 @@ final w = Wrap(spacing: 4, runSpacing: 4); expect(hits.first, endsWith('a.dart:1 EdgeInsets.all(12)')); }); - test('the scale, zero and a size are not spacing', () { + test('either scale, zero and a size are not spacing', () { final root = tree({ 'a.dart': ''' const p = EdgeInsets.all(DashSpace.lg); +const b = EdgeInsets.symmetric( + horizontal: WearSpace.buttonHorizontal, + vertical: WearSpace.buttonVertical, +); const z = EdgeInsets.zero; const n = EdgeInsets.only(left: 0); const box = SizedBox(width: double.infinity); diff --git a/packages/app_report_ui/pubspec.yaml b/packages/app_report_ui/pubspec.yaml index e27e34a..f570bac 100644 --- a/packages/app_report_ui/pubspec.yaml +++ b/packages/app_report_ui/pubspec.yaml @@ -21,7 +21,7 @@ dependencies: app_diagnostics: git: url: https://github.com/DoYouHost/app-shared.git - ref: v0.12.2 + ref: v0.13.0 path: packages/app_diagnostics app_report_client: git: @@ -35,7 +35,7 @@ dependencies: dash_kit: git: url: https://github.com/DoYouHost/app-shared.git - ref: v0.12.2 + ref: v0.13.0 path: packages/dash_kit # Only `saveFile` is called here. The upper bound stops before 11, which # replaced `FilePicker.platform.x()` with static methods and, in 13, dropped diff --git a/packages/app_test_kit/pubspec.yaml b/packages/app_test_kit/pubspec.yaml index 3c8fc55..287adb8 100644 --- a/packages/app_test_kit/pubspec.yaml +++ b/packages/app_test_kit/pubspec.yaml @@ -24,7 +24,7 @@ dependencies: app_diagnostics: git: url: https://github.com/DoYouHost/app-shared.git - ref: v0.12.2 + ref: v0.13.0 path: packages/app_diagnostics clock: ^1.1.2 dio: ^5.10.0 diff --git a/packages/app_util/pubspec.yaml b/packages/app_util/pubspec.yaml index 1056f3f..04ae35c 100644 --- a/packages/app_util/pubspec.yaml +++ b/packages/app_util/pubspec.yaml @@ -19,7 +19,7 @@ dependencies: app_diagnostics: git: url: https://github.com/DoYouHost/app-shared.git - ref: v0.12.2 + ref: v0.13.0 path: packages/app_diagnostics # 5.10 is the first with `DioExceptionType.transformTimeout`, and the # classification names every type so that the next one added is a compile diff --git a/packages/dash_kit/pubspec.yaml b/packages/dash_kit/pubspec.yaml index 00426f3..e868819 100644 --- a/packages/dash_kit/pubspec.yaml +++ b/packages/dash_kit/pubspec.yaml @@ -22,18 +22,18 @@ dependencies: app_diagnostics: git: url: https://github.com/DoYouHost/app-shared.git - ref: v0.12.2 + ref: v0.13.0 path: packages/app_diagnostics # `ButtonPair` measures its labels with `textWidth`. app_util: git: url: https://github.com/DoYouHost/app-shared.git - ref: v0.12.2 + ref: v0.13.0 path: packages/app_util dash_ui: git: url: https://github.com/DoYouHost/app-shared.git - ref: v0.12.2 + ref: v0.13.0 path: packages/dash_ui dev_dependencies: diff --git a/packages/dash_ui/lib/dash_ui.dart b/packages/dash_ui/lib/dash_ui.dart index 4235e4f..2991000 100644 --- a/packages/dash_ui/lib/dash_ui.dart +++ b/packages/dash_ui/lib/dash_ui.dart @@ -27,3 +27,4 @@ export 'src/dash_text.dart'; export 'src/dash_theme_data.dart'; export 'src/dash_tokens.dart'; export 'src/dash_widgets.dart'; +export 'src/wear_space.dart'; diff --git a/packages/dash_ui/lib/src/wear_space.dart b/packages/dash_ui/lib/src/wear_space.dart new file mode 100644 index 0000000..b276e13 --- /dev/null +++ b/packages/dash_ui/lib/src/wear_space.dart @@ -0,0 +1,26 @@ +import 'dash_space.dart'; + +/// The spacing of a Wear OS screen that Google names: Wear Material 3's button +/// inset (compose-material3 1.7.1 `ButtonDefaults`), off the 4 dp grid, and the +/// gaps of the Wear OS list guidance. A watch screen takes these roles from +/// here; spacing the guidance gives no role stays on [DashSpace]'s 4 dp grid, +/// which is what it asks for ("spacing is set in multiples of 4 dp"). +abstract final class WearSpace { + /// The content inset of every button variant, across and down + /// (`ButtonDefaults.ContentPadding`). + static const double buttonHorizontal = 14; + static const double buttonVertical = 6; + + /// Between the elements of one group in a list. + static const double inGroup = 4; + + /// Between groups within a slot of a list. + static const double betweenGroups = 8; + + /// From a list's title to its content. + static const double titleToContent = 12; + + /// Between the slots of a list, and between its top, middle and bottom + /// sections. + static const double betweenSections = 16; +} diff --git a/packages/dash_ui/pubspec.yaml b/packages/dash_ui/pubspec.yaml index f4cf47f..83b8d64 100644 --- a/packages/dash_ui/pubspec.yaml +++ b/packages/dash_ui/pubspec.yaml @@ -3,7 +3,7 @@ description: >- The Dash design system: colour tokens resolved per brightness and brand, the type scale, the screen chrome, the Material theme built from them, and the contrast audit a brand has to pass. -version: 0.3.2 +version: 0.4.0 publish_to: none environment: diff --git a/packages/dash_ui/test/wear_space_test.dart b/packages/dash_ui/test/wear_space_test.dart new file mode 100644 index 0000000..1462ac8 --- /dev/null +++ b/packages/dash_ui/test/wear_space_test.dart @@ -0,0 +1,15 @@ +import 'package:dash_ui/dash_ui.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + test("the watch's scale is Wear Material 3's", () { + // compose-material3 1.7.1: ButtonDefaults.ButtonHorizontalPadding, + // ButtonVerticalPadding; the Wear OS list guidance for the gaps. + expect(WearSpace.buttonHorizontal, 14); + expect(WearSpace.buttonVertical, 6); + expect(WearSpace.inGroup, 4); + expect(WearSpace.betweenGroups, 8); + expect(WearSpace.titleToContent, 12); + expect(WearSpace.betweenSections, 16); + }); +}