@onekeyfe/react-native-native-list 6.7.0-alpha.466 → 6.8.0-2

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 (42) 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/NativeListMediaPlaceholderView.kt +244 -0
  4. package/android/src/main/java/com/onekey/nativelist/NativeListMediaPreviewSlot.kt +66 -31
  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/NativeListResolvedText.kt +5 -1
  8. package/android/src/main/java/com/onekey/nativelist/NativeListTextView.kt +75 -0
  9. package/android/src/main/java/com/onekey/nativelist/NativeListView.kt +25 -19
  10. package/android/src/test/java/com/margelo/nitro/nativelist/NativeListDescriptionTouchPolicyTest.kt +153 -0
  11. package/docs/ROW_TEMPLATES.md +8 -3
  12. package/docs/SPEC.md +258 -18
  13. package/docs/STYLE_SPEC.md +12 -0
  14. package/ios/NativeListActivityDetailsView.swift +13 -5
  15. package/ios/NativeListMediaPlaceholderView.swift +189 -0
  16. package/ios/NativeListMediaPreviewSlot.swift +122 -61
  17. package/ios/NativeListMediaTileRenderer.swift +13 -13
  18. package/ios/NativeListResolvedText.swift +15 -4
  19. package/ios/NativeListTextLabel.swift +106 -0
  20. package/ios/RNCNativeListView.swift +50 -7
  21. package/ios/tests/NativeListActivityPresentationTests.swift +270 -0
  22. package/ios/tests/NativeListLifecycleTests.swift +176 -16
  23. package/ios/tests/NativeListMediaVisibilityTests.swift +41 -7
  24. package/lib/module/NativeList.js +17 -4
  25. package/lib/module/NativeList.web.js +3 -1
  26. package/lib/module/validation.js +19 -2
  27. package/lib/module/web/NativeListWebEngine.js +13 -11
  28. package/lib/module/web/templates/ActivityRowRenderer.js +29 -23
  29. package/lib/module/web/templates/DataRowRenderer.js +16 -0
  30. package/lib/module/web/templates/IdentityRowRenderer.js +3 -1
  31. package/lib/module/web/templates/MediaTileRowRenderer.js +84 -15
  32. package/lib/typescript/src/models.d.ts +9 -1
  33. package/package.json +1 -1
  34. package/src/NativeList.tsx +25 -4
  35. package/src/NativeList.web.tsx +1 -1
  36. package/src/models.ts +9 -0
  37. package/src/validation.ts +34 -0
  38. package/src/web/NativeListWebEngine.ts +16 -11
  39. package/src/web/templates/ActivityRowRenderer.ts +42 -32
  40. package/src/web/templates/DataRowRenderer.ts +28 -0
  41. package/src/web/templates/IdentityRowRenderer.ts +3 -3
  42. package/src/web/templates/MediaTileRowRenderer.ts +90 -15
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
 
@@ -632,6 +661,16 @@ An unrelated layout request MUST NOT indefinitely postpone command completion.
632
661
  Replacement, actual drag, detach and disposal invalidate old callbacks; a stale
633
662
  callback MUST NOT move the view or clear a newer command's barriers.
634
663
 
664
+ On iOS, the existing `scrollToOffset` implementation is also exposed to native
665
+ callers as `onekeyScrollToOffset:animated:`. BottomTabs discovers this selector
666
+ on the collection view's direct NativeList owner and requests offset zero for
667
+ standalone-list double-press scrolling. The call uses `requestScroll`, including
668
+ its explicit-scroll revision, structural-tail interruption, command notifications
669
+ and pending-layout ownership; external callers MUST NOT bypass it by writing
670
+ the internal collection view's offset. This adds no JavaScript/Nitro API.
671
+ BottomTabs and NativeList native sources must ship together. The native handoff
672
+ is source implemented; structural-transition runtime acceptance remains pending.
673
+
635
674
  A valid command can privately notify the owning Pager before execution, including
636
675
  a same-position no-op; this does not add a public NativeList API. A Pager-owned
637
676
  page-top or sticky-top command can privately cancel only its owned list's old
@@ -819,6 +858,19 @@ keep their existing layout and public interfaces.
819
858
 
820
859
  ### Android section-index attachment
