Skip to content

fix(dashboard): Restricted row styling + Replays empty state#1366

Merged
BilalG1 merged 3 commits into
devfrom
fix/ui-bugs-users-analytics
Apr 23, 2026
Merged

fix(dashboard): Restricted row styling + Replays empty state#1366
BilalG1 merged 3 commits into
devfrom
fix/ui-bugs-users-analytics

Conversation

@BilalG1
Copy link
Copy Markdown
Collaborator

@BilalG1 BilalG1 commented Apr 21, 2026

Summary

Two small UI polish fixes in apps/dashboard:

  1. User detail page — the Restricted field now visually matches its sibling fields (User ID, Display name, Primary email, etc.) by reusing the same input-box appearance (rounded-xl border, ring, shadow, h-8). Previously it rendered as a bare button with rounded-md hover styling, which looked out of place in the user details grid.
  2. Analytics → Replays page — the empty state previously read just "No session replays yet" with no guidance. It now shows a short description of what session replays are, and links out to the docs (https://docs.stack-auth.com/docs/apps/analytics) so new users can discover more.

Files changed


Bug 1 — Restricted row no longer visually orphaned

Before, the Restricted row's value (No) was just plain text inside the grid; every other row (User ID, Display name, Primary email, Password, 2-factor auth, Signed up at, Risk scores, Sign-up country code) was rendered inside a styled input box. After the fix, Restricted uses the same boxed style — the row is still clickable and still opens the existing restriction dialog.

Before / after toggle (full page)

user-detail toggle

Cropped view of the changed region (clearer)

user-detail crop toggle

Wipe transition

user-detail wipe

Fade transition

user-detail fade

Pixel diff (only the Restricted cell changes)

user-detail pixel diff


Bug 2 — Replays empty state explains itself

Before, an empty replays workspace showed only "No session replays yet". Users had no signal that there is anything they need to do, or where to look. After the fix, the empty state explains what session replays are, hints that replays will appear once captured, and links to the relevant docs page.

Session replays let you watch how users interact with your app. Replays will appear here once your project starts capturing them.

Learn more in the docs

Before / after toggle (full page)

replays toggle

Cropped view of the empty state

replays crop toggle

Wipe transition

replays wipe

Fade transition

replays fade

Pixel diff

replays pixel diff


Test plan

  • pnpm --filter @stackframe/dashboard run lint passes
  • pnpm --filter @stackframe/dashboard run typecheck passes
  • Manual verification on localhost:8101:
    • User detail page renders Restricted with the same input-box style as siblings
    • Clicking Restricted still opens the existing restriction dialog
    • Replays empty state shows description + working docs link
    • Light mode visually verified (dark mode untouched, classes are dark-mode-aware)

Notes for reviewers

  • No change to RestrictionDialog, getRestrictionReasonText, or any restriction logic — this is purely visual.
  • The replays empty-state copy keeps the existing MonitorPlayIcon and centered layout; only added the description paragraph and the StyledLink (which is already imported in this file).
  • Comparison assets (toggles / fades / wipes / pixel diffs) are hosted in this gist for reference.

Summary by CodeRabbit

  • Style
    • Improved analytics empty state: centered, constrained layout; clearer primary text, added muted secondary explanatory copy and an external documentation link that opens in a new tab.
    • Restyled restricted-user control: refreshed appearance and spacing, truncation for long values, and stronger hover/focus feedback while preserving existing behavior.

- User detail page: restyle the Restricted row so it matches the
  EditableInput appearance used by sibling fields (rounded border,
  ring, shadow, h-8). Previously it was a bare button with rounded-md
  hover styling that looked visually inconsistent with the rest of
  the user details grid.

- Analytics > Replays: replace the bare "No session replays yet"
  empty state with a short description of what session replays do
  and a docs link to https://docs.stack-auth.com/docs/apps/analytics
  so new users can discover how to enable them.
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 21, 2026

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

Project Deployment Actions Updated (UTC)
stack-auth-hosted-components Ready Ready Preview, Comment Apr 23, 2026 0:42am
stack-backend Ready Ready Preview, Comment Apr 23, 2026 0:42am
stack-dashboard Ready Ready Preview, Comment Apr 23, 2026 0:42am
stack-demo Ready Ready Preview, Comment Apr 23, 2026 0:42am
stack-docs Ready Ready Preview, Comment Apr 23, 2026 0:42am
stack-preview-backend Ready Ready Preview, Comment Apr 23, 2026 0:42am
stack-preview-dashboard Ready Ready Preview, Comment Apr 23, 2026 0:42am

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 21, 2026

📝 Walkthrough

Walkthrough

Two small UI updates: the analytics replays empty-state was restyled (centered container, adjusted typography, added explanatory text and external docs link); the users page replaced a borderless "Restricted" button with a wrapped, restyled button that truncates its value. No control-flow or data changes.

Changes

Cohort / File(s) Summary
Analytics Replays Empty State
apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/analytics/replays/page-client.tsx
Centered wrapper (max-w-md mx-auto), primary title no longer muted, added muted secondary descriptive text and StyledLink to external analytics docs (target="_blank").
Users Restricted Status Control
apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/users/[userId]/page-client.tsx
Replaced borderless full-width button with a containing <div> and restyled <button> (rounded-xl, border, variant bg/fg, ring/shadow, hover/focus); displayed value moved into a truncated <span>; dialog behavior unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • session replays #1187: Modifies the same analytics replays page and directly overlaps the page-client.tsx UI changes.

Suggested reviewers

  • nams1570
  • N2D4

Poem

🐰
I hopped the DOM with nimble paws,
Centered words and polished claws.
A link to docs, a trimmed-off name,
Small tidy hops — the UI's game. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the two main changes: Restricted row styling updates and Replays empty state improvements, directly matching the changeset.
Description check ✅ Passed The description comprehensively documents both UI fixes with detailed explanations, visual comparisons, test verification, and reviewer notes, fully satisfying the repository's requirements.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ui-bugs-users-analytics

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 21, 2026

Greptile Summary

Two focused UI polish changes: the Restricted field on the user detail page is re-styled to match sibling read-only inputs, and the Replays empty state now includes a description and a docs link so users understand what the feature is and how to enable it. Both changes are purely presentational with no logic alterations.

Confidence Score: 5/5

Safe to merge — purely visual changes with no logic, data, or security impact.

Both changes are presentational only: CSS class adjustments and adding static copy/a link to the empty state. No business logic, API calls, or state changes are affected. All remaining observations are P2 style suggestions.

No files require special attention.

Important Files Changed

Filename Overview
apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/analytics/replays/page-client.tsx Empty state enriched with a description paragraph and a StyledLink to the docs; container gains max-w-md mx-auto and the title loses text-muted-foreground to increase prominence.
apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/users/[userId]/page-client.tsx RestrictedStatusRow button re-styled with rounded-xl border, ring, shadow, and h-8 to match sibling EditableInput fields; wrapped in a flex div but the relative class has no effect since nothing inside uses absolute positioning.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Replays page loads] --> B{Has replays?}
    B -- Yes --> C[Render replay list / player]
    B -- No --> D{Loading initial?}
    D -- Yes --> E[Show skeleton loader]
    D -- No --> F[Empty state]
    F --> G[MonitorPlayIcon]
    F --> H['No session replays yet' title]
    F --> I[Description paragraph NEW]
    F --> J[StyledLink → docs NEW]
