@onekeyfe/react-native-native-list 6.7.0-alpha.475 → 6.8.0-11

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 (54) hide show
  1. package/README.md +312 -379
  2. package/android/src/main/java/com/onekey/nativelist/NativeListActivityDetailsView.kt +15 -6
  3. package/android/src/main/java/com/onekey/nativelist/NativeListIdentityRenderer.kt +3 -87
  4. package/android/src/main/java/com/onekey/nativelist/NativeListMediaPlaceholderView.kt +244 -0
  5. package/android/src/main/java/com/onekey/nativelist/NativeListMediaTileRenderer.kt +32 -11
  6. package/android/src/main/java/com/onekey/nativelist/NativeListModels.kt +60 -0
  7. package/android/src/main/java/com/onekey/nativelist/NativeListPrimitives.kt +3 -6
  8. package/android/src/main/java/com/onekey/nativelist/NativeListResolvedText.kt +5 -1
  9. package/android/src/main/java/com/onekey/nativelist/NativeListTextView.kt +75 -0
  10. package/android/src/main/java/com/onekey/nativelist/NativeListView.kt +25 -19
  11. package/android/src/test/java/com/margelo/nitro/nativelist/NativeListDescriptionTouchPolicyTest.kt +153 -0
  12. package/docs/ROW_TEMPLATES.md +12 -12
  13. package/docs/SPEC.md +226 -110
  14. package/docs/STYLE_SPEC.md +7 -0
  15. package/ios/NativeListActivityDetailsView.swift +13 -5
  16. package/ios/NativeListIdentityRenderer.swift +6 -94
  17. package/ios/NativeListMediaPlaceholderView.swift +189 -0
  18. package/ios/NativeListMediaTileRenderer.swift +13 -13
  19. package/ios/NativeListResolvedText.swift +15 -4
  20. package/ios/NativeListTextLabel.swift +106 -0
  21. package/ios/RNCNativeListView.swift +129 -32
  22. package/ios/tests/NativeListActivityPresentationTests.swift +270 -0
  23. package/ios/tests/NativeListIdentityTitleIconLayoutTests.swift +0 -95
  24. package/ios/tests/NativeListLifecycleTests.swift +369 -40
  25. package/ios/tests/NativeListMediaVisibilityTests.swift +16 -7
  26. package/lib/module/NativeList.js +17 -4
  27. package/lib/module/NativeList.web.js +3 -1
  28. package/lib/module/models.js +0 -2
  29. package/lib/module/validation.js +54 -71
  30. package/lib/module/web/NativeListGeneratedIcons.js +1 -0
  31. package/lib/module/web/NativeListWebEngine.js +13 -11
  32. package/lib/module/web/templates/ActivityRowRenderer.js +29 -23
  33. package/lib/module/web/templates/DataRowRenderer.js +54 -1
  34. package/lib/module/web/templates/IdentityRowRenderer.js +3 -92
  35. package/lib/module/web/templates/MediaTileRowRenderer.js +84 -15
  36. package/lib/typescript/src/models.d.ts +19 -22
  37. package/package.json +1 -1
  38. package/scripts/generate-icons.test.mjs +1 -0
  39. package/scripts/native-list-icons.json +1 -1
  40. package/src/NativeList.tsx +25 -4
  41. package/src/NativeList.web.tsx +1 -1
  42. package/src/models.ts +18 -23
  43. package/src/validation.ts +89 -113
  44. package/src/web/NativeListGeneratedIcons.ts +1 -0
  45. package/src/web/NativeListWebEngine.ts +16 -11
  46. package/src/web/templates/ActivityRowRenderer.ts +42 -32
  47. package/src/web/templates/DataRowRenderer.ts +76 -1
  48. package/src/web/templates/IdentityRowRenderer.ts +3 -141
  49. package/src/web/templates/MediaTileRowRenderer.ts +90 -15
  50. package/android/src/main/java/com/onekey/nativelist/NativeListTitleSegmentLayout.kt +0 -49
  51. package/android/src/main/java/com/onekey/nativelist/NativeListTitleSegmentsView.kt +0 -105
  52. package/android/src/test/java/com/margelo/nitro/nativelist/NativeListTitleSegmentLayoutTest.kt +0 -80
  53. package/ios/NativeListTitleSegmentLayout.swift +0 -45
  54. package/ios/NativeListTitleSegmentsLabel.swift +0 -80
package/docs/SPEC.md CHANGED
@@ -71,15 +71,44 @@ prevention; there is no automatic fitting or shrinking pass.
71
71
 
72
72
  ## Public API and defaults
73
73
 
