first-run-ux: canary foundations + empty states#1149
Merged
Conversation
Three additive pieces that PR-B (welcome modal) will sit on top of, and that already improve UX in their own right by replacing blank list panels with explanatory empty states. 1. UserEntity gains `hasOnboarded?: boolean` (BooleanField, nullable). Per-user, cross-device — falsy on existing rows so the welcome modal (PR-B) defaults to "show." entity_schemas.json regenerated. 2. New shared widget `widgets/shared/ModalWidget.ts` — generic Lit dialog. Reactive `open` / `modalTitle` / `closable` properties; focus trap, Escape + backdrop dismiss, focus restoration on close; role=dialog + aria-modal=true + aria-labelledby out of the box. Slots for default body + footer. Reusable for any future modal need beyond onboarding (settings dialogs, confirms, etc.). 3. New shared widget `widgets/shared/EmptyStateWidget.ts` — `<empty-state>` custom element with icon / title / subtitle / optional action button. Fires `empty-state-action` event when the action is clicked. Drops into any list or content area that can be legitimately empty. Wiring (3 surfaces, all behind a load-completed gate so the empty state never flashes during initial scroller hydration): ReactiveEntityScrollerWidget — new `protected get isEmpty()` returns true only after the scroller's first load has completed AND the entity count is zero. Subclasses use this to decide whether to render an empty UI. ReactiveListWidget — new virtual `renderEmptyState()` returning `nothing` by default; main render hides the container and shows the empty state when `isEmpty` is true. RoomListWidget — overrides `renderEmptyState()`. Copy depends on the active filter (DM filter → "No direct messages yet" / "Open a DM..."; rooms filter → "No rooms yet" / "Rooms are shared spaces..."). No "create your first room" CTA wired yet; left for a follow-up once room-creation UX lands. UserListWidget — overrides `renderEmptyState()`. Copy depends on whether any type/status filter is active. The widget overrides `render()` directly (bypasses base render) so we mirror the same ?hidden + empty-state conditional locally. ChatWidget — uses string-based templates (not Lit), so wired differently. `<empty-state>` element added to renderTemplate with `hidden` set; `updateEntityCount()` is overridden to toggle the attribute based on `getEntityCount() === 0` after every CRUD event + the initial post-load count update. Initial `hidden` prevents flash during room-switch loading. Out of scope (PR-B): welcome modal, first-run gate in MainWidget, write-back of `hasOnboarded=true` on modal completion, tutorial- persona seeding verification. `npm run build:ts` is green. Not visually validated locally — deploy + screenshot is the gate before un-drafting. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
d5d9615 to
853defb
Compare
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.
Refs #1126
Refs #1101
Supersedes the canary-intake portion of draft PR #1107; this branch replays PR-A onto canary without rewriting RebelTechPro fork branch.
Summary
Proof
Notes