feat(web): seed the landing demo workspace for first-time /app?demo=1 visitors (0384) - #609
Merged
Conversation
Contributor
|
✓ Changelog fragment found — thanks! |
… visitors (0384) The landing page's 'Try the app' CTAs now link to /app?demo=1. Boot captures the signal into sessionStorage (stripping the param), and once the store is ready <DemoSeed /> runs the curated LANDING_SEED_PROFILE — but only for a fresh profile: any node outside the infrastructure set (seed-excluded system schemas + bundled-plugin install records) vetoes the seed, so a returning user's workspace is never auto-seeded. - @xnetjs/devtools gains a ./seed subpath export (the root barrel is a prod stub, and the seed chunk is dynamic-imported only on demo entry) - vitest root config gets the matching subpath alias (before the bare devtools alias, per the @xnetjs/data/database precedent) - fresh-profile guard covered by apps/web/src/boot/demo-seed.test.ts Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: xNet Test <test@xnet.dev>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: xNet Test <test@xnet.dev>
crs48
force-pushed
the
claude/nostalgic-morse-acc684
branch
from
July 21, 2026 00:01
efe6889 to
eddc488
Compare
Contributor
🖼️ UI changes in this PRNo visual differences detected in the changed UI. |
Contributor
|
Preview removed for PR #609. |
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.
Summary
Exploration 0384 made Try the app — free, no account the landing page's single primary CTA — but it dropped first-time visitors into an empty workspace. This wires the curated
LANDING_SEED_PROFILEinto apps/web so a visitor arriving from the landing CTA opens a lived-in demo workspace instead.How it works
Hero,TheApp,GetStarted) now link to/app?demo=1. The hero's generic Use the app door stays plain/app, preserving a blank-workspace entry.use-boot-sequencecaptures thedemoparam at boot (before the router sees the URL), persists the intent to sessionStorage — so it survives a mid-onboarding reload — and strips the param, mirroring thehub-session.tspattern.<DemoSeed />(insideXNetProvider, next toBundledPluginInstaller) runsmaybeRunDemoSeed, which dynamic-imports the seed and runsrunSeed({ store, ...LANDING_SEED_PROFILE })against the app's own store/worker.Fresh-profile guard
The seed runs only on an explicit demo signal and a profile with no user content: it counts nodes via the storage adapter, discounting infrastructure schemas (
SEED_EXCLUDED_SCHEMA_IDS+PluginSchema— every fresh profile gets bundled-plugin install records before the seed can run). One node in any other schema vetoes the seed, so a returning user who follows a shared/app?demo=1link is never touched. The pending flag is consumed on either outcome; a thrown seed error leaves it set so a reload retries (the seed is idempotent).Plumbing
@xnetjs/devtoolsgains a./seedsubpath export — the root barrel is a prod stub (devtools are compiled out of production), and the seed chunk is dynamic-imported only on demo entry so the main bundle doesn't grow. devtools is changeset-ignored, so no changeset.vitest.config.tsgets the matching subpath alias before the bare devtools alias (same precedent as@xnetjs/data/database).Testing
apps/web/src/boot/demo-seed.test.ts(7 tests): signal capture/strip for both search and hash-routed URLs, seed-once semantics, the existing-user-content veto, and infrastructure-only profiles still counting as fresh.5199+ Playwright):/app?demo=1→ onboarding → workspace auto-populates ([demo-seed] populated the landing demo workspace, pages/databases/chats/CRM all present), and the seeded Tasks Tracker database view renders its 6 rows with zero console errors — thestr.replace-on-non-string crash from the formula/rollup cells is confirmed fixed on this branch (LinkifiedText/linkifyguards +views/properties/textcoercion, fix(views): don't crash database views on formula/rollup cell values #460).🤖 Generated with Claude Code