74
- ### Media failure placeholder — Implemented
75
-
76
- Native media-tile failures use the current theme's `disabledText` color for the
77
- existing local `ImageSquareWavesOutline` icon, including explicit `imageState:
78
- 'error'` and exhausted media probes. A theme rebind updates that tint. Image
79
- content and SVG decoding remain owned by OneKeyImage; no per-cell WebView or
80
- fallback network source is added.
81
- Full-wallet dark/light placeholder acceptance remains a runtime check; source
82
- completion does not establish that visual result.
74
+ ### Media loading and failure placeholders — Implemented
75
+
76
+ Gallery media tiles draw one placeholder layer over the media slot on iOS
77
+ (`NativeListMediaPlaceholderView.swift`), Android
78
+ (`NativeListMediaPlaceholderView.kt`) and Web (`MediaTileRowRenderer.ts`). All
79
+ three share one geometry so the states read the same everywhere:
80
+
81
+ - **Loading** — from bind until the first candidate loads or every candidate
82
+ fails. Fill: `strongBackground`. A sheen band 60% of the tile wide, skewed
83
+ -12°, sweeps left to right over 1.6s (70% travel with `cubic-bezier(0.4, 0,
84
+ 0.2, 1)`, 30% rest). Every tile derives its phase from one shared clock
85
+ (`CACurrentMediaTime` / `SystemClock.uptimeMillis` / `performance.now`), so a
86
+ grid sweeps in step, recycled cells included. The sheen is white at 75% on a
87
+ light `rowBackground` (Web: `background`) and 7% on a dark one. Reduced
88
+ motion (iOS Reduce Motion, Android animator scale 0, Web
89
+ `prefers-reduced-motion`) holds the band still at 60% strength.
90
+ - **Failed** — explicit `imageState: 'error'` or exhausted probes. Fill:
91
+ `strongBackground`, plus 1pt `primaryText` lines at 4.5% alpha along 135°,
92
+ 7pt apart, masked by a radial gradient that is clear inside 22% of the
93
+ half-diagonal and opaque from 70%. No text is shown, so there is no copy to
94
+ localize.
95
+ - **Loaded / empty** — the placeholder is hidden; `imageState: 'empty'`
96
+ without a source keeps the slot transparent as before.
97
+
98
+ Both visible states draw a 24-unit glyph at 28% of the tile width, capped at
99
+ 44pt, stroked 1.5 units in `disabledText` at 70% of its alpha: a rounded frame
100
+ (3,3,18,18, r4), a sun (9,9 r1.6) and a ridge (5,20.5 → 14.5,11 → 21,17.5).
101
+ The failed glyph adds a slash (3,3 → 21,21) and cuts a 1.6-unit gap into the
102
+ frame on both sides of it. A 1px `separator` hairline at 60% of its alpha
103
+ outlines the slot in both states.
104
+
105
+ The placeholder owns the slot fill while visible. On Android the media view
106
+ is made invisible in the failed state, because OneKeyImage may paint its own
107
+ terminal state symbol after a probe advances. Image content and SVG decoding
108
+ remain owned by OneKeyImage; no per-cell WebView or fallback network source is
109
+ added. A theme rebind updates every color. Runtime acceptance (2026-11-10):
110
+ iOS dark and Android light on a watch-only wallet NFT grid, Web light/dark in
111
+ the standalone engine harness.
83
112
 
84
113
  ### Recipient identity and inline warning rows
85
114
 
@@ -152,10 +181,12 @@ ambiguous sources, invalid metadata and stale output. Stable sorting emits no
152
181
  machine paths or timestamps. Frozen tests compare exact registry key sets;
153
182
  this does not prove that every application-computed name is registered.
154
183
 
155
- The closed manifest contains 43 names with iOS 42, Android 41 and Web 25
184
+ The closed manifest contains 43 names with iOS 42, Android 41 and Web 26
156
185
  registry entries (including DotVerSolid). Document2Outline, WalletOutline and
157
186
  PlusLargeOutline are registered on all three platforms; TicketOutline also
158
- retains Web and adds native coverage. These main-line names use image-owned
187
+ retains Web and adds native coverage. InfoCircleOutline is registered on Web as
188
+ well as native, so a Web data-column `titleIcon` draws the host artwork rather
189
+ than the text glyph. These main-line names use image-owned
159
190
  canonical SVGs, not duplicate NativeList paths or asset catalogs.
160
191
  Existing Activity ten-name and Market/Media private call sites resolve canonical
161
192
  names through the same DOM helper; their previous coverage does not expand.
@@ -210,96 +241,6 @@ and Web acceptance must cover narrow addresses, dynamic type/fonts, long press
210
241
  versus tap, keyboard interaction, and the horizontal warning border. Source or
211
242
  build success alone is not runtime evidence.
212
243
 
