Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

About:Pharmacopedia.ext: Difference between revisions

From Pharmacopedia
[checked revision][checked revision]
Version bump to 0.9.8.5
0.9.8.6 body amendments: parser tags (CommonUses + problem/effectMedicines), live typeahead, near-control autosave dot, Custom content namespaces section (all 6), Wiki-content pages we maintain
Line 81: Line 81:


<code>DiptychChrome</code> supplies the shared topbar and footer for both. The modules are <code>ext.pharmacopedia.frontpage</code> and <code>ext.pharmacopedia.categoryindex</code>; each carries its own palette tokens so the splash renders correctly with no skin stylesheet loaded.
<code>DiptychChrome</code> supplies the shared topbar and footer for both. The modules are <code>ext.pharmacopedia.frontpage</code> and <code>ext.pharmacopedia.categoryindex</code>; each carries its own palette tokens so the splash renders correctly with no skin stylesheet loaded.
The topbar carries a '''live typeahead search''' as the leftmost item of the right-side topnav cluster. It debounces 180 ms, fetches up to 8 results per keystroke (min 2 chars), and renders an ARIA-combobox dropdown with arrow / Enter / Escape keyboard navigation. The fetch path is hybrid: <code>action=opensearch</code> first (fast prefix index across the eight content namespaces: main, Category, Enzyme, Receptor, Phenotype, USLegal, Problem, Effect), with a <code>action=query&list=search</code> fallback fired on zero hits so all-caps titles like LSD (which opensearch cannot case-insensitively prefix-match against a lowercase query) still resolve.


== Parser tags ==
== Parser tags ==
Line 116: Line 118:
|-
|-
| <code>&lt;categoryindex/&gt;</code> || The two-origin diptych Category index || <code>CategoryIndexTag</code>
| <code>&lt;categoryindex/&gt;</code> || The two-origin diptych Category index || <code>CategoryIndexTag</code>
|-
| <code>&lt;pharmaCommonUses&gt;...&lt;/pharmaCommonUses&gt;</code> || Medicine-page sidebar "Common uses": top-5 problems by rater count, ranked desc; falls back to the legacy hand-entered <code>uses</code> wikitext when zero problems are linked || <code>CommonUsesTag</code>
|-
| <code>&lt;problemMedicines slug="X"/&gt;</code> || Auto-generated list of medicines that carry a <code>&lt;problem ref="X"&gt;</code>. Used on every Problem:&lt;Name&gt; namespace page so the canonical "Medicines used for X" section maintains itself || <code>ProblemMedicinesTag</code>
|-
| <code>&lt;effectMedicines slug="X"/&gt;</code> || Auto-generated list of medicines that carry an <code>&lt;effect ref="X"&gt;</code>. Used on every Effect:&lt;Name&gt; namespace page so the canonical "Medicines that may cause X" section maintains itself || <code>EffectMedicinesTag</code>
|}
|}


Line 537: Line 545:


== Autosave infrastructure ==
== Autosave infrastructure ==
The save-status indicator is a single colored dot (amber = saving, green = saved, red = error) reparented to <code>document.body</code> and pinned to the top-right corner of whichever form control was last manipulated. Position recomputes on scroll + resize so the dot stays on its anchor through the full pending → saving → ✓ saved cycle.


