aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-12-06 12:35:13 -0700
committerAdam Soltys <[email protected]>2026-12-06 12:35:13 -0700
commit427eb66162dc3482e3cfba2613aa87b06f5340d7 (patch)
treeb7d3b120767825ea3f5de84ea1d27c4d1c4a0da2 /tools
parentf15e3b23c94fb36886e5201984d27a2509428cc9 (diff)
downloadcoinosv3-427eb66162dc3482e3cfba2613aa87b06f5340d7.tar.gz
coinosv3-427eb66162dc3482e3cfba2613aa87b06f5340d7.zip
Gift sender chip: the hat isn't cut off, the face waits for the real picture, and no "Claiming it follows them" line.HEADmaster
"Hat cut off here and also the avatar showed a punk first before the right one appeared can we fix that so it loads the right avatar right away? Also let's remove the text about how claiming follows" (Adam, 2026-12-06, a 5 CAD gift from him on the claim screen). The chip's `.zap-chip > span { overflow: hidden }` (meant for the name) also clipped the .hat-wrap span; it now skips .hat-wrap. A small face gave up after 1 s and drew punk art while the sender's profile was still loading; profileChip's new 'wait' size makes the face wait for the lookup like a profile page's does (quiet circle, then the real picture; punk only if they have none). The follows line is gone from the screen and all locales (claiming still follows the sender). gift-from-test checks all three; features-smoke passes. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VMan6WoqaQDYdpWkatPCar
Diffstat (limited to 'tools')
-rw-r--r--tools/gift-from-test.js17
1 files changed, 13 insertions, 4 deletions
diff --git a/tools/gift-from-test.js b/tools/gift-from-test.js
index a0ffaf8..e82926d 100644
--- a/tools/gift-from-test.js
+++ b/tools/gift-from-test.js
@@ -1,6 +1,6 @@
// A gift link can name its sender: #f=<base32 pubkey|created_at|sig>, a
// nostr signature over the gift's code. The claim screen shows who it's
-// from (and that claiming follows them); a link whose signature doesn't
+// from; a link whose signature doesn't
// match its code — passed on as someone else's gift — shows no sender.
// Run: bun run build && bun tools/gift-from-test.js
import puppeteer from './puppeteer.js';
@@ -52,16 +52,25 @@ try {
const code = giftCode();
let page = await open(`ag/${code}#m=hi&f=${fromFrag(code)}`);
let tx = await text(page);
- check('a signed link names its sender', /\bFrom\b/.test(tx) && /Claiming it follows them/.test(tx), tx.slice(0, 300).replace(/\n/g, ' | '));
+ const chip = () => page.evaluate(() => !!document.querySelector('.zap-chip'));
+ check('a signed link names its sender', /\bFrom\b/.test(tx) && await chip(), tx.slice(0, 300).replace(/\n/g, ' | '));
+ check('no "claiming follows them" line', !/follows them/i.test(tx));
+ // the sender's face waits for their profile, never punk art first
+ check("the sender's face waits for their profile", await page.evaluate(() => !!document.querySelector('.zap-chip .wait-face')));
+ // a hat sits above the chip: the chip's name clipping must not cut it off
+ check('a hat on the sender is not clipped', await page.evaluate(() => {
+ const c = document.querySelector('.zap-chip'); const w = document.createElement('span'); w.className = 'hat-wrap';
+ c.prepend(w); const o = getComputedStyle(w).overflow; w.remove(); return o === 'visible';
+ }));
check('the note still shows', /\bhi\b/.test(tx));
await page.close();
// an upper-case key, as a scanner may hand it over
page = await open(`ag/${code}#F=${fromFrag(code)}`);
- { const tx = await text(page); check("an upper-cased link still names its sender", /Claiming it follows them/.test(tx), tx.slice(0, 200).replace(/\n/g, " | ")); }
+ { const tx = await text(page); check("an upper-cased link still names its sender", /\bFrom\b/.test(tx) && await page.evaluate(() => !!document.querySelector('.zap-chip')), tx.slice(0, 200).replace(/\n/g, " | ")); }
await page.close();
// the same signature on a different gift: no sender
page = await open(`ag/${giftCode()}#f=${fromFrag(code)}`);
- check('a signature over another code names nobody', !/Claiming it follows them/.test(await text(page)));
+ check('a signature over another code names nobody', !/\bFrom\b/.test(await text(page)) && !(await page.evaluate(() => !!document.querySelector('.zap-chip'))));
await page.close();
} finally {
await browser.close();