213
- ### Identity title segments and leading title icon
214
-
215
- Status: implemented in source for iOS, Android and Web; device and Web runtime
216
- acceptance is pending. These fields travel in snapshot/patch JSON and do not
217
- change the Nitro ABI. They serve recipient rows whose title is a wallet and an
218
- account name in two styles, and address book rows marked by an icon before the
219
- name.
220
-
221
- `identity.titleSegments` is an optional list of 1...4 runs drawn on the title
222
- line in place of `title`:
223
-
224
- ```ts
225
- titleSegments?: readonly {
226
- text: string;
227
- tone?: 'primary' | 'secondary';
228
- fontWeight?: 'regular' | 'medium';
229
- shrink?: boolean;
230
- maxWidthRatio?: number; // (0, 1]
231
- }[];
232
- ```
233
-
234
- - `title` stays required. It is the spoken label and the fallback text, so it
235
- carries the same words as the runs; every renderer exposes `title`, not the
236
- runs, to accessibility.
237
- - Each run uses the title's font family, size and line height, including
238
- `style.title` and the configured fonts. `tone` picks the primary or secondary
239
- text color and defaults to the title color; `fontWeight` picks the weight and
240
- defaults to the title weight.
241
- - The runs share one line. `titleLines` and `style.title.lines` do not apply
242
- to them; a row that draws `title` instead (it has `titleMatch`, or is a wallet
243
- sidebar row) keeps them for drawing and for measurement.
244
- - Layout. The runs take the whole width the title line leaves after the
245
- leading title icon and the title accessories (title icon, title image,
246
- suffixes, badges), so those accessories sit at the line's end rather than
247
- right after the text. W is that width:
248
- 1. A run's base width is its natural width, capped at `maxWidthRatio x W`
249
- when given. A run longer than its cap truncates at the cap with a tail
250
- ellipsis.
251
- 2. At most one run sets `shrink: true`. Every other run keeps its base width.
252
- 3. The shrinking run gets `min(base, W - sum of the other runs)` and
253
- truncates with a tail ellipsis; it may shrink to zero width.
254
- 4. When the runs that do not shrink exceed W on their own, the line is cut at
255
- its end. Native renderers end the last visible run with an ellipsis; Web
256
- clips it. This divergence is accepted: callers avoid the case with
257
- `maxWidthRatio`.
258
- - Development validation rejects an empty or oversized list, blank or
259
- oversized text (the 4096-code-unit text bound), unknown keys, tones or
260
- weights, a ratio outside `(0, 1]`, more than one shrinking run, `titleMatch`
261
- on the same row (its ranges index `title`), and
262
- `presentation: 'walletSidebar'`. Production treats the runs as decoration:
263
- an invalid list is dropped and the row shows `title`. Renderers draw `title`
264
- instead of runs on a row that also has `titleMatch`, and ignore runs and the
265
- leading icon with `presentation: 'walletSidebar'`.
266
-
267
- `identity.titleLeadingIcon` is an optional `{ name, tintColor?,
268
- accessibilityLabel? }`: a 16-point glyph before the title text or its runs,
269
- with a 6-point gap, vertically centered on the title line. It keeps its 16
270
- points: a long title, or its shrinking run, truncates first. The name comes from
271
- the same closed icon set as `titleIcon`; an unmapped name leaves an empty
272
- 16-point slot. `tintColor` is a hex `#RRGGBB` or `#RRGGBBAA` color and defaults
273
- to the theme's `iconSubdued`. Without `accessibilityLabel` the glyph is hidden
274
- from accessibility. It has no action of its own. Development validation
275
- rejects unknown keys, a blank name, a malformed color and
276
- `presentation: 'walletSidebar'`; production drops an invalid icon.
277
-
278
- Both fields are identity patch fields. Omission in a full snapshot removes
279
- them; omission in a patch keeps the current value. Rebind and recycle remove the
280
- previous runs and glyph, so a row without them never shows another row's.
281
-
282
- | Platform | Title runs | Leading icon |
283
- | --- | --- | --- |
284
- | iOS | `NativeListTitleSegmentsLabel` draws the runs at the widths that `NativeListTitleSegmentLayout.swift` allocates for its bounds; it fills the title row in place of the row's filler. | `NativeListIconImageView`, first in the title row stack. A plain title beside it drops below required horizontal compression resistance, as beside `titleIcon`, so the title truncates before the glyph narrows. |
285
- | Android | `NativeListTitleSegmentsView`, a `TextView` whose text is rebuilt for each measured width from `NativeListTitleSegmentLayout.kt` and which measures to the width it is offered. `PackedTitleLineLayout.titleChild` names the flexible title view, so a view may precede it. | `OneKeyIconView`, first in the title line. |
286
- | Web | A flex line that fills the title line: the shrinking run is `flex: 0 1 auto; min-width: 0`, the others `flex: 0 0 auto` with a `max-width` percentage for a cap. | An icon element before the title text. |
287
-
288
- Conformance: `src/validation.ts` (`assertTitleSegments`,
289
- `assertTitleLeadingIcon`, production sanitizing) with `validation.test.ts`;
290
- `src/web/templates/IdentityRowRenderer.ts` with `IdentityTitleRunsWeb.test.ts`
291
- (run styles, flex behavior, accessibility, rebind);
292
- `ios/NativeListTitleSegmentLayout.swift` (run widths, and when the runs and the
293
- glyph show) with the SwiftPM `NativeListTitleSegmentLayoutTests`; the iOS
294
- leading glyph beside a long plain title, wallet sidebar rows and the measured
295
- height of a highlighted title with the XCTest
296
- `NativeListIdentityTitleIconLayoutTests`; `NativeListTitleSegmentLayout.kt`
297
- with the JVM `NativeListTitleSegmentLayoutTest`. iOS, Android and Web runtime acceptance is pending: recipient rows
298
- with long wallet and account names in both truncation directions, narrow rows,
299
- dark mode, dynamic type and configured fonts, and recycling between rows with
300
- and without runs or a leading icon. Source and build success alone are not
301
- runtime evidence.
302
-
303
244
  ### DeFi position row controls
304
245
 
305
246
  Status: implemented in local source, unreleased. Focused validation and Web
@@ -612,6 +553,38 @@ image that already loaded. Common container styling clears what it wrote on the
612
553
  next bind, including properties it set on template children. UI mutation remains on the platform
613
554
  UI thread; [DESIGN.md](DESIGN.md) describes update and event ownership.
614
555
 
556
+ ### iOS cell requests during snapshot replacement
557
+
558
+ Status: implemented, unreleased. On iOS 17.5 and 26.0, a focused UIKit fixture
559
+ reproduced the assertion on version 6.7.0-62 and completed the same layout
560
+ with the fix. Three focused UIKit tests passed on both runtimes, including
561
+ fixed-footer action routing. Consuming-app acceptance of the fix remains
562
+ pending.
563
+
564
+ When a snapshot removes rows, UIKit may request cells from its outgoing
565
+ snapshot while the new logical rows are already active. The iOS host MUST
566
+ provide a valid reusable cell for such requests. Until UIKit completes the
567
+ removal, the host retains only the removed row descriptors needed for pending
568
+ snapshot applications. These descriptors are presentation-only and cannot
569
+ emit actions, expose accessibility elements, or become selectable. Repeated
570
+ updates must preserve the descriptors still needed by in-flight applications
571
+ and must release them on completion or host disposal. A request with no
572
+ available descriptor receives an inert empty cell. The accepted snapshot,
573
+ patch validation, row identity, and structural-transition behavior retain
574
+ their existing contracts.
575
+
576
+ The action and interaction restrictions apply to the presenting collection
577
+ row. Its top-level key determines whether its actions can be delivered,
578
+ including actions whose payload comes from a child renderer. The fixed footer
579
+ is a separate host and retains its normal interaction, even when it shares a
580
+ key with a retiring row.
581
+
582
+ Conformance scrolls an unmaterialized outgoing row into UIKit's viewport
583
+ during removal and checks its renderer, inert state, and the binding of the
584
+ first filtered row. It also covers fixed-footer actions with a shared key
585
+ during a structural transition. A separate consuming-app check covers address
586
+ input in the Send recipient picker.
587
+
615
588
  ### Android vertical-drag React touch cancellation
616
589
 
617
590
  Status: implemented; four real Android MotionEvent/JSTouchDispatcher regressions
@@ -722,6 +695,16 @@ An unrelated layout request MUST NOT indefinitely postpone command completion.
722
695
  Replacement, actual drag, detach and disposal invalidate old callbacks; a stale
723
696
  callback MUST NOT move the view or clear a newer command's barriers.
724
697
 
698
+ On iOS, the existing `scrollToOffset` implementation is also exposed to native
699
+ callers as `onekeyScrollToOffset:animated:`. BottomTabs discovers this selector
700
+ on the collection view's direct NativeList owner and requests offset zero for
701
+ standalone-list double-press scrolling. The call uses `requestScroll`, including
702
+ its explicit-scroll revision, structural-tail interruption, command notifications
703
+ and pending-layout ownership; external callers MUST NOT bypass it by writing
704
+ the internal collection view's offset. This adds no JavaScript/Nitro API.
705
+ BottomTabs and NativeList native sources must ship together. The native handoff
706
+ is source implemented; structural-transition runtime acceptance remains pending.
707
+
725
708
  A valid command can privately notify the owning Pager before execution, including
726
709
  a same-position no-op; this does not add a public NativeList API. A Pager-owned
727
710
  page-top or sticky-top command can privately cancel only its owned list's old
@@ -909,6 +892,19 @@ keep their existing layout and public interfaces.
909
892
 
910
893
  ### Android section-index attachment
911
894
 
895
+ The index rail and its letter preview MUST remain outside the view hierarchy
896
+ until the accepted configuration contains usable index entries. Disabling the
897
+ index or removing its last usable entry MUST detach both views, cancel the
898
+ preview interaction, and prevent a pending attachment callback from restoring
899
+ them. Restoring usable entries MUST reattach the same view instances without
900
+ duplicate parents. This attachment lifecycle is Android-specific; iOS and Web
901
+ keep their existing behavior.
902
+
903
+ The section-index letter preview is decorative. It MUST NOT participate in
904
+ React Native touch targeting while visible, fading, or invisible. Controls in
905
+ React container slots beneath its bounds MUST remain pressable; the index rail
906
+ continues to own index selection and scrubbing.
907
+
912
908
  When `sectionIndex.centeredInWindow` is enabled, the Android index rail moves
913
909
  between the list container and the window host as list visibility and attachment
914
910
  change. Before adding that same rail to its new parent, the previous parent MUST
@@ -1472,8 +1468,8 @@ There are no controls or video touch targets; the row owns press interaction.
1472
1468
  Android preserves a black letterbox and iOS a transparent one, matching the
