← All Pull Requests

adom-3d: show the Shift+Alt hint once, not twice #5

Merged opened by John Lauer 2026-10-11

The canonical viewer (0.9.1) shows the same first-visit hint twice: its pivot chip ("Tip: Shift+Alt+Click sets the orbit center", #41) and its help tip ("Shift+Alt+click a point to orbit around it", 0.7.3). In a widget frame the seen flags cannot persist, so both come back on every load. The widget now hides the pivot chip except while Shift+Alt is held, where it is the live indicator. The real fix belongs in adom/adom-3d-viewer; this keeps the widget clean until it lands.

🤖 Generated with Claude Code

Diff Skip to comments

--- a/widgets/model-3d-widget.js+++ b/widgets/model-3d-widget.js@@ -1,128 +1,133 @@⋯ 54 unchanged lines ⋯       this.attachShadow({ mode: 'open' });       // in a wiki frame: no page margin, and nothing the viewer adds (its tip bubble) may give the frame a scrollbar       if (window.self !== window.top) { document.documentElement.style.overflow = 'hidden'; document.body.style.margin = '0'; }+      // the viewer shows the same Shift+Alt hint twice on first load (its pivot chip and its help tip; in a frame the+      // "seen" flag cannot persist, so both return every time): keep the chip only as the live "keys held" indicator+      if (!document.getElementById('adom-3d-hint')) { const st = document.createElement('style'); st.id = 'adom-3d-hint';+        st.textContent = '.viewer-container:not(.pivot-mode) .pivot-chip { display: none !important; }'; document.head.appendChild(st); }       this._src = this.getAttribute('src');       this._poster = this.getAttribute('poster');       this._idle();⋯ 65 unchanged lines ⋯   }   if (!customElements.get('adom-3d')) customElements.define('adom-3d', Adom3D); })();+

Comments

No comments yet.

Log in to comment.