Skip to content

OUT-3556 | Implement empty preview state when no clients exist - #227

Merged
arpandhakal merged 3 commits into
mainfrom
OUT-3556
Aug 3, 2026
Merged

arpandhakal merged 3 commits into
mainfrom
OUT-3556

Conversation

@arpandhakal

Copy link
Copy Markdown
Collaborator

Changes

  • Added EmptyClientPreview.tsx component.
  • Introduced isInitialized state which updates when users fetchers are completed.
  • Rendered empty client preview component when isInitialized is true and there are no clients.

Testing Criteria

@linear-code

linear-code Bot commented Jul 31, 2026

Copy link
Copy Markdown

OUT-3556

@vercel

vercel Bot commented Jul 31, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
client-home-v3 Ready Ready Preview Aug 3, 2026 7:49am

Request Review

@greptile-apps

greptile-apps Bot commented Jul 31, 2026

Copy link
Copy Markdown

Greptile Summary

Adds an empty state for previews without clients.

  • Tracks completion of user/client-context initialization in the users store.
  • Safely supports empty client arrays when selecting the initial preview client.
  • Hides the client selector when initialization completes without clients.
  • Adds an action that navigates users to the dashboard client-management page.

Confidence Score: 4/5

The PR appears safe to merge, with a non-blocking inconsistency in how the empty state responds to the mobile and desktop preview controls.

The initialization and empty-array handling are coherent, but the empty-client early return skips the display-mode-aware preview wrapper even though users can still change display modes.

Files Needing Attention: src/features/editor/components/Preview/Preview.tsx

Important Files Changed

Filename Overview
src/features/users/components/UsersSetter.tsx Initializes client and company data once after the users fetch completes, including empty results.
src/features/users/stores/usersStore.ts Adds initialization state and makes initial preview-client selection safe for empty arrays.
src/features/editor/components/Preview/Preview.tsx Selects the new empty state after initialization, but bypasses mobile preview sizing while the display-mode control remains available.
src/features/editor/components/Preview/EmptyClientPreview.tsx Introduces the no-client message and dashboard navigation action.
src/features/editor/components/TopBar/TopBar.tsx Hides the client-selector divider when no clients exist while preserving other preview controls.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Users or client context fetched] --> B[Populate users store]
  B --> C[Set isInitialized]
  C --> D{Clients available?}
  D -->|No| E[Render EmptyClientPreview]
  D -->|Yes| F[Render normal preview]
  E --> G[Add clients action]
  G --> H[Dashboard client-management page]
Loading

Reviews (1): Last reviewed commit: "fix(OUT-3556): implement empty preview s..." | Re-trigger Greptile

Comment thread src/features/editor/components/Preview/Preview.tsx

export const EmptyClientPreview = () => {
const handleAddClients = () => {
const dashboardOrigin = getDashboardOrigin()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am hisitant with the implementatino of getDashboardOrigin. Are you sure it's reliable? What about window.parent or even getting workspace portal url which we should already have.

@priosshrsth priosshrsth left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@arpandhakal
arpandhakal merged commit 0141e7e into main Aug 3, 2026
7 checks passed

This branch was successfully deployed

1 active deployment
Preview — f70b112c Deployed Aug 3, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants