@gjsify/adwaita-web 0.36.0 → 0.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/dist/adwaita-web.css +504 -34
  2. package/dist/adwaita-web.css.map +1 -1
  3. package/lib/types/accent.d.ts +28 -0
  4. package/lib/types/adw-accent.spec.d.ts +2 -0
  5. package/lib/types/adw-shortcut-label.spec.d.ts +2 -0
  6. package/lib/types/breakpoints.d.ts +10 -12
  7. package/lib/types/elements/adw-about-dialog.d.ts +19 -36
  8. package/lib/types/elements/adw-action-row.d.ts +9 -12
  9. package/lib/types/elements/adw-alert-dialog.d.ts +0 -12
  10. package/lib/types/elements/adw-avatar.d.ts +1 -0
  11. package/lib/types/elements/adw-bottom-sheet.d.ts +7 -12
  12. package/lib/types/elements/adw-button-content.d.ts +3 -4
  13. package/lib/types/elements/adw-button-row.d.ts +1 -1
  14. package/lib/types/elements/adw-carousel.d.ts +28 -49
  15. package/lib/types/elements/adw-checks.d.ts +2 -8
  16. package/lib/types/elements/adw-combo-row.d.ts +6 -6
  17. package/lib/types/elements/adw-data-grid.d.ts +5 -10
  18. package/lib/types/elements/adw-drop-down.d.ts +3 -11
  19. package/lib/types/elements/adw-entry-row.d.ts +20 -23
  20. package/lib/types/elements/adw-icon.d.ts +2 -4
  21. package/lib/types/elements/adw-inline-view-switcher.d.ts +18 -31
  22. package/lib/types/elements/adw-navigation-split-view.d.ts +7 -12
  23. package/lib/types/elements/adw-navigation-view.d.ts +2 -10
  24. package/lib/types/elements/adw-overlay-split-view.d.ts +28 -52
  25. package/lib/types/elements/adw-password-entry-row.d.ts +4 -5
  26. package/lib/types/elements/adw-popover.d.ts +2 -7
  27. package/lib/types/elements/adw-preferences-dialog.d.ts +21 -34
  28. package/lib/types/elements/adw-preferences-group.d.ts +12 -14
  29. package/lib/types/elements/adw-progress-bar.d.ts +3 -4
  30. package/lib/types/elements/adw-shortcut-label.d.ts +20 -0
  31. package/lib/types/elements/adw-sidebar.d.ts +5 -10
  32. package/lib/types/elements/adw-spinner.d.ts +3 -5
  33. package/lib/types/elements/adw-split-button.d.ts +6 -16
  34. package/lib/types/elements/adw-switch-row.d.ts +3 -3
  35. package/lib/types/elements/adw-tab-view.d.ts +16 -26
  36. package/lib/types/elements/adw-toast-overlay.d.ts +8 -13
  37. package/lib/types/elements/adw-view-stack.d.ts +7 -17
  38. package/lib/types/elements/adw-view-switcher-bar.d.ts +4 -8
  39. package/lib/types/elements/adw-view-switcher.d.ts +18 -38
  40. package/lib/types/elements/adw-wrap-box.d.ts +7 -17
  41. package/lib/types/elements/view-switcher-dom.d.ts +10 -13
  42. package/lib/types/index.d.ts +3 -0
  43. package/lib/types/source-view/hex.d.ts +7 -13
  44. package/lib/types/style-classes.spec.d.ts +11 -0
  45. package/lib/types/styles.generated.d.ts +1 -1
  46. package/package.json +18 -7
  47. package/scss/_about_dialog.scss +3 -2
  48. package/scss/_action_row.scss +33 -0
  49. package/scss/_avatar.scss +12 -0
  50. package/scss/_button.scss +44 -22
  51. package/scss/_card.scss +11 -8
  52. package/scss/_checks.scss +2 -4
  53. package/scss/_dialog.scss +3 -2
  54. package/scss/_headerbar.scss +23 -0
  55. package/scss/_popover.scss +8 -4
  56. package/scss/_preferences.scss +7 -7
  57. package/scss/_progress_bar.scss +9 -6
  58. package/scss/_reset.scss +1 -1
  59. package/scss/_shortcut_label.scss +80 -0
  60. package/scss/_sidebar.scss +57 -0
  61. package/scss/_status_page.scss +20 -0
  62. package/scss/_style_classes.scss +407 -0
  63. package/scss/_switch.scss +4 -3
  64. package/scss/_theme.scss +20 -2
  65. package/scss/_variables.scss +34 -1
  66. package/scss/adwaita-skin.scss +12 -0
  67. package/src/accent.ts +74 -0
  68. package/src/adw-about-dialog.spec.ts +34 -49
  69. package/src/adw-accent.spec.ts +105 -0
  70. package/src/adw-action-rows.spec.ts +25 -33
  71. package/src/adw-avatar.spec.ts +51 -20
  72. package/src/adw-banner.spec.ts +5 -8
  73. package/src/adw-button-content.spec.ts +9 -12
  74. package/src/adw-button-row.spec.ts +2 -4
  75. package/src/adw-carousel.spec.ts +40 -53
  76. package/src/adw-checks.spec.ts +36 -47
  77. package/src/adw-drop-down.spec.ts +25 -32
  78. package/src/adw-header-bar.spec.ts +5 -7
  79. package/src/adw-icon.spec.ts +23 -32
  80. package/src/adw-progress-bar.spec.ts +10 -12
  81. package/src/adw-row-state.spec.ts +9 -10
  82. package/src/adw-shortcut-label.spec.ts +112 -0
  83. package/src/adw-sidebar.spec.ts +17 -24
  84. package/src/adw-switch.spec.ts +11 -17
  85. package/src/adw-tab-view.spec.ts +7 -10
  86. package/src/adw-toast-overlay.spec.ts +7 -11
  87. package/src/adw-view-switcher-bar.spec.ts +10 -14
  88. package/src/adw-wrap-box.spec.ts +25 -36
  89. package/src/bottom-sheet.spec.ts +30 -36
  90. package/src/breakpoints.ts +15 -18
  91. package/src/chrome.spec.ts +13 -21
  92. package/src/elements/adw-about-dialog.ts +71 -114
  93. package/src/elements/adw-action-row.ts +22 -37
  94. package/src/elements/adw-alert-dialog.ts +25 -50
  95. package/src/elements/adw-avatar.ts +40 -15
  96. package/src/elements/adw-banner.ts +14 -18
  97. package/src/elements/adw-bottom-sheet.ts +31 -52
  98. package/src/elements/adw-button-content.ts +30 -37
  99. package/src/elements/adw-button-row.ts +14 -24
  100. package/src/elements/adw-carousel.ts +87 -148
  101. package/src/elements/adw-checks.ts +43 -56
  102. package/src/elements/adw-clamp.ts +8 -9
  103. package/src/elements/adw-combo-row.ts +17 -25
  104. package/src/elements/adw-data-grid.ts +26 -38
  105. package/src/elements/adw-dialog.ts +25 -56
  106. package/src/elements/adw-drop-down.ts +31 -51
  107. package/src/elements/adw-entry-row.ts +39 -46
  108. package/src/elements/adw-expander-row.ts +30 -53
  109. package/src/elements/adw-icon.ts +30 -53
  110. package/src/elements/adw-inline-view-switcher.ts +38 -67
  111. package/src/elements/adw-menu-button.ts +28 -58
  112. package/src/elements/adw-navigation-split-view.ts +35 -47
  113. package/src/elements/adw-navigation-view.ts +12 -28
  114. package/src/elements/adw-overlay-split-view.ts +100 -175
  115. package/src/elements/adw-password-entry-row.ts +18 -28
  116. package/src/elements/adw-popover.ts +28 -44
  117. package/src/elements/adw-preferences-dialog.ts +41 -66
  118. package/src/elements/adw-preferences-group.ts +33 -46
  119. package/src/elements/adw-progress-bar.ts +27 -47
  120. package/src/elements/adw-shortcut-label.ts +138 -0
  121. package/src/elements/adw-sidebar.ts +31 -39
  122. package/src/elements/adw-spin-row.ts +7 -14
  123. package/src/elements/adw-spinner.ts +31 -43
  124. package/src/elements/adw-split-button.ts +45 -75
  125. package/src/elements/adw-switch-row.ts +29 -46
  126. package/src/elements/adw-switch.ts +28 -47
  127. package/src/elements/adw-tab-view.ts +62 -103
  128. package/src/elements/adw-toast-overlay.ts +28 -35
  129. package/src/elements/adw-toggle-group.ts +9 -16
  130. package/src/elements/adw-view-stack.ts +32 -51
  131. package/src/elements/adw-view-switcher-bar.ts +26 -50
  132. package/src/elements/adw-view-switcher.ts +60 -110
  133. package/src/elements/adw-window-title.ts +4 -4
  134. package/src/elements/adw-wrap-box.ts +33 -59
  135. package/src/elements/view-switcher-dom.ts +15 -22
  136. package/src/entry-rows.spec.ts +18 -24
  137. package/src/index.ts +24 -15
  138. package/src/navigation-view.spec.ts +7 -10
  139. package/src/preferences-search.ts +11 -15
  140. package/src/preferences.spec.ts +13 -15
  141. package/src/source-view/adw-source-view.ts +6 -19
  142. package/src/source-view/hex.ts +7 -13
  143. package/src/split-button.spec.ts +32 -44
  144. package/src/split-views.spec.ts +83 -149
  145. package/src/style-classes.spec.ts +181 -0
  146. package/src/style-isolation.spec.ts +3 -6
  147. package/src/styles.generated.ts +1 -1
  148. package/src/tab-view.spec.ts +26 -35
  149. package/src/test.browser.mts +6 -0
  150. package/src/view-stack.spec.ts +23 -34
  151. package/src/view-switcher.spec.ts +56 -84
