fix: sidebar arrow hint stays visible until sidebar actually opens

Previously the welcome page arrow hid immediately when the extension's
content script loaded — but extension loaded ≠ sidebar open. Now the
signal flow is: sidepanel connects → tells background.js → relays to
content script → dispatches gstack-extension-ready → arrow hides.

Adds welcome-page.test.ts: 14 tests verifying arrow, branding, feature
cards, dark theme, and auto-hide behavior via real HTTP server.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Garry Tan
2026-04-04 07:13:12 -07:00
parent 41dccfd25e
commit 43dba47237
5 changed files with 172 additions and 18 deletions
+4 -15
View File
@@ -213,25 +213,14 @@
</div>
<script>
// Hide sidebar prompt when the gstack extension content script fires
// Hide sidebar prompt ONLY when the sidebar is actually opened.
// The content script dispatches 'gstack-extension-ready' when it receives
// a 'sidebarOpened' message from the side panel (via background.js).
// This means the arrow stays visible until the user actually opens the sidebar.
document.addEventListener('gstack-extension-ready', () => {
const prompt = document.getElementById('sidebar-prompt');
if (prompt) prompt.classList.add('hidden');
});
// Fallback: also check for the status pill DOM element
function checkPill() {
if (document.getElementById('gstack-status-pill')) {
const prompt = document.getElementById('sidebar-prompt');
if (prompt) prompt.classList.add('hidden');
return true;
}
return false;
}
let checks = 0;
const interval = setInterval(() => {
if (checkPill() || ++checks > 15) clearInterval(interval);
}, 2000);
checkPill();
</script>
</body>
</html>