VersionControl:PRs/pickipedia/159: Difference between revisions

From PickiPedia: A knowledge base of bluegrass, old time psychedelic jams, and other public domain music
Jump to navigationJump to search
DrivingThatTrain (talk | contribs)
cryptograss/pickipedia#159, as GitHub has it
 
DrivingThatTrain (talk | contribs)
cryptograss/pickipedia#159, as GitHub has it
 
Line 16: Line 16:
|deploy=
|deploy=
}}
}}
<pre class="pr-body">To-do (magenta-interface): show Blue Railroads beside user links on PickiPedia too, as magenta shows them beside names.
**What it does.** Every link to a user's page gets that person's Blue Railroad count beside it: the train icon and the number, linking to the Blue Railroad Leaderboard, with "JMyles holds 8 Blue Railroad tokens, all songs together" on hover. That covers links in pages, Recent Changes, histories and so on, anywhere `wikipage.content` fires.
**How it counts.** The same way magenta's `services/tokens.py` does, from what the wiki already knows. Two Semantic MediaWiki queries:
- each token's Owner Address (`Category:Blue Railroad Tokens`, kept current by the import bot);
- each user page's Ethereum Address.
Addresses match without regard to case. It runs in the reader's browser, not the parser, so a page's cached HTML never freezes an old count in. The result is kept in `localStorage` for ten minutes, so a reader asks once.
**Files:** a ResourceLoader module (`ext.pickipediaContent.blueRailroads`, loaded by the existing `BeforePageDisplay` hook), plus three CSS rules. No PHP beyond that one `addModules` line.
**Checked** by loading the script into live Special:RecentChanges in a headless browser: counts `{"JMyles": 8}`, 34 badges beside JMyles's links, no errors. ![](https://raw.githubusercontent.com/cryptograss/magenta/mockup-thought-dots/mockups/br-userlinks.png) Skyler gets none yet because User:SkymanJenkins has no Ethereum Address (that's on the to-do list for him).
Not linted with PHP here (no php on hunter's shell). The PHP change is one line, in an existing method.</pre>

Latest revision as of 18:06, 9 November 2026

pickipedia#159: Blue Railroads beside user links
State 🟢 open
Worked on by not said
Moods not said
Deploy not said
Branch br-userlinks → production, by magent-cryptograss
Opened · last pushed 2026-10-26 01:34:48 · 2026-10-26 01:34:44
To-do (magenta-interface): show Blue Railroads beside user links on PickiPedia too, as magenta shows them beside names.

**What it does.** Every link to a user's page gets that person's Blue Railroad count beside it: the train icon and the number, linking to the Blue Railroad Leaderboard, with "JMyles holds 8 Blue Railroad tokens, all songs together" on hover. That covers links in pages, Recent Changes, histories and so on, anywhere `wikipage.content` fires.

**How it counts.** The same way magenta's `services/tokens.py` does, from what the wiki already knows. Two Semantic MediaWiki queries:
- each token's Owner Address (`Category:Blue Railroad Tokens`, kept current by the import bot);
- each user page's Ethereum Address.

Addresses match without regard to case. It runs in the reader's browser, not the parser, so a page's cached HTML never freezes an old count in. The result is kept in `localStorage` for ten minutes, so a reader asks once.

**Files:** a ResourceLoader module (`ext.pickipediaContent.blueRailroads`, loaded by the existing `BeforePageDisplay` hook), plus three CSS rules. No PHP beyond that one `addModules` line.

**Checked** by loading the script into live Special:RecentChanges in a headless browser: counts `{"JMyles": 8}`, 34 badges beside JMyles's links, no errors. ![](https://raw.githubusercontent.com/cryptograss/magenta/mockup-thought-dots/mockups/br-userlinks.png) Skyler gets none yet because User:SkymanJenkins has no Ethereum Address (that's on the to-do list for him).

Not linted with PHP here (no php on hunter's shell). The PHP change is one line, in an existing method.