1473
1469
  existing native Video views. No code calls play or requests audio focus.
1474
1470
 
1475
- A failed candidate advances once; exhaustion displays the existing error
1476
- placeholder. New source/row identity resets probing; binding, candidate and
1471
+ A failed candidate advances once; exhaustion displays the failed media
1472
+ placeholder (see Media loading and failure placeholders). New source/row identity resets probing; binding, candidate and
1477
1473
  player generations reject stale callbacks, including A→B→A. Text-only updates
1478
1474
  preserve the current request. On Android, terminal image/player completion is
1479
1475
  posted to the next UI queue turn before advancing probes or notifying the row;
@@ -1588,15 +1584,42 @@ width React lays it out at. Android's narrow-screen row scale and section-index
1588
1584
  apply to data rows only. Slot React trees own their internal layout and
1589
1585
  business actions; NativeList owns their scroll placement and lifecycle.
1590
1586
 
1591
- The wrapper mounts four non-collapsible slot roots and reports measured
1592
- heights through `containerSlotHeightsJson` in header/empty/footer/sidecar order.
1593
- The sidecar root has zero reserved height when absent. Native validates four
1594
- finite, non-negative heights. Slot updates MUST NOT alter data-row
1595
- keys or public row indices. No per-scroll-frame JS position updates are used.
1587
+ The wrapper mounts six non-collapsible slot roots and reports measured heights
1588
+ through `containerSlotHeightsJson` in header/empty/footer/sidecar/expanded/toggle
1589
+ order. The sidecar root has zero reserved height when absent. Native validates
1590
+ six finite, non-negative heights and still accepts legacy four-number arrays,
1591
+ except for the iOS pending-header state described below. Slot updates MUST NOT
1592
+ alter data-row keys or public row indices. No per-scroll-frame JS position updates are used.
1596
1593
  iOS mounts each slot root inside a list-owned host view in UICollectionView and
1597
1594
  reserves native layout space. The host owns the slot's vertical position and clips to
1598
1595
  the reported height, so React frame updates cannot move a slot out of place and a slot
1599
1596
  whose height has not been reported yet (or has just grown) never draws over rows.
1597
+
1598
+ iOS header first-frame measurement: when `listHeader` is present but
1599
+ its first layout has not arrived, the matching wrapper sends `null` for slot 0
1600
+ instead of an authoritative zero. The other five slot values remain finite,
1601
+ non-negative numbers; Android serialization stays unchanged. On iOS, an absent
1602
+ header always reports numeric zero. Each absent/present boundary replaces only
1603
+ the header slot root and starts a new measurement epoch; a layout callback from
1604
+ an earlier epoch MUST NOT make the current header ready. Replacing header content
1605
+ while it remains present does not start another epoch. A newly present header stays pending
1606
+ until its own layout reports a number, including zero.
1607
+ Before that measurement, the iOS host may reserve the current mounted header
1608
+ root's finite, non-negative `ceil(bounds.height)` when its bounds width is finite
1609
+ and positive. It applies that height to both clipping and row placement in the
1610
+ same native update, regardless of whether the root or pending heights arrive
1611
+ first. Without a valid current root, pending height is zero. Unmounting or
1612
+ recycling the root discards its provisional height; another root cannot inherit
1613
+ it. The first numeric measurement, including a genuine zero, is authoritative
1614
+ and retains ordinary dynamic growth and shrink behavior. Legacy four- and
1615
+ six-number arrays remain accepted. Only header slot 0 may be null, and the
1616
+ wrapper and native binary must match for this pending-header protocol.
1617
+ When the vertical iOS collection view first obtains positive bounds in
1618
+ `layoutSubviews`, it emits `OneKeyNativeScrollViewDidBecomeReady` before
1619
+ executing pending scroll requests or laying out container slots so an enclosing
1620
+ `CollapsiblePagerView` can synchronously attach and apply top insets, offset
1621
+ alignment, and sticky heights during the same layout pass.
1622
+
1600
1623
  Android uses ConcatAdapter with three single-item slot adapters around the existing
1601
1624
  data adapter; adapter binding indices stay local while layout-manager positions
1602
1625
  are explicitly translated. Slots span all grid columns, do not select/reorder,
@@ -1798,6 +1821,61 @@ tones. `descriptionActionKey` makes only the description emit that action with
1798
1821
  source `description`; footer actions retain their existing source/keys and
1799
1822
  disabled behavior. All actions use the current host binding epoch.
1800
1823
 
