Commit ce2c195
fix(widgets): modal contrast, contact-support clickability, BUY/PAID status tiers (p2pdotme#6)
* fix(modal): pipe themeStyle through portal so card respects host palette
Modal portals to document.body, escaping the calling widget's root where
`themeToCssVars(theme)` is applied. The card's `background: var(--p2p-color-bg, #ffffff)`
fell back to white, while inner content (which reaches the host's CSS vars
via the inner themeStyle div) renders text in near-white — producing
white-on-white text on dark integrators.
Each Modal caller now passes its `themeStyle` to Modal, which spreads it
on the backdrop. CSS cascade carries the vars to the card so the surface
matches the integrator's palette. Also pins `color: color.text` on the
card so descendants without an explicit color inherit a readable token.
Verified on merchant-app demo: dialog bg now resolves to integrator dark
surface, text near-white — proper contrast restored.
* fix(contact-support): always render the button so users always have a recourse
Previous behavior only rendered the Contact Support chip when the order
was inside the dispute window or after a dispute was filed. PLACED /
ACCEPTED / PAID / COMPLETED states showed status text with NO action —
leaving users with no way to contact support when an order was stuck (e.g.
PAID waiting on a merchant-confirm-completion watcher that hasn't fired).
Now every row renders a Contact Support button. Variant depends on state:
- In dispute window → chip with countdown, click opens report flow
- Dispute open / resolved → plain button with dot, click opens chat
- Everything else → plain button, click opens chat (or surfaces
"Support not available yet" if the order isn't bound to an inbox yet)
End users always have a way to reach support, even when no on-chain
dispute path is currently valid.
* Revert "fix(contact-support): always render the button so users always have a recourse"
This reverts commit f57f0bf.
* fix(contact-support): in-window chip is always clickable, falls back to chat when no txSigner
Previous behavior: the in-window report chip rendered with disabled={!txSigner}.
When the embedder didn't wire txSigner (or it was somehow undefined), the
chip appeared visibly greyed out and the HTML disabled attribute blocked
the click — leaving the user with a visible but non-functional button.
Now: the chip is always clickable. Click target depends on txSigner:
- txSigner present → opens the on-chain report flow (raiseDispute)
- txSigner missing → opens chat (will surface "Support not available yet"
if the bridge has no inbox bound, but the user is never left without a
response on click)
* fix(order-action): surface stale-PLACED + processing-payment countdown
Two related smart-action machine improvements:
1. **PLACED past 5min → "still matching, taking longer than usual"** —
the chain's status field stays PLACED until an `autoCancelExpiredOrders`
keeper sweep runs, which lags the actual accept-window expiry. The
widget now surfaces the staleness so users don't keep staring at
"Placed · matching" forever when no merchant can pick the order up
anymore.
2. **BUY/PAID renders a countdown** — "Paid · processing payment ·
completes within <X>m" while inside the 30-min processing window
(matches contract's placedAt + orderExpiry envelope). Past the
window we fall back to the plain "Paid · processing payment" label.
Constants exported:
- `PLACED_STALE_THRESHOLD_MS = 5 * MIN`
- `BUY_PAID_PROCESSING_WINDOW_MS = 30 * MIN`
71 node:test cases pass, 55 vitest pass, typecheck + build clean.
* fix(order-action): three-tier BUY/PAID status (no countdown in middle band)
Revise the BUY/PAID label tiers per UX spec:
< 5min → "Paid · processing payment"
5–30min → "Paid · processing payment · taking longer than usual"
≥ 30min → "Paid · processing payment · will resolve within <countdown>"
The middle tier is a gentle warning without a countdown (drops the noise of
a constantly-changing timer for orders that are merely a few minutes
overdue). The outer tier anchors the countdown on BUY_DISPUTE_CLOSE_MS
(24h) — the chain's outermost resolution deadline, so the user always sees
a hard upper bound on the wait.
---------
Co-authored-by: gitchadd <gitchad@icloud.com>1 parent 08e6bea commit ce2c195
7 files changed
Lines changed: 100 additions & 24 deletions
File tree
- src
- core
- ui
- widgets
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
79 | 88 | | |
80 | 89 | | |
81 | 90 | | |
| |||
113 | 122 | | |
114 | 123 | | |
115 | 124 | | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
123 | 139 | | |
124 | 140 | | |
125 | 141 | | |
126 | 142 | | |
127 | | - | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
128 | 148 | | |
129 | 149 | | |
130 | 150 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
85 | 100 | | |
86 | 101 | | |
87 | 102 | | |
| |||
109 | 124 | | |
110 | 125 | | |
111 | 126 | | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
112 | 137 | | |
113 | 138 | | |
114 | 139 | | |
| |||
123 | 148 | | |
124 | 149 | | |
125 | 150 | | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
126 | 173 | | |
127 | 174 | | |
128 | 175 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
32 | 40 | | |
33 | 41 | | |
34 | 42 | | |
| |||
37 | 45 | | |
38 | 46 | | |
39 | 47 | | |
| 48 | + | |
40 | 49 | | |
41 | 50 | | |
42 | 51 | | |
| |||
100 | 109 | | |
101 | 110 | | |
102 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
103 | 116 | | |
104 | 117 | | |
105 | 118 | | |
| |||
121 | 134 | | |
122 | 135 | | |
123 | 136 | | |
| 137 | + | |
124 | 138 | | |
125 | 139 | | |
126 | 140 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
572 | 572 | | |
573 | 573 | | |
574 | 574 | | |
575 | | - | |
| 575 | + | |
576 | 576 | | |
577 | 577 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
714 | 714 | | |
715 | 715 | | |
716 | 716 | | |
717 | | - | |
| 717 | + | |
718 | 718 | | |
719 | 719 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
134 | 133 | | |
135 | 134 | | |
136 | 135 | | |
137 | | - | |
138 | 136 | | |
139 | 137 | | |
140 | 138 | | |
| |||
247 | 245 | | |
248 | 246 | | |
249 | 247 | | |
250 | | - | |
251 | 248 | | |
252 | 249 | | |
253 | 250 | | |
| |||
259 | 256 | | |
260 | 257 | | |
261 | 258 | | |
| 259 | + | |
262 | 260 | | |
263 | 261 | | |
264 | 262 | | |
| |||
302 | 300 | | |
303 | 301 | | |
304 | 302 | | |
305 | | - | |
306 | 303 | | |
307 | 304 | | |
308 | 305 | | |
309 | 306 | | |
310 | 307 | | |
311 | 308 | | |
312 | | - | |
313 | 309 | | |
314 | 310 | | |
315 | 311 | | |
316 | 312 | | |
317 | 313 | | |
318 | 314 | | |
319 | 315 | | |
320 | | - | |
321 | 316 | | |
322 | 317 | | |
323 | 318 | | |
| |||
332 | 327 | | |
333 | 328 | | |
334 | 329 | | |
335 | | - | |
336 | | - | |
| 330 | + | |
337 | 331 | | |
338 | 332 | | |
339 | 333 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
| 179 | + | |
179 | 180 | | |
180 | 181 | | |
181 | 182 | | |
| |||
0 commit comments