Every block on <code>Special:MyProfile</code> is wrapped in <code>&lt;div data-pcp-save-block="block-name"&gt;</code>. The blocksave.js library:
Every block on <code>Special:MyProfile</code> is wrapped in <code>&lt;div data-pcp-save-block="block-name"&gt;</code>. The blocksave.js library:
Line 824: Line 836:
* <code>UserGetRights</code> + <code>UserEffectiveGroups</code>: verified-provider role wiring
* <code>UserGetRights</code> + <code>UserEffectiveGroups</code>: verified-provider role wiring
* Various special-page registrations via <code>SpecialPage_initList</code>
* Various special-page registrations via <code>SpecialPage_initList</code>
== Custom content namespaces ==
Six dedicated content namespaces sit above NS_MAIN for entities that have their own canonical wiki page beyond the main encyclopedic article surface. All are registered with talk pages (id +1), counted as content, included in default search, and tracked by FlaggedRevs (the FlaggedRevs registration is deferred via <code>$wgExtensionFunctions</code> so it runs after the extension's defaults merge, the same timing fix as the original NS_TEMPLATE block).
{| class="wikitable"
! ID !! Namespace !! Purpose
|-
| 3000 / 3001 || Enzyme: / Enzyme talk: || Drug-metabolizing enzymes (CYPs, UGTs, etc.) with locked-template substrate tables
|-
| 3002 / 3003 || Receptor: / Receptor talk: || Receptor entity pages
|-
| 3004 / 3005 || Phenotype: / Phenotype talk: || PGx phenotype reference pages
|-
| 3006 / 3007 || USLegal: / USLegal talk: || US legal / regulatory status reference pages (Prescription only, OTC, DEA Schedule I-V, plus terse redirects)
|-
| 3008 / 3009 || Problem: / Problem talk: || Per-Problem wiki pages; one per <code>pcp_problem</code> row; <code>p_page_id</code> column links the canonical DB row to its page id; <code>&lt;problemMedicines slug="X"/&gt;</code> auto-emits the medicines list inside each page
|-
| 3010 / 3011 || Effect: / Effect talk: || Per-Effect wiki pages; one per <code>pcp_effects</code> row; <code>e_page_id</code> column links the canonical DB row to its page id; <code>&lt;effectMedicines slug="X"/&gt;</code> auto-emits the medicines list inside each page
|}
The Problem: and Effect: namespaces ship with 170 + 288 auto-created stub pages (one per non-retired row in the canonical tables), produced by <code>maintenance/migrateProblemEffectStubs.php</code>. Each stub carries a one-line "Stub" header, the canonical description if any, the auto-generated medicines section, and the sentinel <code>Category:Problem stubs</code> / <code>Category:Effect stubs</code> for the buildout queue. The migration script is CLI-only, idempotent on re-run, and credits MDElliottMD via <code>EDIT_INTERNAL</code> (skips AbuseFilter + captcha + rate limits per MW convention for ops migrations).
Inbound linkage: every <code>&lt;problem ref="X"&gt;</code> on a medicine page links its problem-card title to <code>Problem:&lt;Name&gt;</code>; every <code>&lt;effect ref="X"&gt;</code> links its label to <code>Effect:&lt;Name&gt;</code>; the sidebar Common-uses list links the same way. <code>Special:Problem/&lt;slug&gt;</code> auto-redirects to the matching NS page when <code>p_page_id</code> is set (the legacy aggregate render stays as a fallback for any unmigrated row).
== Wiki-content pages we maintain ==
Alongside the content articles themselves, the project maintains a small set of canonical wiki-content pages whose state is recorded in this spec doc:
* <code>About:Pharmacopedia.ext</code>: this spec, kept lockstep with extension version (interface-claude updates body + version line on every close-out).
* <code>About:Privacy</code>: site privacy policy, plain-language, covering data collection, third parties (Cloudflare Turnstile + Gmail SMTP + Dropbox-as-encrypted-backup-sub-processor), cookies, retention windows, encryption (Let's Encrypt TLS, PBKDF2-SHA512 passwords, OATHAuth 2FA, AdminCrypto X25519 sealed-box + AES-256-GCM, OAuth 2.0 + PKCE for the iOS app, GPG-AES256 backups), and the manual-today deletion path with the up-to-60-day backup-lag disclosure.
* <code>Category:Pharmaceutical</code> + <code>Category:Plants</code>: the two origin categories; every medicine page belongs to exactly one. Each category page is a descriptive history-first article per the canonical category-page spec.
* The eleven Pendell-class category pages (<code>Category:Euphorica</code>, <code>Category:Evaesthetica</code>, etc.): per-class wiki articles with an opening English-gloss clause sourced from Pendell's trilogy.
* The seven USLegal status pages (<code>USLegal:Prescription only</code>, <code>USLegal:Over-the-counter</code>, <code>USLegal:DEA Schedule I</code>...<code>V</code>) plus 26 terse redirects; medicine pages link these via the MedTemplate <code>legal=</code> field.
* <code>MediaWiki:Sidebar</code>: standard MW sidebar with the local additions (My profile, My assessments, etc.).


== Configuration globals ==
== Configuration globals ==