821
860
 
861
+ The index rail and its letter preview MUST remain outside the view hierarchy
862
+ until the accepted configuration contains usable index entries. Disabling the
863
+ index or removing its last usable entry MUST detach both views, cancel the
864
+ preview interaction, and prevent a pending attachment callback from restoring
865
+ them. Restoring usable entries MUST reattach the same view instances without
866
+ duplicate parents. This attachment lifecycle is Android-specific; iOS and Web
867
+ keep their existing behavior.
868
+
869
+ The section-index letter preview is decorative. It MUST NOT participate in
870
+ React Native touch targeting while visible, fading, or invisible. Controls in
871
+ React container slots beneath its bounds MUST remain pressable; the index rail
872
+ continues to own index selection and scrubbing.
873
+
822
874
  When `sectionIndex.centeredInWindow` is enabled, the Android index rail moves
823
875
  between the list container and the window host as list visibility and attachment
824
876
  change. Before adding that same rail to its new parent, the previous parent MUST
@@ -1296,6 +1348,76 @@ disposal. Unit checks prove transition semantics, not rendered behavior.
1296
1348
 
1297
1349
  ## Native media preview probing
1298
1350
 
1351
+ ### Persistent first-frame revision — Source implemented; scoped iOS validation
1352
+
1353
+ This revision supersedes the cell-only frame retention, unbounded visible-player
1354
+ count and copy-failure retained-player behavior described in the baseline below.
1355
+ Image owns the native-only preview cache and extraction coordinator defined in
1356
+ its SPEC §6.3; NativeList retains the paused/muted player and view lifecycle.
1357
+ No public descriptor, JavaScript API or Web renderer behavior changes.
1358
+
1359
+ On reaching the video candidate, a visible slot queries permitted decoded memory
1360
+ and then disk before requesting extraction. A hit displays the still frame and
1361
+ creates no AVPlayer/ExoPlayer. Normal image candidates retain their original
1362
+ precedence and image cache; a video-cache hit MUST NOT bypass an earlier image
1363
+ candidate. Cache identity excludes row key and includes URI, canonical headers,
1364
+ bounded pixel tier, schema and capture fit. Recycle drops cell state, not the
1365
+ shared cached frame. Fit, orientation, black/transparent platform letterbox and
1366
+ row-owned tap behavior match a newly captured frame.
1367
+
1368
+ The media descriptor exposes URI, explicit headers, dimensions, fit and cache
1369
+ policy, with no cookie/session management API. Preview identity does not track
1370
+ ambient cookie sessions or automatically invalidate on cookie changes; media
1371
+ that requires that behavior is outside the supported preview-cache contract.
1372
+ Existing AVPlayer/Media3 networking and cookie handling remain unchanged. The
1373
+ cache does not promise that underlying network requests are cookie-free.
1374
+ Detaching an iOS view with no window MUST preserve its last pixel tier and captured
1375
+ still; only a real attached-window scale/layout change can invalidate that tier.
1376
+
1377
+ Slots subscribe only while visible, attached and foreground eligible. They
1378
+ cancel on invisibility, detach, background, recycle or identity/size change and
1379
+ release any owned player immediately. A same-key visible peer may take over;
1380
+ old owner, binding, candidate and player generations cannot attach a frame or
1381
+ complete a newer request. At most two flights extract concurrently, bounded by
1382
+ Image's queue and 10-second grant deadline. The existing six short copy attempts
1383
+ may run, but exhaustion now releases the player and advances/fails the candidate
1384
+ instead of retaining a paused player indefinitely. Success is emitted after a
1385
+ valid still exists, not solely when the player reports its first rendered frame.
1386
+ No failed extraction is cached. Disk-write failure still permits a successful
1387
+ still to display. A cached or newly copied still releases player and viewport
1388
+ observers, and ordinary text-only rebinding retains the current presentation.
1389
+
1390
+ The cache dimensions use actual view pixel size, capped to a 1024-pixel long edge
1391
+ and 1,048,576 pixels with source aspect ratio preserved. Empty layout defers work.
1392
+ iOS retains the CVPixelBuffer for bounded background CI conversion rather than
1393
+ building a full-resolution UIImage on the UI thread. Android performs a bounded
1394
+ TextureView copy on the UI thread and background encoding; its cached presentation
1395
+ must restore the aspect-ratio container after reuse. Source headers and URL/query
1396
+ text are not written into cache filenames, metadata or logs.
1397
+
1398
+ The production iOS video slot passed 14 simulator checks with a real H.264 MP4,
1399
+ including cold capture/player release, cross-cell/recycled memory reuse, disk
1400
+ reuse after memory clear and a layout-tier resize. Its harness substitutes only
1401
+ the unused image-candidate host; image-to-video fallback and full-app integration
1402
+ were not exercised. Android runtime and physical-device performance remain
1403
+ pending. The complete acceptance matrix adds warm cross-cell/recycled hits with
1404
+ zero new players, disk hits after memory clear and process restart, same-source
1405
+ deduplication, owner cancellation/transfer, concurrency and timeout bounds,
1406
+ clear-generation races, corrupt entry repair and all existing probing/lifecycle
1407
+ cases. Native tests and simulator evidence cannot establish device FPS or memory
1408
+ improvement; those require workload-specific measurements on target devices.
1409
+
1410
+ The final Android slot, including deferred Media3 error release, compiled in the
1411
+ consumer's normal native build and final incremental APK. Matching SDK/consumer
1412
+ source hashes and APK provenance were checked, and the App visibly started on
1413
+ the isolated emulator. This is build/startup acceptance, not Android video-frame
1414
+ or complete Home NFT route acceptance. A temporary Home probe lacked account
1415
+ context; a later diagnostic Dialog had an unexplained black capture. Neither is
1416
+ recorded as a passing NFT visual case. Further scrolling, frame-cache and
1417
+ memory/performance measurements are outside this PR's recorded acceptance scope.
1418
+
1419
+ ### Baseline before the persistent first-frame revision
1420
+
1299
1421
  Status: Source implemented; native runtime acceptance pending. `mediaTile.media`
