Repository navigation
feat(boost): clickable lane cards with hover, live click counts, compact mobile rows - #99
Merged
Merged
Conversation
…sted - The whole Boosted card opens the token (stretched link, LaunchCard's pattern); "Latest burn" stays its own link above it. Keyboard focus rings the whole card. - Hover: warm tint, a still warm edge, an arrow, a slightly larger avatar, a brighter fuse. Only under a pointer that hovers; reduced motion keeps the colours. Nothing loops. - POST /api/boost/seen (sendBeacon): one view per page when the lane is on screen, and each card click. A click counts only while the token is in the lane, at the place the server's lane gives it, once per visitor, token and 30 minutes. Bots skipped, 60/min per IP, 512-byte body. The visitor is the daily presence hash mixed with the token: no IP, user agent or wallet stored. - bb_boost_views (hourly counts) and bb_boost_clicks; /admin gets a "Views and clicks" table (24h/7d/30d) via GET /api/boost/stats for admin wallets. The ranking never reads either table (guard extended).
- Each Boosted card shows its clicks from the lane in the last 24 hours (the window its TWIG is counted in) with a pointer icon: nothing at 0, rolls up when a poll brings more, a screen-reader label, and the count in the card's tooltip. A pointer, not an eye: one page load is a view for every card, so views would read the same on all five. - The lane read carries `clicks` (one indexed query per lane build; a failed read shows no counts, never no lane). - Under 640px a card is a compact two-line row (name left; TWIG, clicks, time left right): all five places fit on a phone screen, about 62px a card instead of 110px. "Latest burn" from 640px (the token page has it on a phone). One set of parts placed by grid areas, so the stacked card from 640px is unchanged.
- The beacon takes only the site's own pages (Sec-Fetch-Site same-origin, or a matching Origin): another site can no longer raise a card's public count from its visitors' browsers (a text/plain beacon needs no CORS preflight). - Views are tallied in memory and written once every 10 s per machine, not one upsert on the same hot rows per page. - Click rows are pruned after 90 days (hourly, off the request path); view rows are hourly counts and stay. - /admin: views, clicks and burns start at the same whole hour; totals are window sums over every token, not the 100 listed; visitors have no total (counted per token); a period never shows another period's error. - The lane sends no view for its empty line; the hover arrow is hidden under 640px (it covered the TWIG figure). - The expiry filter runs once, where the cached lane is read, for pages, polls and beacons alike.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Makes the Boosted lane worth paying for: the whole card opens the token, cards react on hover, each card shows how many clicks it got from the lane, and phones see all five places at once.
Lane cards
Tracking (only while boosted)
POST /api/boost/seen(sendBeacon, never delays the click):bb_boost_clicks, andbb_boost_views(hourly counts, added up in memory and written every 10 s per machine)./admin
GET /api/boost/stats?wallet=<admin>.Deploy notes
PRESENCE_SALTwith this deploy:fly secrets set PRESENCE_SALT=$(openssl rand -hex 32) -a basebid. It isn't set today, so each machine salts visitors differently and a repeat click landing on the other machine counts again. This also fixes the same gap in the site's visit counter.Testing
/code-review high: 9 of 10 findings fixed. Declined: signing the stats read (same?wallet=pattern as the reported-posts queue; it only holds counts that name nobody).Summary by CodeRabbit