1824
+ Description action text. The action is hit on text only, never on the unused
1825
+ width of the description line, which belongs to the row press. Which text is
1826
+ stated by the caller in `descriptionActionStart`, a UTF-16 offset into
1827
+ `description` as supplied (JavaScript string index): the text from the offset on
1828
+ opens the action, the text before it is plain and belongs to the row press.
1829
+ NativeList never derives the offset from the displayed string, its separators or
1830
+ its wording; a caller that composes `prefix + label` records `prefix.length`.
1831
+
1832
+ - Absent means `0`: the whole description text is the action.
1833
+ `description.length` leaves no action text; the row then has no description
1834
+ action, and no button semantics, on any platform.
1835
+ - The field is ignored without `descriptionActionKey`.
1836
+ - Development validation rejects a value that is not a non-negative safe
1837
+ integer, and on a complete row (a snapshot row, or a row after a patch is
1838
+ merged) a value past `description.length`. Production drops a malformed value,
1839
+ which restores the default, and renderers clamp a value past the text to its
1840
+ end.
1841
+ - A patch that changes `description` without `descriptionActionStart` clears the
1842
+ stored offset, because it pointed into the previous string. Callers that keep
1843
+ a prefix restate the offset in the same patch.
1844
+ - iOS and Android map the offset onto the displayed text: a one-line description
1845
+ folds each line break into one space, so offsets after a CRLF move by one.
1846
+ - The hit area follows the laid-out text. iOS and Android build it from the
1847
+ layout engine's own rects for the action's character range (TextKit enclosing
1848
+ rects, the Android layout's selection), one per line and per visual run. A
1849
+ line that ends before the offset takes no touches, the line that holds it
1850
+ takes them from the offset on, later lines take them on their text. In
1851
+ mixed-direction text the action can be several runs on one line with plain
1852
+ text between them, and each run is its own region.
1853
+ - Touch slop reaches into blank space only. iOS and Android widen each run of
1854
+ action text by 8 units, and the widening stops at plain description text on
1855
+ the same line: text before the offset never opens the action, however narrow
1856
+ it is. iOS also extends the first and the last line of the whole layout by 6
1857
+ points away from the text, never a line in between, so the slop cannot reach
1858
+ into a line that holds only plain text. Android extends the first and last
1859
+ line of the layout to the view's top and bottom edge.
1860
+ - An ellipsis belongs to the action while action text is visible before it.
1861
+ Once truncation hides the action text altogether the ellipsis also stands for
1862
+ plain text, and the row has no hit area for the action.
1863
+ - Truncation. The description stays on its declared lines as `prefix + action`.
1864
+ On Web the prefix keeps its natural width and the action text truncates
1865
+ first, which matches the tail truncation of the native label. While action
1866
+ text follows, the Web prefix is capped at the row width less `3em` and
1867
+ truncates itself, so a prefix wider than the row cannot squeeze the action to
1868
+ nothing and leave it without a pointer target. iOS and Android draw one label
1869
+ and truncate its tail; they do not reserve room, so there a long prefix can
1870
+ push the action text out of view. The Web prefix and action are two elements
1871
+ side by side and each resolves its own text direction, so an offset inside a
1872
+ directional run draws that run in two parts; the action element is still
1873
+ exactly the action text.
1874
+ - Internally the native text view holds one optional start: none keeps the
1875
+ view's own hit testing (rows without the action), `0` limits touches to all of
1876
+ the text, a positive value to the text from there on. Binding, rebinding
1877
+ without the action and recycling set or clear that one value.
1878
+
1801
1879
  Rich rows measure the declared line/visual metrics; there is no six-line native
1802
1880
  truncation. iOS automatic height mirrors the rendered stacks: `lineGap` between the
1803
1881
  visible title/description/status lines, the description measured at the identity
@@ -2082,8 +2160,9 @@ imageState explicitly selects that state.
2082
2160
 
2083
2161
  Web gallery media preserves the consuming NFT card presentation: healthy image
2084
2162
  and exhausted fallback surfaces have a10px radius, while a healthy video surface
2085
- has square corners. The image/video frame uses the list page background; only
2086
- the exhausted fallback surface uses the strong background. Rebinding the same
2163
+ has square corners. The image/video frame uses the list page background; the
2164
+ loading and exhausted fallback surfaces use the strong background and the
2165
+ shared media placeholders. Rebinding the same
2087
2166
  video key retains square corners, and failed-video fallback to an image restores
2088
2167
  the image radius. This is Web renderer behavior; native media presentation and
2089
2168
  probe-order contracts are unchanged.
@@ -2345,12 +2424,49 @@ The same native display-link/animator tick changes suffix extent, footer positio
2345
2424
 
2346
2425
  Web/Desktop/extension prefix-preserving tail refinement status: source implemented; Web and Desktop consuming-app preview routes exercised with the local candidate Web overlay. Browser extension was outside that preview scope, and no FPS or paint-duration claim has been verified. The complete accepted snapshot becomes current immediately, while removed suffix rows may remain only in an inert, accessibility-hidden presentation window until the existing 220 ms transition completes. That window follows the same scroll owner and mounts only viewport-near old rows as the owner moves; each row keeps its natural height while the tail is clipped by the interpolated list extent. Inserted suffix rows use their final layout immediately and are revealed by the growing extent. The shared animation frame updates list height, React footer compensation, and programmatic scroll together. Its final scroll range uses the actual parent page extent, including a taller sidecar. For an off-screen fallback, Web uses the footer's complete visible interval where it fits, including the sticky inset, and otherwise aligns the footer start below the sticky region; the retained row is preferred only when the footer is absent. Price patches update the accepted snapshot and visible retained rows without restarting the transition. A newer structure command, unsupported shape, user scroll takeover, reduced motion, resize, or disposal releases presentation nodes and animation ownership without a stale completion writing an older offset. Other structural changes retain the existing behavior. This refinement adds no public field or native behavior; focused Web DOM tests passed, while browser extension and broader runtime performance remain unverified.
2347
2426
 
2427
+ ### Web token table geometry
2428
+
2429
+ Status: implemented with focused SDK regression coverage and consuming-App
2430
+ measurements from a local runtime overlay; formal SDK release integration is
2431
+ separate.
2432
+
2433
+ A Web `DataRow` with exactly the ordered column keys `asset`, `balance`, `price`,
2434
+ and `swapSpacer`, without an ordinal index, favorite control, or checkbox,
2435
+ preserves the legacy four equal columns. Rows with any of those controls retain
2436
+ their existing weighted layout so the controls keep their linear positions.
2437
+ The leading visual and its declared gap share the first column with the asset
2438
+ text; an absent visual reserves no icon inset. Balance and price occupy the
2439
+ second and third columns; the trailing accessories align to the end of the
2440
+ fourth. This closed migration shape uses equal columns instead of the
2441
+ previous weight approximation and removes the row's inherited 12px gap so
2442
+ each track occupies exactly one quarter of the padded content width. Other
2443
+ column shapes retain their existing weighted layout. Rebinding a retained row
2444
+ between these shapes clears the old grid placement, gap override, and asset
2445
+ inset, including when the leading visual is reused.
2446
+ Text, icon size, row height, actions, and iOS/Android layouts retain their
2447
+ existing contracts.
2448
+
2449
+ The Web `listStructureToggle` slot cancels the enclosing footer band's
2450
+ horizontal content inset while disclosure is present, since toggle content owns
2451
+ its page padding. The footer and expanded-content slots keep their existing
2452
+ insets. Changing the accepted content padding updates the compensation;
2453
+ removing disclosure still hides and disables the retained toggle subtree.
2454
+
2455
+ Conformance covers token-to-generic and generic-to-token row reuse, rows with an
2456
+ index/favorite/checkbox, leading visual and disabled action preservation,
2457
+ accepted padding changes, and absent disclosure. The consuming App comparison
2458
+ covers six visible rows and the toggle
2459
+ at 1024, 1280, and 1600 CSS-pixel viewports; it does not establish native runtime
2460
+ acceptance or a performance improvement.
2461
+
2348
2462
  `DataRow.trailing?: readonly TrailingAccessory[]` reuses the existing accessory action contract, including `rowKey`, `actionKey`, disabled state, and accessibility/test labels. At most two accessories are accepted. Desktop Home can render its independent price/balance columns with `DataRow.columns` and a Swap button in `trailing`. Existing rows without `trailing` retain their current layout. On iOS, trailing controls reserve their intrinsic width and the weighted columns fill the remaining row width. Changing between linear and table layout rebinds retained cells even when their row payload is unchanged.
2349
2463
 
2350
2464
  `DataColumn.textSegments` and `secondaryTextSegments` reuse `ValueTextSegment` (`text`, optional `style: 'subscript'`) for formatted prices, balances, and values in each independent table column. Plain `text` and `secondaryText` remain the spoken/fallback strings. Missing segments preserve existing rendering.
2351
2465
 
2352
2466
  `DataColumn.titleIcon` and `secondaryTitleIcon` reuse `IdentityRow.titleIcon` after the primary column text. They preserve native-asset and receipt-token symbols in the desktop asset column. Web `hoverActionKey` uses the same anchored help action as Identity rows; absent icons leave the existing column layout unchanged.
2353
2467
 
2468
+ `DataColumn.webLeadingBadge?: { text: string; textColor: string; backgroundColor: string }` is an optional Web-only passive label on the primary line, placed before `secondaryLeadingText` and the primary text. The caller supplies the visible text and both colors: `text` is non-blank and within the 4096-character text limit, both colors are required `#RRGGBB` or `#RRGGBBAA` values, and no other key is accepted. The label is a 12/16 regular pill (2 by 6 padding, radius 4) that receives no pointer events and has no action, hover target, tone or style slot. While it is present the primary line spans its column, keeps the column's start, center or end alignment and uses an 8-unit gap in place of `titleBadgeGap`. The label is capped at half of the column width, padding included, and truncates with an ellipsis at that cap; the primary text keeps the remaining width and truncates after it, so neither leaves the column. A label that fits is drawn at its intrinsic width. Row height and measurement do not change. Development validation rejects a malformed badge in a snapshot and in a row patch that replaces `columns`; production drops the badge, strips undeclared keys and keeps the row. iOS and Android ignore the field, so a caller that needs the same signal there uses `titleIcon`. A column without the field renders as before. `validation.test.ts` covers the validation rules and `DataRowWebParity.test.ts` the element order, declared layout styles and row reuse in jsdom, which performs no layout. A scoped Chrome 157 measurement of the compiled renderer with `WEB_LIST_CSS` used four-column table rows 1000, 560 and 420 CSS pixels wide, all three alignments and labels of 10, 15 and 63 characters: the label stayed inside its column at no more than half of its width and the primary value kept a visible width in every case, and a label that fits kept the geometry it had without the cap. This is not app-host runtime acceptance.
2469
+
2354
2470
  `IdentityRow.titleSuffixes?: readonly { text: string; tone: 'secondary' | 'disabled'; maxWidth?: number }[]` supports up to three plain 12/16 labels on the title line. Each suffix truncates independently at its optional maximum width. This preserves Recent recipient EVM, network, and relative-time metadata without using background badges; rows without suffixes keep their present title layout.
2355
2471
 
2356
2472
  ### Web slot-list scroll ownership
@@ -285,6 +285,10 @@ content; `lineGap` separates content text rows (primary/secondary per data colum
285
285
  for activity, the native failure label or rich title badges; Web has no activity
286
286
  badge target);
287
287
  `trailingGap` separates trailing values/controls (title/badge to status for rail).
288
+ For identity those are the trailing accessories: a `valuePair` is one accessory,
289
+ so the gap sits between it and its neighbours and never between its two lines,
290
+ on every platform. For activity the gap separates `primaryAmount` from
291
+ `secondaryAmount`.
288
292
  `walletGroup` padding applies only to the group; it never cascades into members.
289
293
  Composite metric-card `lineGap` separates heading/metric blocks and dividers; it
290
294
  does not change the typography or inner label/value gap of each metric.
@@ -535,6 +539,9 @@ defaults applied when `style` is absent.
535
539
  | image radius | 10 | 10 | dp(10) | 10px **=** |
536
540
  | tile radius | 16 | 16 | 16 | 16px **=** |
537
541
  | network badge | 14 | 14×14, r7 | dp(14), circle | 14px, r50% **=** |
542
+ | placeholder glyph | 28% of width, max 44 | CAShapeLayer | Canvas path | inline SVG **=** |
543
+ | loading sheen | 60% wide, -12°, 1.6s | CAKeyframeAnimation | `postInvalidateOnAnimation` | CSS keyframes **=** |
544
+ | failed hatch | 1 / 7, 135°, 4.5% | CAShapeLayer + radial mask | `saveLayer` + `DST_IN` | repeating gradient + mask **=** |
538
545
 
539
546
  ### metricCard
540
547
 
@@ -187,17 +187,24 @@ final class NativeListActivityDetailsView: UIStackView {
187
187
  weight: .medium, color: nativeListColor(theme, "primaryText", "#202020"), lineHeight: 24,
188
188
  lines: 1, fonts: fonts
189
189
  ).bind(title)
190
- NativeListResolvedText(data.string("description"), style: style.dictionary("description"), size: 14,
190
+ let descriptionText = NativeListResolvedText(data.string("description"), style: style.dictionary("description"), size: 14,
191
191
  color: nativeListColor(theme, "secondaryText", "#646464"), lineHeight: 20, lines: 2,
192
- fonts: fonts
193
- ).bind(descriptionLabel)
192
+ fonts: fonts)
193
+ descriptionText.bind(descriptionLabel)
194
194
  NativeListResolvedText(data.string("status"), style: style.dictionary("status"), size: 12,
195
195
  color: nativeListColor(theme, "secondaryText", "#646464"), lineHeight: 16, lines: 1,
196
196
  fonts: fonts
197
197
  ).bind(status)
198
198
  descriptionKey = data.string("descriptionActionKey")
199
- descriptionLabel.isUserInteractionEnabled = !descriptionKey.isEmpty
200
- descriptionLabel.accessibilityTraits = descriptionKey.isEmpty ? .staticText : .button
199
+ // The label spans the identity column, so with an action only its text
200
+ // from the caller's `descriptionActionStart` on takes touches. The start is
201
+ // never read out of the string, and one at the end leaves no action.
202
+ let actionStart = descriptionKey.isEmpty
203
+ ? nil : descriptionText.displayOffset(data.int("descriptionActionStart"), in: data.string("description"))
204
+ let hasActionText = actionStart.map { $0 < (descriptionText.text as NSString).length } ?? false
205
+ descriptionLabel.touchableTextStart = actionStart
206
+ descriptionLabel.isUserInteractionEnabled = hasActionText
207
+ descriptionLabel.accessibilityTraits = hasActionText ? .button : .staticText
201
208
  for badge in badgeViews { titleLine.removeArrangedSubview(badge); badge.removeFromSuperview() }
202
209
  badgeViews = data.dictionaries("badges").map { descriptor in
203
210
  let label = NativeListTextLabel()
@@ -269,6 +276,7 @@ final class NativeListActivityDetailsView: UIStackView {
269
276
  }
270
277
  func recycle() {
271
278
  visual.recycle(); visual.isHidden = false; amountViews.forEach { $0.recycle() }; actionKeys = []; descriptionKey = ""
279
+ descriptionLabel.touchableTextStart = nil
272
280
  }
273
281
  }
274
282