1300
1422
  is an opt-in native-only preview descriptor: `{ source: ImageSource, probeOrder:
1301
1423
  ('image' | 'video')[] }`. The order contains one or two distinct candidates.
@@ -1312,8 +1434,8 @@ There are no controls or video touch targets; the row owns press interaction.
1312
1434
  Android preserves a black letterbox and iOS a transparent one, matching the
1313
1435
  existing native Video views. No code calls play or requests audio focus.
1314
1436
 
1315
- A failed candidate advances once; exhaustion displays the existing error
1316
- placeholder. New source/row identity resets probing; binding, candidate and
1437
+ A failed candidate advances once; exhaustion displays the failed media
1438
+ placeholder (see Media loading and failure placeholders). New source/row identity resets probing; binding, candidate and
1317
1439
  player generations reject stale callbacks, including A→B→A. Text-only updates
1318
1440
  preserve the current request. On Android, terminal image/player completion is
1319
1441
  posted to the next UI queue turn before advancing probes or notifying the row;
@@ -1428,15 +1550,42 @@ width React lays it out at. Android's narrow-screen row scale and section-index
1428
1550
  apply to data rows only. Slot React trees own their internal layout and
1429
1551
  business actions; NativeList owns their scroll placement and lifecycle.
1430
1552
 
1431
- The wrapper mounts four non-collapsible slot roots and reports measured
1432
- heights through `containerSlotHeightsJson` in header/empty/footer/sidecar order.
1433
- The sidecar root has zero reserved height when absent. Native validates four
1434
- finite, non-negative heights. Slot updates MUST NOT alter data-row
1435
- keys or public row indices. No per-scroll-frame JS position updates are used.
1553
+ The wrapper mounts six non-collapsible slot roots and reports measured heights
1554
+ through `containerSlotHeightsJson` in header/empty/footer/sidecar/expanded/toggle
1555
+ order. The sidecar root has zero reserved height when absent. Native validates
1556
+ six finite, non-negative heights and still accepts legacy four-number arrays,
1557
+ except for the iOS pending-header state described below. Slot updates MUST NOT
1558
+ alter data-row keys or public row indices. No per-scroll-frame JS position updates are used.
1436
1559
  iOS mounts each slot root inside a list-owned host view in UICollectionView and
