feat(site): Adds survey overlay to website#4380
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a Tally-powered survey popup to the Lucide docs site. After a 10-second delay, an overlay invites users to take a feedback survey; clicking the CTA lazy-loads Tally's embed script and opens a modal. Dismissal/submission state is tracked in session storage. The unused LayoutTop import is also removed from the theme entry.
Changes:
- New
SurveyAskOverlay.vuecomponent teleported into<body>from the footer override, with delayed appearance and Tally lazy-loading. - Type declarations for
window.Tally.openPopupadded totypes.d.ts. - Cleanup: dead
LayoutTopimport removed fromtheme/index.ts.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| docs/.vitepress/types.d.ts | Adds Tally global type with openPopup signature/options. |
| docs/.vitepress/theme/index.ts | Removes unused LayoutTop import (still referenced in a commented-out slot). |
| docs/.vitepress/theme/components/SurveyAskOverlay.vue | New survey popup component that loads Tally on demand. |
| docs/.vitepress/theme/components/overrides/VPFooter.vue | Mounts SurveyAskOverlay inside the footer override. |
Comments suppressed due to low confidence (4)
docs/.vitepress/theme/components/SurveyAskOverlay.vue:107
- Stray double semicolon in
z-index: 99;;.
z-index: 99;;
docs/.vitepress/theme/components/SurveyAskOverlay.vue:152
- There are two
.ask-overlay.show-popuprule blocks (lines 136-140 and 148-152). They should be consolidated into a single block; splitting them makes maintenance harder and risks one block being modified without the other.
.ask-overlay.show-popup {
transform: translateY(0);
opacity: 1;
pointer-events: auto;
}
.ask-overlay .buttons {
margin-top: 16px;
display: flex;
gap: 16px;
}
.ask-overlay.show-popup {
transition:
opacity 0.5s,
transform 0.25s ease;
}
docs/.vitepress/theme/components/SurveyAskOverlay.vue:43
- The script src uses a protocol-relative URL (
//tally.so/...). Modern guidance is to use an explicithttps:scheme to avoid issues in non-HTTP contexts (e.g. file://) and to make the intent explicit.
s.src = `//tally.so/widgets/embed.js`
docs/.vitepress/theme/components/SurveyAskOverlay.vue:53
- The
try/catcharoundinitTallywon't catch failures of the asynchronously loaded script (e.g. network blocked, ad-blocker rejecting the request, orstartTallyfailing inside theonloadcallback) — the synchronouscreateElement/appendChildcalls don't throw in those cases. To actually fall back to openinghttps://tally.so/r/EkvOpB, attach anonerrorhandler to the script element (and ideally guardstartTallyagainstwindow.Tallybeing undefined).
function initTally() {
try {
if (!isInitialized) {
isInitialized = true
const s = document.createElement('script')
s.src = `//tally.so/widgets/embed.js`
s.async = true
s.onload = startTally
document.body.appendChild(s)
} else {
startTally();
}
} catch (error) {
window.open('https://tally.so/r/EkvOpB', '_blank');
}
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add survey popover for user research
This PR adds a survey popover to the website to help gather feedback and learn more about Lucide users.
The survey is intended to support ongoing user and audience research by helping better understand:
The collected feedback will help guide future product and community decisions.
Notes