sky-wheel aspect micro-tooltip: give it its OWN portal id so it stops battling the wallet/kit over #id_mini_tooltip_portal — TDD
The Aspected/Unaspected micro-tooltip (the DON|DOFF state read-out, mirroring the
game-kit Equipped/Unequipped chip) showed on the standalone sky.html but NOT on
the home-page SkyDrive applet or the gameroom Sky Select felt. Root cause: the
sky-wheel grabbed #id_mini_tooltip_portal — the SAME element the wallet + game-kit
token tooltips use (wallet.js / wallet-shop.js / gameboard.js). On the home page,
where the My Wallet AND SkyDrive applets coexist, the wallet left an inline
display:none on the shared element that the sky-wheel's class-based `.active`
{display:block} could never override (inline > stylesheet). sky.html only worked
because it has no wallet. Live trace: the element even carried the wallet's
"In-Use: <room>" text while the sky tried to show "Unaspected".
Fix — separate elements, no shared state:
- sky-wheel.js reads its own #id_aspect_mini_portal (not #id_mini_tooltip_portal).
- _gameboard.scss: the italic/right-aligned aspect-portal rule + `.active`
{display:block} rescoped to #id_aspect_mini_portal. The wallet/kit keep
#id_mini_tooltip_portal (_wallet-tokens.scss) untouched.
- home.html now ships BOTH portals (wallet #id_mini_tooltip_portal +
#id_aspect_mini_portal); sky.html renames its portal; room.html adds
#id_aspect_mini_portal in the SKY_SELECT block (covers initial CAST SKY + the
saved-wheel revisit — same #id_sky_tooltip block).
Verified live (Claudezilla): home-page applet + sky.html now show the aspect
micro-tooltip (display:block, "Unaspected" ⇄ "Aspected" on DON|DOFF) with the
wallet element untouched. TDD: SkyWheelSpec +1 — a planet activation touches only
#id_aspect_mini_portal, leaving a sibling #id_mini_tooltip_portal (w. its inline
display:none + content) untouched. 506+1 Jasmine specs green.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -231,6 +231,40 @@ describe("SkyWheel — tick lines, raise, and cycle navigation", () => {
|
||||
expect(sun.classList.contains("nw-planet--active")).toBe(false);
|
||||
});
|
||||
|
||||
// ── Aspect mini-portal id-separation (regression) ───────────────────────
|
||||
// The Aspected/Unaspected micro-portal must live in its OWN element
|
||||
// (#id_aspect_mini_portal), NOT the wallet/kit's #id_mini_tooltip_portal —
|
||||
// on the home page they shared that id and the wallet's inline display:none
|
||||
// stuck, hiding the aspect tooltip. Activating a planet must touch ONLY the
|
||||
// aspect element and leave the wallet element untouched.
|
||||
it("aspect micro-portal uses its own #id_aspect_mini_portal, not the wallet's id", () => {
|
||||
const wallet = document.createElement("div");
|
||||
wallet.id = "id_mini_tooltip_portal";
|
||||
wallet.style.display = "none"; // the wallet's leftover inline state
|
||||
wallet.textContent = "In-Use: Foo"; // the wallet's own content
|
||||
document.body.appendChild(wallet);
|
||||
const aspect = document.createElement("div");
|
||||
aspect.id = "id_aspect_mini_portal";
|
||||
aspect.className = "token-tooltip token-tooltip--mini";
|
||||
document.body.appendChild(aspect);
|
||||
|
||||
// Re-draw so _injectTooltipControls re-binds to the now-present aspect
|
||||
// portal, then activate a planet.
|
||||
SkyWheel.draw(svgEl2, CONJUNCTION_CHART);
|
||||
svgEl2.querySelector("[data-planet='Sun']")
|
||||
.dispatchEvent(new MouseEvent("click", { bubbles: true }));
|
||||
|
||||
// The aspect element got the swap text + .active …
|
||||
expect(aspect.classList.contains("active")).toBe(true);
|
||||
expect(["Aspected", "Unaspected"]).toContain(aspect.textContent);
|
||||
// … and the wallet's element is untouched (no battle).
|
||||
expect(wallet.textContent).toBe("In-Use: Foo");
|
||||
expect(wallet.classList.contains("active")).toBe(false);
|
||||
|
||||
wallet.remove();
|
||||
aspect.remove();
|
||||
});
|
||||
|
||||
// ── T9n ── PRV cycles counterclockwise (to higher ecliptic degree) ────────
|
||||
// CONJUNCTION_CHART merged sorted desc: ASC(180)→Mars(132)→MC(90)→Sun(66.7)→Venus(63.3)
|
||||
// PRV from Sun (pos 3) → MC (pos 2, 90°) — angles and planets share the cycle.
|
||||
|
||||
Reference in New Issue
Block a user