1437
1560
  reserves native layout space. The host owns the slot's vertical position and clips to
1438
1561
  the reported height, so React frame updates cannot move a slot out of place and a slot
1439
1562
  whose height has not been reported yet (or has just grown) never draws over rows.
1563
+
1564
+ iOS header first-frame measurement: when `listHeader` is present but
1565
+ its first layout has not arrived, the matching wrapper sends `null` for slot 0
1566
+ instead of an authoritative zero. The other five slot values remain finite,
1567
+ non-negative numbers; Android serialization stays unchanged. On iOS, an absent
1568
+ header always reports numeric zero. Each absent/present boundary replaces only
1569
+ the header slot root and starts a new measurement epoch; a layout callback from
1570
+ an earlier epoch MUST NOT make the current header ready. Replacing header content
1571
+ while it remains present does not start another epoch. A newly present header stays pending
1572
+ until its own layout reports a number, including zero.
1573
+ Before that measurement, the iOS host may reserve the current mounted header
1574
+ root's finite, non-negative `ceil(bounds.height)` when its bounds width is finite
1575
+ and positive. It applies that height to both clipping and row placement in the
1576
+ same native update, regardless of whether the root or pending heights arrive
1577
+ first. Without a valid current root, pending height is zero. Unmounting or
1578
+ recycling the root discards its provisional height; another root cannot inherit
1579
+ it. The first numeric measurement, including a genuine zero, is authoritative
1580
+ and retains ordinary dynamic growth and shrink behavior. Legacy four- and
1581
+ six-number arrays remain accepted. Only header slot 0 may be null, and the
1582
+ wrapper and native binary must match for this pending-header protocol.
1583
+ When the vertical iOS collection view first obtains positive bounds in
1584
+ `layoutSubviews`, it emits `OneKeyNativeScrollViewDidBecomeReady` before
1585
+ executing pending scroll requests or laying out container slots so an enclosing
1586
+ `CollapsiblePagerView` can synchronously attach and apply top insets, offset
1587
+ alignment, and sticky heights during the same layout pass.
1588
+
1440
1589
  Android uses ConcatAdapter with three single-item slot adapters around the existing
1441
1590
  data adapter; adapter binding indices stay local while layout-manager positions
1442
1591
  are explicitly translated. Slots span all grid columns, do not select/reorder,
@@ -1638,6 +1787,61 @@ tones. `descriptionActionKey` makes only the description emit that action with
1638
1787
  source `description`; footer actions retain their existing source/keys and
1639
1788
  disabled behavior. All actions use the current host binding epoch.
1640
1789
 
