Add welcome modal for first-time users (resolves #13)#265
Open
OutstandingRetard wants to merge 3 commits into
Open
Add welcome modal for first-time users (resolves #13)#265OutstandingRetard wants to merge 3 commits into
OutstandingRetard wants to merge 3 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #13
What
Adds a one-time welcome modal that appears the first time a user opens the dashboard. It explains the four main features of CAP v4 (perpetuals, pools, bridge, staking) and links directly to the bridge/Deposit modal.
The modal is gated by a
localStorageflag so returning users don't see it. Users can dismiss it with Got it or Don't show again.Files
src/components/modals/Welcome.svelte(new) — the modal component. Reuses the existingModal.svelteand theme variables. No new dependencies.src/lib/utils.js— addslocalStorageStore(key, defaultValue)helper, a tiny SSR-safe Svelte writable that auto-persists to localStorage. Returns a regularwritableso callers can use$storeas usual.src/components/layout/Modals.svelte— registers the new modal in the existing dispatcher alongside the other 14. No new pattern, no new file structure.Why this approach
Connect.svelte/Settings.svelte/Deposit.sveltestyle exactly. No new abstraction.writable+subscribe. localStorage is a built-in.--primary,--text0,--layer1dot5, etc.cap_welcome_seenflag. Can be re-opened viashowModal('Welcome')from anywhere — easy to wire to a help button later if you want.Test
npm i && npm run devlocalStorage.removeItem('cap_welcome_seen')in DevTools + reload → modal appears again.showModal('Welcome')from the console → modal opens on demand.Screenshots
Will add once maintainers confirm preferred size (520px width used; happy to adjust).
Bounty
I'm claiming the $500 bounty on this issue per the issue body rules. Comment on #13 requesting assignment was already posted.