@@ -2,18 +2,15 @@
2
2
  // the core suite and the NativeScript renderer assert against
3
3
  // (`@gjsify/adwaita-core/conformance`).
4
4
  //
5
- // `Adw.BottomSheet` has four dismissal paths and they are four different gates.
6
- // This element used to route all of them through one `_attemptClose()`, which
7
- // meant: the drag handle closed the sheet (in libadwaita it is `can_target =
8
- // FALSE` and closes nothing), Escape on a closed-but-focused sheet did nothing
9
- // (libadwaita still signals `close-attempt`), and the `sheet.close` action on an
10
- // already-closed sheet did nothing (libadwaita forwards it to the parent).
11
- // Nothing failed, because nothing compared the element to the C source.
5
+ // `Adw.BottomSheet` has four dismissal paths and they are four DIFFERENT gates, so one
6
+ // shared `_attemptClose()` cannot express them: the drag handle is `can_target = FALSE`
7
+ // and closes nothing; Escape on a closed-but-focused sheet still signals
8
+ // `close-attempt`; and the `sheet.close` action on an already-closed sheet forwards to
9
+ // the parent.
12
10
  //
13
- // Two element-local bugs are pinned here too, both from the same root cause —
14
- // the open STATE used to be read off the attribute rather than held:
15
- // `open="false"` rendered OPEN, and re-spelling the attribute fired a
16
- // `notify::open` carrying an unchanged payload.
11
+ // The open STATE must be HELD, not read back off the attribute — reading it made
12
+ // `open="false"` render OPEN and let a re-spelt attribute fire a `notify::open` with an
13
+ // unchanged payload.
17
14
  import { describe, expect, it } from '@gjsify/unit';