Loading

Reviews (1): Last reviewed commit: "fix dashboard UI: restricted row styling..." | Re-trigger Greptile

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@apps/dashboard/src/app/`(main)/(protected)/projects/[projectId]/users/[userId]/page-client.tsx:
- Around line 325-335: The dialog trigger button that calls setDialogOpen(true)
lacks a descriptive accessible name; update the button (the element with
onClick={() => setDialogOpen(true)} and uses displayValue) to include a clear
aria label or aria-labelledby that includes the field context (e.g.,
"Restricted") plus the current displayValue and an action hint (e.g., "opens
restriction dialog"); ensure aria-haspopup="dialog" or similar is present so
screen readers know this opens the restriction dialog.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d4503602-276c-4dbe-a3d9-7eb8bf500892

📥 Commits

Reviewing files that changed from the base of the PR and between f89b97b and 71453fa.

📒 Files selected for processing (2)
  • apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/analytics/replays/page-client.tsx
  • apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/users/[userId]/page-client.tsx

Replace separate "Learn more in the docs" link with an inline CTA
("For info on enabling replays, look here") inside the description.
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@apps/dashboard/src/app/`(main)/(protected)/projects/[projectId]/analytics/replays/page-client.tsx:
- Around line 1958-1973: Update the external docs link to use descriptive text
and include rel for safety: change the StyledLink text from "look here" to "read
the analytics docs" and add rel="noopener noreferrer" to the StyledLink usage in
the replays page; then extend the LinkProps type in the link component by adding
rel?: string (and ensure the rel prop is forwarded to the underlying
anchor/next/link element in the StyledLink implementation) so the component
accepts and passes through the rel attribute.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1d8f6f4b-8496-443d-9f47-249b84e382f1

📥 Commits

Reviewing files that changed from the base of the PR and between b9e2323 and 2807f35.

📒 Files selected for processing (1)
  • apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/analytics/replays/page-client.tsx

@BilalG1 BilalG1 merged commit 94541c4 into dev Apr 23, 2026
35 checks passed
@BilalG1 BilalG1 deleted the fix/ui-bugs-users-analytics branch April 23, 2026 00:42
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