בס״ד

Portal Shared Engine — the ONE place behavior lives

docs/PORTAL_SHARED_ENGINE.md · last changed (pre-VM history) · rendered from GitHub master

Portal Shared Engine — the ONE place behavior lives

Created 2026-06-03 (Grand Central consolidation). The fix for the disease Sam named: "improvements get built into ONE page and don't propagate." Now there is a single shared layer every portal surface imports, so a fix propagates instead of being hand-copied.

The two shared files (in outputs/)

File What it owns Page uses it via
hs-core.js ops-api base URL, inbox(cmd), cards(json), ok(json)/errOf(json), esc(s), peek(sym), plaid(fresh), health(), hebrew(), skin(name) <script src="hs-core.js"></script> then call HS.*
hs-theme.css the palette, per audience, as CSS tokens scoped by <body data-skin="sam\|chanie\|mildred\|briefings"> <link rel="stylesheet" href="hs-theme.css"> + set data-skin

HS is a global (window.HS). Load hs-core.js synchronously before a page's inline JS so HS exists when it runs.

Why this kills the drift

Adoption status (migrate incrementally — never a big-bang rewrite)

The rule

When you fix a portal behavior or color, fix it in hs-core.js / hs-theme.css and let pages inherit. Don't hand-edit the same fix into multiple pages — that is the exact thing this engine exists to end. See docs/HOME_DIRECTIVE.md (canonical home = home.html).

Source trail · docs/PORTAL_SHARED_ENGINE.md @ master · rendered 2026-07-02 7:23 PM EDT by scripts/build-docs.py · the .md in the repo is the truth; this page is the phone-readable view