18
15
 
19
16
  import type { AdwBottomSheet } from './elements/adw-bottom-sheet.js';
@@ -75,8 +72,8 @@ export const AdwBottomSheetTest = async () => {
75
72
  });
76
73
 
77
74
  expect(returned).toBe(outcome);
78
- // The verdict must be VISIBLE, not just returned: a renderer that
79
- // returns the right word and closes anyway is still wrong.
75
+ // The verdict must be VISIBLE, not just returned: returning the right word
76
+ // and closing anyway is still wrong.
80
77
  expect(sheet.open).toBe(outcome === 'close' ? false : open);
81
78
  expect(attempts).toBe(outcome === 'close-attempt' ? 1 : 0);
82
79
  expect(delegated).toBe(outcome === 'delegate' ? 1 : 0);
@@ -120,9 +117,9 @@ export const AdwBottomSheetTest = async () => {
120
117
 
121
118
  await describe('adw-bottom-sheet open attribute semantics', async () => {
122
119
  await it('open="false" renders CLOSED', () => {
123
- // The getter used to be `hasAttribute('open')` while every other
124
- // boolean used `!== 'false'`, so one element carried two conventions.
125
- // adw-bottom-sheet.c:1670 — `open = !!open` on a strict gboolean.
120
+ // `hasAttribute('open')` for the getter while every other boolean uses
121
+ // `!== 'false'` gives one element two conventions.
122
+ // adw-bottom-sheet.c — `open = !!open` on a strict gboolean.
126
123
  const sheet = document.createElement('adw-bottom-sheet') as AdwBottomSheet;
127
124
  sheet.setAttribute('open', 'false');
128
125
  document.body.appendChild(sheet);
@@ -141,10 +138,9 @@ export const AdwBottomSheetTest = async () => {
141
138
  });
142
139
 
143
140
  await it('re-spelling the attribute fires no spurious notify::open', () => {
144
- // The old callback guarded only `oldValue === newValue` and then
145
- // dispatched unconditionally, so `open=""` → `open="open"` fired a
146
- // second notification carrying an UNCHANGED payload.
147
- // adw-bottom-sheet.c:1672-1682 returns before notifying.
141
+ // Guarding only on `oldValue === newValue` lets `open=""` → `open="open"` fire
142
+ // a second notification carrying an UNCHANGED payload.
143
+ // adw-bottom-sheet.c returns before notifying.
148
144
  const sheet = mountSheet();
149
145
  const payloads: boolean[] = [];
150
146
  sheet.addEventListener('notify::open', (event) => {
@@ -170,9 +166,8 @@ export const AdwBottomSheetTest = async () => {
170
166
 
171
167
  await describe('adw-bottom-sheet affordances', async () => {
172
168
  await it('the drag handle is decorative — not focusable, not a button, closes nothing', () => {
173
- // gtk_widget_set_can_focus/can_target (self->drag_handle, FALSE)
174
- // — adw-bottom-sheet.c:1197-1198. This element used to give it
175
- // role="button", tabindex=0 and a click-to-close handler.
169
+ // `gtk_widget_set_can_focus/can_target (self->drag_handle, FALSE)` — so no
170
+ // role="button", no tabindex=0 and no click-to-close handler.
176
171
  const sheet = mountSheet();
177
172
  sheet.open = true;
178
173
  const handle = dragHandle(sheet);
@@ -207,8 +202,8 @@ export const AdwBottomSheetTest = async () => {
207
202
  });
208
203
 
209
204
  await it('a dimming click on a CLOSED sheet does nothing and signals nothing', () => {
210
- // The scrim is `can_target = open` (adw-bottom-sheet.c:1692), so it
211
- // is not reachable at all — unlike Escape, it does not signal.
205
+ // The scrim is `can_target = open`, so it is not reachable at all — unlike
206
+ // Escape, it does not signal.
212
207
  const sheet = mountSheet();
213
208
  sheet.canClose = false;
214
209
  const { attempts } = recordSignals(sheet, () => {
@@ -228,10 +223,9 @@ export const AdwBottomSheetTest = async () => {
228
223
  });
229
224
 
230
225
  await it('Escape on a CLOSED but focused sheet still raises close-attempt', () => {
231
- // maybe_close_cb's emit is the fallthrough for every case that is not
232
- // (can_close && open) — adw-bottom-sheet.c:393-399. This element
233
- // guarded it away twice (once in the key handler, once in
234
- // `_attemptClose`), so the corner was unreachable.
226
+ // `maybe_close_cb`'s emit is the fallthrough for every case that is NOT
227
+ // (can_close && open); guarding it away in the key handler and in
228
+ // `_attemptClose` makes the corner unreachable.
235
229
  const sheet = mountSheet();
236
230
  const { attempts } = recordSignals(sheet, () => {
237
231
  insideSheet(sheet).dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', bubbles: true }));
@@ -254,9 +248,9 @@ export const AdwBottomSheetTest = async () => {
254
248
  });
255
249
 
256
250
  await it('sheet.close on an already-closed sheet delegates upward', () => {
257
- // sheet_close_cb activates the PARENT's `sheet.close` action instead
258
- // of doing nothing — adw-bottom-sheet.c:382-385. A bubbling event is
259
- // the DOM equivalent, so an enclosing sheet/dialog can act on it.
251
+ // `sheet_close_cb` activates the PARENT's `sheet.close` action rather than
252
+ // doing nothing; a bubbling event is the DOM equivalent, so an enclosing
253
+ // sheet or dialog can act on it.
260
254
  const sheet = mountSheet();
261
255
  const host = sheet.parentElement as HTMLElement;
262
256
  let seenOnAncestor = 0;
@@ -278,10 +272,10 @@ export const AdwBottomSheetTest = async () => {
278
272
  });
279
273
 
280
274
  await it('consumes the slot wrappers instead of leaving them in the content', () => {
281
- // `<child type="sheet">` is GtkBuilder markup — nothing of it survives
282
- // into the widget tree (adw-bottom-sheet.c:1278-1293). The emptied
283
- // <adw-bottom-sheet-sheet> / <adw-bottom-sheet-content> wrappers used
284
- // to fall through to `unslotted` and land in the content layer.
275
+ // `<child type="sheet">` is GtkBuilder markup and nothing of it survives into
276
+ // the widget tree, so the emptied <adw-bottom-sheet-sheet> /
277
+ // <adw-bottom-sheet-content> wrappers must not fall through to `unslotted` and
278
+ // land in the content layer.
285
279
  const sheet = mountSheet();
286
280
  const content = sheet.querySelector('.adw-bottom-sheet-content') as HTMLElement;
287
281
  expect(Array.from(content.children).map((el) => el.tagName.toLowerCase())).toStrictEqual(['button']);
@@ -8,10 +8,9 @@
8
8
  // `ResizeObserver` — which this module supplies under the same name, so the two
9
9
  // ports read alike.
10
10
  //
11
- // Until this existed, `adwaita-web` was the only one of the three renderers with
12
- // no size source at all: `<adw-navigation-split-view collapsed>` was a manual
13
- // attribute the application had to flip itself, so the same markup that adapts
14
- // on GTK and on NativeScript stayed frozen in one layout in the browser.
11
+ // Without a size source `<adw-navigation-split-view collapsed>` is a manual attribute the
12
+ // application has to flip itself, and markup that adapts on GTK and on NativeScript stays
13
+ // frozen in one layout in the browser.
15
14
  //
16
15
  // Reference: refs/libadwaita/src/adw-breakpoint.c
17
16
  // Copyright (c) GNOME contributors (libadwaita). LGPLv2.1+.
@@ -21,19 +20,17 @@ import { AdwBreakpoint } from '@gjsify/adwaita-core';
21
20
  /**
22
21
  * Drive `breakpoints` from `element`'s own box, and return a dispose function.
23
22
  *
24
- * `ResizeObserver` delivers an initial observation on `observe()`, so the
25
- * breakpoints settle on the correct state before first paint — no flash of the
26
- * wrong layout, and no separate seeding pass.
27
- *
28
- * The size read is the BORDER box in CSS pixels, the browser's counterpart to
29
- * the `sp`/DIP units an Adwaita condition is written in.
23
+ * `ResizeObserver` delivers an initial observation on `observe()`, so the breakpoints
24
+ * settle on the correct state before first paint — no flash of the wrong layout, no
25
+ * separate seeding pass. The size read is the BORDER box in CSS pixels, the browser's
26
+ * counterpart to the `sp`/DIP units an Adwaita condition is written in.
30
27
  */
31
28
  export function addBreakpoints(element: Element, breakpoints: readonly AdwBreakpoint[]): () => void {
32
29
  const observer = new ResizeObserver((entries) => {
33
30
  const entry = entries[entries.length - 1];
34
31
  if (!entry) return;
35
- // borderBoxSize is the spec'd path; contentRect is the fallback for the
36
- // shape older engines report.
32
+ // borderBoxSize is the spec'd path; contentRect is the fallback for the shape older
33
+ // engines report.
37
34
  const box = entry.borderBoxSize?.[0];
38
35
  const size = box
39
36
  ? { width: box.inlineSize, height: box.blockSize }
@@ -45,13 +42,13 @@ export function addBreakpoints(element: Element, breakpoints: readonly AdwBreakp
45
42
  }
46
43
 
47
44
  /**
48
- * Wire a `breakpoint="<condition>"` attribute to a boolean setter, the browser
49
- * equivalent of an `Adw.Breakpoint` with one `add_setter()` call.
45
+ * Wire a `breakpoint="<condition>"` attribute to a boolean setter, the browser equivalent
46
+ * of an `Adw.Breakpoint` with one `add_setter()` call. Returns a dispose function; call it
47
+ * before re-binding and on disconnect.
50
48
  *
51
- * Returns a dispose function; call it before re-binding and on disconnect.
52
- * A missing or unparsable condition binds nothing and returns a no-op, leaving
53
- * whatever the attribute already says untouched — an element must not silently
54
- * flip state because its condition had a typo.
49
+ * A missing or unparsable condition binds nothing and returns a no-op, leaving whatever
50
+ * the attribute already says untouched — an element must not silently flip state because
51
+ * its condition had a typo.
55
52
  */
56
53
  export function bindBreakpointSetter(
57
54
  element: Element,
@@ -2,16 +2,12 @@
2
2
  // <adw-spinner> and <adw-toolbar-view> — driven by the SAME vectors the
3
3
  // NativeScript renderer asserts against (`@gjsify/adwaita-core/conformance`).
4
4
  //
5
- // Each of the three used to answer a question libadwaita had already answered,
6
- // and answered it differently from the NativeScript port: the clamp was a plain
7
- // `max-width` with no tightening and a `maximum-size="0"` that collapsed the
8
- // child to nothing, the spinner defaulted to 24px and stroked a 2px ring where
9
- // Adwaita strokes 3px, and the toolbar view carried none of the four style
10
- // classes at all. Nothing failed, because nothing compared them.
5
+ // Each of the three answered a question libadwaita had already answered, and answered it
6
+ // differently from the NativeScript port: clamp tightening and `maximum-size="0"`, the
7
+ // spinner's default size and 3px stroke, and the toolbar view's four style classes.
11
8
  //
12
- // Sizes are driven by really resizing a host element and awaiting a real
13
- // ResizeObserver delivery, the same way `breakpoints.spec.ts` does — never by
14
- // faking one.
9
+ // Sizes are driven by really resizing a host element and awaiting a real ResizeObserver
10
+ // delivery, as `breakpoints.spec.ts` does — never by faking one.
15
11
  import { describe, expect, it } from '@gjsify/unit';
16
12
 
17
13
  import { ADW_SPINNER_MIN_SIZE, ADW_SPINNER_TRACK_OPACITY, spinnerGeometry } from '@gjsify/adwaita-core';
@@ -54,8 +50,8 @@ function mountClamp(available: number): {
54
50
  const { host, resize } = mountSized(available);
55
51
  const clamp = document.createElement('adw-clamp');
56
52
  const child = document.createElement('div');
57
- // A bare block child fills the clamp and is capped by the max-width the
58
- // element writes — the same shape every story uses.
53
+ // A bare block child fills the clamp and is capped by the max-width the element
54
+ // writes — the shape every story uses.
59
55
  child.textContent = 'clamped';
60
56
  clamp.appendChild(child);
61
57
  host.appendChild(clamp);
@@ -96,9 +92,8 @@ function mountToolbarView(topBarHeight: number, bottomBarHeight: number): { host
96
92
 
97
93
  export const AdwChromeTest = async () => {
98
94
  await describe('adw-clamp allocation (AdwClampLayout conformance vectors)', async () => {
99
- // The browser resolves the child's own minimum through the normal
100
- // `min-width` cascade, so only the rows that pass a zero child minimum
101
- // describe what this element can be held to.
95
+ // The browser resolves the child's own minimum through the normal `min-width`
96
+ // cascade, so only rows with a zero child minimum describe this element.
102
97
  const vectors = CLAMP_ALLOCATE_VECTORS.filter((v) => v.params.childMin === 0);
103
98
 
104
99
  for (const { availableSize, params, childSize, sizeClass, offset, rule } of vectors) {
@@ -110,7 +105,7 @@ export const AdwChromeTest = async () => {
110
105
 
111
106
  expect(clampedWidth(child)).toBe(childSize);
112
107
  expect(sizeClassOf(child)).toBe(sizeClass);
113
- // `margin-inline: auto` splits the remainder evenly; libadwaita
108
+ // `margin-inline: auto` splits the remainder evenly where libadwaita
114
109
  // truncates, so the two can differ by half a pixel.
115
110
  const leading = child.getBoundingClientRect().left - clamp.getBoundingClientRect().left;
116
111
  expect(Math.abs(leading - offset) <= 1).toBe(true);
@@ -120,8 +115,7 @@ export const AdwChromeTest = async () => {
120
115
  }
121
116
 
122
117
  await it('follows the viewport instead of pinning the child to the maximum', async () => {
123
- // The NativeScript twin's bug in browser form: a narrow clamp must
124
- // hand the child ALL of the available width, not the cap.
118
+ // A narrow clamp hands the child ALL of the available width, not the cap.
125
119
  const { host, clamp, child, resize } = mountClamp(1000);
126
120
  await settle();
127
121
  expect(clampedWidth(child)).toBe(600);
@@ -132,8 +126,6 @@ export const AdwChromeTest = async () => {
132
126
  });
133
127
 
134
128
  await it('honours tightening-threshold, which the element used to ignore', async () => {
135
- // The storybook has exposed this control all along and only the GTK
136
- // pane responded to it.
137
129
  const { host, clamp, child } = mountClamp(700);
138
130
  clamp.setAttribute('maximum-size', '600');
139
131
  clamp.setAttribute('tightening-threshold', '400');
@@ -323,7 +315,7 @@ export const AdwChromeTest = async () => {
323
315
 
324
316
  await it('KEEPS SPINNING under reduced motion — a frozen busy indicator reads as a hang', () => {
325
317
  // libadwaita opts the spinner out of the animation setting on purpose
326
- // (adw-spinner-paintable.c:537). The old stylesheet had
318
+ //. The old stylesheet had
327
319
  // `@media (prefers-reduced-motion: reduce) { animation: none }`, so
328
320
  // this asserts the ABSENCE of any CSS animation to switch off: the
329
321
  // arc is driven per frame from JS and cannot be disabled by a query.
@@ -345,7 +337,7 @@ export const AdwChromeTest = async () => {
345
337
  expect(arc.getAttribute('stroke-dashoffset')).not.toBe(first);
346
338
 
347
339
  // Unmapping removes it from the shared ticker — `widget_map_cb`
348
- // (adw-spinner-paintable.c:181-185) is what plays the animation, so
340
+ // is what plays the animation, so
349
341
  // an off-screen spinner burns nothing.
350
342
  spinner.remove();
351
343
  const parked = arc.getAttribute('stroke-dashoffset');