1790
+ Description action text. The action is hit on text only, never on the unused
1791
+ width of the description line, which belongs to the row press. Which text is
1792
+ stated by the caller in `descriptionActionStart`, a UTF-16 offset into
1793
+ `description` as supplied (JavaScript string index): the text from the offset on
1794
+ opens the action, the text before it is plain and belongs to the row press.
1795
+ NativeList never derives the offset from the displayed string, its separators or
1796
+ its wording; a caller that composes `prefix + label` records `prefix.length`.
1797
+
1798
+ - Absent means `0`: the whole description text is the action.
1799
+ `description.length` leaves no action text; the row then has no description
1800
+ action, and no button semantics, on any platform.
1801
+ - The field is ignored without `descriptionActionKey`.
1802
+ - Development validation rejects a value that is not a non-negative safe
1803
+ integer, and on a complete row (a snapshot row, or a row after a patch is
1804
+ merged) a value past `description.length`. Production drops a malformed value,
1805
+ which restores the default, and renderers clamp a value past the text to its
1806
+ end.
1807
+ - A patch that changes `description` without `descriptionActionStart` clears the
1808
+ stored offset, because it pointed into the previous string. Callers that keep
1809
+ a prefix restate the offset in the same patch.
1810
+ - iOS and Android map the offset onto the displayed text: a one-line description
1811
+ folds each line break into one space, so offsets after a CRLF move by one.
1812
+ - The hit area follows the laid-out text. iOS and Android build it from the
1813
+ layout engine's own rects for the action's character range (TextKit enclosing
1814
+ rects, the Android layout's selection), one per line and per visual run. A
1815
+ line that ends before the offset takes no touches, the line that holds it
1816
+ takes them from the offset on, later lines take them on their text. In
1817
+ mixed-direction text the action can be several runs on one line with plain
1818
+ text between them, and each run is its own region.
1819
+ - Touch slop reaches into blank space only. iOS and Android widen each run of
1820
+ action text by 8 units, and the widening stops at plain description text on
1821
+ the same line: text before the offset never opens the action, however narrow
1822
+ it is. iOS also extends the first and the last line of the whole layout by 6
1823
+ points away from the text, never a line in between, so the slop cannot reach
1824
+ into a line that holds only plain text. Android extends the first and last
1825
+ line of the layout to the view's top and bottom edge.
1826
+ - An ellipsis belongs to the action while action text is visible before it.
1827
+ Once truncation hides the action text altogether the ellipsis also stands for
1828
+ plain text, and the row has no hit area for the action.
1829
+ - Truncation. The description stays on its declared lines as `prefix + action`.
1830
+ On Web the prefix keeps its natural width and the action text truncates
1831
+ first, which matches the tail truncation of the native label. While action
1832
+ text follows, the Web prefix is capped at the row width less `3em` and
1833
+ truncates itself, so a prefix wider than the row cannot squeeze the action to
1834
+ nothing and leave it without a pointer target. iOS and Android draw one label
1835
+ and truncate its tail; they do not reserve room, so there a long prefix can
1836
+ push the action text out of view. The Web prefix and action are two elements
1837
+ side by side and each resolves its own text direction, so an offset inside a
1838
+ directional run draws that run in two parts; the action element is still
1839
+ exactly the action text.
1840
+ - Internally the native text view holds one optional start: none keeps the
1841
+ view's own hit testing (rows without the action), `0` limits touches to all of
1842
+ the text, a positive value to the text from there on. Binding, rebinding
1843
+ without the action and recycling set or clear that one value.
1844
+
1641
1845
  Rich rows measure the declared line/visual metrics; there is no six-line native
1642
1846
  truncation. iOS automatic height mirrors the rendered stacks: `lineGap` between the
1643
1847
  visible title/description/status lines, the description measured at the identity
@@ -1922,8 +2126,9 @@ imageState explicitly selects that state.
1922
2126
 
1923
2127
  Web gallery media preserves the consuming NFT card presentation: healthy image
1924
2128
  and exhausted fallback surfaces have a10px radius, while a healthy video surface
1925
- has square corners. The image/video frame uses the list page background; only
1926
- the exhausted fallback surface uses the strong background. Rebinding the same
2129
+ has square corners. The image/video frame uses the list page background; the
2130
+ loading and exhausted fallback surfaces use the strong background and the
2131
+ shared media placeholders. Rebinding the same
1927
2132
  video key retains square corners, and failed-video fallback to an image restores
1928
2133
  the image radius. This is Web renderer behavior; native media presentation and
1929
2134
  probe-order contracts are unchanged.
@@ -2185,6 +2390,41 @@ The same native display-link/animator tick changes suffix extent, footer positio
2185
2390
 
2186
2391
  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.
2187
2392
 
2393
+ ### Web token table geometry
2394
+
2395
+ Status: implemented with focused SDK regression coverage and consuming-App
2396
+ measurements from a local runtime overlay; formal SDK release integration is
2397
+ separate.
2398
+
2399
+ A Web `DataRow` with exactly the ordered column keys `asset`, `balance`, `price`,
2400
+ and `swapSpacer`, without an ordinal index, favorite control, or checkbox,
2401
+ preserves the legacy four equal columns. Rows with any of those controls retain
2402
+ their existing weighted layout so the controls keep their linear positions.
2403
+ The leading visual and its declared gap share the first column with the asset
2404
+ text; an absent visual reserves no icon inset. Balance and price occupy the
2405
+ second and third columns; the trailing accessories align to the end of the
2406
+ fourth. This closed migration shape uses equal columns instead of the
2407
+ previous weight approximation and removes the row's inherited 12px gap so
2408
+ each track occupies exactly one quarter of the padded content width. Other
2409
+ column shapes retain their existing weighted layout. Rebinding a retained row
2410
+ between these shapes clears the old grid placement, gap override, and asset
2411
+ inset, including when the leading visual is reused.
2412
+ Text, icon size, row height, actions, and iOS/Android layouts retain their
2413
+ existing contracts.
2414
+
2415
+ The Web `listStructureToggle` slot cancels the enclosing footer band's
2416
+ horizontal content inset while disclosure is present, since toggle content owns
2417
+ its page padding. The footer and expanded-content slots keep their existing
2418
+ insets. Changing the accepted content padding updates the compensation;
2419
+ removing disclosure still hides and disables the retained toggle subtree.
2420
+
2421
+ Conformance covers token-to-generic and generic-to-token row reuse, rows with an
2422
+ index/favorite/checkbox, leading visual and disabled action preservation,
2423
+ accepted padding changes, and absent disclosure. The consuming App comparison
2424
+ covers six visible rows and the toggle
2425
+ at 1024, 1280, and 1600 CSS-pixel viewports; it does not establish native runtime
2426
+ acceptance or a performance improvement.
2427
+
2188
2428
  `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.
2189
2429
 
2190
2430
  `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.
@@ -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
 
@@ -635,6 +642,11 @@ the list's general section mechanism.
635
642
  | Reorder preview | no | — | — | r12, shadow `0 4px 24px` |
636
643
  | Reorder count badge | no | 24 h, r12, 12 semibold | dp(24), r dp(12), sp(12) semibold | 24px, r12, 12/22/600 |
637
644
 
645
+ Pinned section headers draw no separator or shadow on any platform. The pinned
646
+ overlay paints the header's own row background, which is what hides the rows
647
+ scrolling underneath it; a list that wants a visible boundary supplies it through
648
+ the header row's style, not through container chrome.
649
+
638
650
  The section index rail is three separate constant sets for one control; Android's
639
651
  `sectionIndexDp()` deliberately never follows the source-scale switch.
640
652
 
@@ -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
 
@@ -0,0 +1,189 @@
1
+ import UIKit
2
+
3
+ /// Loading sheen and failed hatch drawn over a media tile while it has no picture.
4
+ /// Geometry mirrors the Web renderer (`MediaTileRowRenderer.ts`) and Android
5
+ /// (`NativeListMediaPlaceholderView.kt`) so every platform draws the same placeholder.
6
+ final class NativeListMediaPlaceholderView: UIView {
7
+ enum State { case hidden, loading, failed }
8
+
9
+ private static let sweepPeriod: CFTimeInterval = 1.6
10
+ private static let sweepKey = "nativeListMediaSweep"
11
+
12
+ private let sheen = CAGradientLayer()
13
+ private let hatch = CAShapeLayer()
14
+ private let hatchMask = CAGradientLayer()
15
+ private let picture = CAShapeLayer()
16
+ private let pictureCut = CAShapeLayer()
17
+ private let slash = CAShapeLayer()
18
+ private(set) var state: State = .hidden
19
+ private var laidOutSize: CGSize = .zero
20
+ private var loadingFill: UIColor = .clear
21
+
22
+ override init(frame: CGRect) {
23
+ super.init(frame: frame)
24
+ isUserInteractionEnabled = false
25
+ isHidden = true
26
+ clipsToBounds = true
27
+ layer.borderWidth = 1 / UIScreen.main.scale
28
+ sheen.startPoint = CGPoint(x: 0, y: 0.5)
29
+ sheen.endPoint = CGPoint(x: 1, y: 0.5)
30
+ sheen.locations = [0, 0.5, 1]
31
+ hatch.lineWidth = 1
32
+ hatch.fillColor = nil
33
+ hatchMask.type = .radial
34
+ hatchMask.startPoint = CGPoint(x: 0.5, y: 0.5)
35
+ // CSS `radial-gradient(circle ...)` defaults to the farthest corner.
36
+ hatchMask.endPoint = CGPoint(x: 0.5 + 0.7071, y: 0.5 + 0.7071)
37
+ hatchMask.colors = [UIColor.clear.cgColor, UIColor.clear.cgColor, UIColor.black.cgColor, UIColor.black.cgColor]
38
+ hatchMask.locations = [0, 0.22, 0.7, 1]
39
+ hatch.mask = hatchMask
40
+ for shape in [picture, slash] {
41
+ shape.fillColor = nil
42
+ shape.lineCap = .round
43
+ shape.lineJoin = .round
44
+ }
45
+ pictureCut.fillRule = .evenOdd
46
+ pictureCut.fillColor = UIColor.black.cgColor
47
+ [hatch, sheen, picture, slash].forEach(layer.addSublayer)
48
+ NotificationCenter.default.addObserver(
49
+ self, selector: #selector(restartSweep),
50
+ name: UIApplication.willEnterForegroundNotification, object: nil)
51
+ }
52
+ required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") }
53
+
54
+ func applyTheme(_ theme: [String: Any]?) {
55
+ loadingFill = nativeListColor(theme, "strongBackground", "#0000000F")
56
+ if state == .loading { backgroundColor = loadingFill }
57
+ let glyph = nativeListColor(theme, "disabledText", "#8C8C8C")
58
+ let glyphColor = glyph.withAlphaComponent(glyph.cgAlpha * 0.7).cgColor
59
+ picture.strokeColor = glyphColor
60
+ slash.strokeColor = glyphColor
61
+ let separator = nativeListColor(theme, "separator", "#E5E7EB")
62
+ layer.borderColor = separator.withAlphaComponent(separator.cgAlpha * 0.6).cgColor
63
+ hatch.strokeColor = nativeListColor(theme, "primaryText", "#202020").withAlphaComponent(0.045).cgColor
64
+ let dark = nativeListIsDark(nativeListColor(theme, "rowBackground", "#FFFFFF"))
65
+ let shine = UIColor.white.withAlphaComponent(dark ? 0.07 : 0.75)
66
+ sheen.colors = [shine.withAlphaComponent(0).cgColor, shine.cgColor, shine.withAlphaComponent(0).cgColor]
67
+ }
68
+
69
+ func setState(_ next: State) {
70
+ guard next != state else { return }
71
+ state = next
72
+ isHidden = next == .hidden
73
+ // The failed state sits on the cell's own fill; while loading nothing else paints the slot.
74
+ backgroundColor = next == .loading ? loadingFill : .clear
75
+ CATransaction.begin()
76
+ CATransaction.setDisableActions(true)
77
+ sheen.isHidden = next != .loading
78
+ hatch.isHidden = next != .failed
79
+ slash.isHidden = next != .failed
80
+ picture.mask = next == .failed ? pictureCut : nil
81
+ CATransaction.commit()
82
+ restartSweep()
83
+ }
84
+
85
+ override func layoutSubviews() {
86
+ super.layoutSubviews()
87
+ guard bounds.size != laidOutSize else { return }
88
+ laidOutSize = bounds.size
89
+ CATransaction.begin()
90
+ CATransaction.setDisableActions(true)
91
+ layoutHatch()
92
+ layoutGlyph()
93
+ let width = bounds.width, height = bounds.height
94
+ sheen.bounds = CGRect(x: 0, y: 0, width: width * 0.6, height: height * 2)
95
+ sheen.position = CGPoint(x: width * 0.6, y: height / 2)
96
+ // CSS skewX(-12deg).
97
+ sheen.setAffineTransform(CGAffineTransform(a: 1, b: 0, c: -tan(12 * .pi / 180), d: 1, tx: 0, ty: 0))
98
+ CATransaction.commit()
99
+ restartSweep()
100
+ }
101
+
102
+ override func didMoveToWindow() {
103
+ super.didMoveToWindow()
104
+ restartSweep()
105
+ }
106
+
107
+ @objc private func restartSweep() {
108
+ sheen.removeAnimation(forKey: Self.sweepKey)
109
+ guard state == .loading, window != nil, bounds.width > 0 else { return }
110
+ let width = bounds.width
111
+ guard !UIAccessibility.isReduceMotionEnabled else {
112
+ sheen.opacity = 0.6
113
+ return
114
+ }
115
+ sheen.opacity = 1
116
+ let sweep = CAKeyframeAnimation(keyPath: "position.x")
117
+ // Band left edge travels from -80% to 130% of the tile, then rests for 30% of the period.
118
+ sweep.values = [width * -0.5, width * 1.6, width * 1.6]
119
+ sweep.keyTimes = [0, 0.7, 1]
120
+ sweep.timingFunctions = [
121
+ CAMediaTimingFunction(controlPoints: 0.4, 0, 0.2, 1), CAMediaTimingFunction(name: .linear),
122
+ ]
123
+ sweep.duration = Self.sweepPeriod
124
+ sweep.repeatCount = .infinity
125
+ sweep.isRemovedOnCompletion = false
126
+ // Every tile derives its phase from the shared media clock so the grid sweeps in step,
127
+ // including cells that are recycled mid-period.
128
+ sweep.timeOffset = CACurrentMediaTime().truncatingRemainder(dividingBy: Self.sweepPeriod)
129
+ sheen.add(sweep, forKey: Self.sweepKey)
130
+ }
131
+
132
+ private func layoutHatch() {
133
+ hatch.frame = bounds
134
+ hatchMask.frame = bounds
135
+ let path = UIBezierPath()
136
+ // Lines along x + y = c, 7pt apart measured perpendicular to the stripes.
137
+ let step = 7 * CGFloat(2).squareRoot()
138
+ var c: CGFloat = 0
139
+ while c <= bounds.width + bounds.height {
140
+ path.move(to: CGPoint(x: c, y: 0))
141
+ path.addLine(to: CGPoint(x: 0, y: c))
142
+ c += step
143
+ }
144
+ hatch.path = path.cgPath
145
+ }
146
+
147
+ private func layoutGlyph() {
148
+ let size = min(bounds.width * 0.28, 44)
149
+ let scale = size / 24
150
+ let origin = CGPoint(x: (bounds.width - size) / 2, y: (bounds.height - size) / 2)
151
+ var transform = CGAffineTransform(translationX: origin.x, y: origin.y).scaledBy(x: scale, y: scale)
152
+ let frame = UIBezierPath(roundedRect: CGRect(x: 3, y: 3, width: 18, height: 18), cornerRadius: 4)
153
+ frame.append(UIBezierPath(ovalIn: CGRect(x: 7.4, y: 7.4, width: 3.2, height: 3.2)))
154
+ let ridge = UIBezierPath()
155
+ ridge.move(to: CGPoint(x: 5, y: 20.5))
156
+ ridge.addLine(to: CGPoint(x: 14.5, y: 11))
157
+ ridge.addLine(to: CGPoint(x: 21, y: 17.5))
158
+ frame.append(ridge)
159
+ picture.frame = bounds
160
+ picture.lineWidth = 1.5 * scale
161
+ picture.path = frame.cgPath.copy(using: &transform)
162
+ let line = UIBezierPath()
163
+ line.move(to: CGPoint(x: 3, y: 3))
164
+ line.addLine(to: CGPoint(x: 21, y: 21))
165
+ slash.frame = bounds
166
+ slash.lineWidth = 1.5 * scale
167
+ slash.path = line.cgPath.copy(using: &transform)
168
+ let band = UIBezierPath()
169
+ band.move(to: CGPoint(x: 2.6, y: -0.6))
170
+ band.addLine(to: CGPoint(x: 24.6, y: 21.4))
171
+ band.addLine(to: CGPoint(x: 21.4, y: 24.6))
172
+ band.addLine(to: CGPoint(x: -0.6, y: 2.6))
173
+ band.close()
174
+ let cut = UIBezierPath(rect: bounds)
175
+ if let bandPath = band.cgPath.copy(using: &transform) { cut.append(UIBezierPath(cgPath: bandPath)) }
176
+ pictureCut.frame = bounds
177
+ pictureCut.path = cut.cgPath
178
+ }
179
+ }
180
+
181
+ private extension UIColor {
182
+ var cgAlpha: CGFloat { cgColor.alpha }
183
+ }
184
+
185
+ func nativeListIsDark(_ color: UIColor) -> Bool {
186
+ var red: CGFloat = 0, green: CGFloat = 0, blue: CGFloat = 0, alpha: CGFloat = 0
187
+ guard color.getRed(&red, green: &green, blue: &blue, alpha: &alpha) else { return false }
188
+ return red * 299 + green * 587 + blue * 114 < 500
189
+ }