Skip to content

Fix five dashboard UI issues#1337

Merged
BilalG1 merged 1 commit intodevfrom
random-dashboard-fixes
Apr 15, 2026
Merged

Fix five dashboard UI issues#1337
BilalG1 merged 1 commit intodevfrom
random-dashboard-fixes

Conversation

@BilalG1
Copy link
Copy Markdown
Collaborator

@BilalG1 BilalG1 commented Apr 15, 2026

Summary

Fixes five independent UI bugs in the dashboard. Each is a narrow, localized fix — no changes to shared table / card primitives.

1. Auth methods preview didn't update until save

Toggling Email/password, Magic link, or Passkey updated the switch UI but the right-hand sign-in preview kept rendering the pre-save config until "Save changes" was clicked. The preview was reading project.config instead of the local pending state.

Fix: pass the computed local state (passwordEnabled, otpEnabled, passkeyEnabled) into AuthPage's mockProject.config so the preview reflects toggles immediately.

Before After
before after

2. Email-drafts "New Draft" dropdown items stacked on two rows

Icon rendered above text in the dropdown because the icon was a child of a non-flex inner wrapper inside DropdownMenuItem and phosphor icons default to display: block.

Fix: use DropdownMenuItem's built-in icon prop (which absolute-positions the icon) instead of passing it as a child.

Before After
before after

3. Project-keys status filter: clicking options did nothing visible

DesignDataTable renders the toolbar outside the card when glassmorphic && !insideDesignCard. The table instance was captured once via onTableReady; filter clicks updated the table's internal state (rows actually filtered to "No results") but the toolbar's parent never re-rendered, so checkboxes, chip count, and button label stayed frozen.

Fix: wrap InternalApiKeyTable in DesignCard so useInsideDesignCard() returns true, needsOwnCard becomes false, and the toolbar renders inside the DataTable where it re-renders normally. No changes to the shared DesignDataTable component.

Before After
before after

4. Analytics "Tables" page only listed Events

AVAILABLE_TABLES was hardcoded to a single entry.

Fix: registered all 12 ClickHouse views that exist in the default schema (events, users, contact_channels, teams, team_member_profiles, team_permissions, team_invitations, email_outboxes, project_permissions, notification_preferences, refresh_tokens, connected_accounts) with sensible default sort columns. Widened TableId to string.

Before After
before after

5. Price input $ prefix overlapped the number on prod

The Input composed h-9 px-3 ... pl-7. In production's CSS bundle order .px-3 declared after .pl-7, so padding-left resolved to 12px — same as the prefix's left-3 position — making $ overlap the first digit. The emulator's bundle happened to order them the other way, which is why it only reproduced in prod. Verified with a devtools injection that mimics the prod CSS ordering.

Fix: change pl-7!pl-7 in repeating-input.tsx so the prefix padding wins regardless of CSS order.

Before (prod CSS ordering) After (same ordering)
before after

Test plan

  • pnpm --filter @stackframe/dashboard typecheck
  • pnpm --filter @stackframe/dashboard lint
  • Manual verification of each issue against the local dev dashboard at localhost:8101
  • Reviewer: confirm no visual regressions on other DesignDataTable usages (api-key-table is the only one wrapped here)
  • Reviewer: confirm analytics queries on added tables work with the signed-in user's permissions

Summary by CodeRabbit

Release Notes

  • New Features

    • Added 12 new analytics tables to the dashboard for enhanced data visibility and tracking.
  • Bug Fixes

    • Fixed input styling issue with prefix alignment.
  • Style

    • Improved visual presentation of data tables with enhanced card styling.
    • Refined dropdown menu icon display for better UI consistency.
    • Enhanced authentication preview settings to reflect current configuration state.

- auth-methods: pass local toggle state into AuthPage preview so preview
  updates live instead of only after save
- email-drafts: use DropdownMenuItem icon prop so icon/text render on one row
- project-keys: wrap InternalApiKeyTable in DesignCard so the faceted-filter
  toolbar stays inside the DataTable render tree and its UI updates live
- analytics/tables: list all ClickHouse views in the sidebar (not just events)
- repeating-input: use !pl-7 so the prefix padding wins over base px-3
  regardless of CSS order (prod vs emulator)
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 15, 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 15, 2026 0:30am
stack-backend Ready Ready Preview, Comment Apr 15, 2026 0:30am
stack-dashboard Ready Ready Preview, Comment Apr 15, 2026 0:30am
stack-demo Ready Ready Preview, Comment Apr 15, 2026 0:30am
stack-docs Ready Ready Preview, Comment Apr 15, 2026 0:30am
stack-preview-backend Ready Ready Preview, Comment Apr 15, 2026 0:30am
stack-preview-dashboard Ready Ready Preview, Comment Apr 15, 2026 0:30am

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 15, 2026

📝 Walkthrough

Walkthrough

Added 12 new analytics table configurations, updated the TableId type to support any table, refined mock authentication configuration, refactored dropdown menu styling to use icon props, wrapped an API key table in a DesignCard component, and applied important CSS override to repeating input padding.

Changes

Cohort / File(s) Summary
Analytics Tables Configuration
apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/analytics/tables/page-client.tsx
Added 12 new table entries to AVAILABLE_TABLES (users, contact_channels, teams, team_member_profiles, team_permissions, team_invitations, email_outboxes, project_permissions, notification_preferences, refresh_tokens, connected_accounts) with display names and sorting defaults. Updated TableId type from specific "events" literal to generic string.
Page Client Updates
apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/auth-methods/page-client.tsx
Extended mock project configuration to include credentialEnabled, magicLinkEnabled, and passkeyEnabled fields derived from auth toggle state.
Email Drafts UI Refactor
apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/email-drafts/page-client.tsx
Refactored dropdown menu items to use icon prop on DropdownMenuItem instead of rendering icons as child elements; removed gap-2 spacing class.
Component Updates
apps/dashboard/src/components/data-table/api-key-table.tsx, apps/dashboard/src/components/repeating-input.tsx
Wrapped DesignDataTable in DesignCard with glassmorphic styling. Updated repeating-input padding class from pl-7 to !pl-7 for important CSS override.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • Payments redesign #1045: Updates to DropdownMenuItem component's icon prop usage and repeating-input styling directly align with changes made in this PR for UI component refinements.

Suggested reviewers

  • N2D4

Poem

🐰 Tables multiply like carrots in spring,
Analytics gardens expanding their wing,
Icons find homes in props so right,
Cards wrap components with glassmorphic light,
UI polish, config bloom—changes take flight! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main objective: fixing five independent dashboard UI issues across multiple components.
Description check ✅ Passed The PR description is comprehensive, well-organized with clear sections for each fix, includes before/after visual evidence, explains root causes, and provides a detailed test plan.

✏️ 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 random-dashboard-fixes

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.

@BilalG1 BilalG1 requested a review from N2D4 April 15, 2026 00:30
@BilalG1 BilalG1 assigned N2D4 and unassigned BilalG1 Apr 15, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 15, 2026

Greptile Summary

Five independent dashboard UI fixes: live auth-method preview (passes local toggle state into mockProject.config), email-drafts dropdown icon layout (uses icon prop), API key table filter re-render (wraps in DesignCard so toolbar renders inside DataTable), analytics Tables page now listing all 12 ClickHouse views, and $ prefix overlap fix (!pl-7).

  • refresh_tokens in analytics: SELECT * FROM default.refresh_tokens exposes all columns of the view — potentially raw token values — through a browsable UI. Even in an admin-only context, refresh tokens are live credentials; consider either excluding this table or projecting only non-sensitive columns in baseQuery.

Confidence Score: 4/5

Safe to merge after reviewing the refresh_tokens analytics exposure — the four other fixes are clean and correct.

One P1 security concern: SELECT * FROM default.refresh_tokens may expose live credentials through the analytics UI. All other fixes are narrowly scoped and correct. Score of 4 reflects the single open security question that should be confirmed before shipping.

apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/analytics/tables/page-client.tsx — confirm refresh_tokens ClickHouse view does not contain raw token values, or scope the query to metadata-only columns.

Security Review

  • Credential exposure — refresh_tokens view: apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/analytics/tables/page-client.tsx adds SELECT * FROM default.refresh_tokens to AVAILABLE_TABLES. If the ClickHouse view retains raw or minimally-obscured token values, any admin who can reach the analytics page (or who compromises an admin account) can enumerate valid refresh tokens for all users in the project. Unlike PII tables (users, contact_channels), refresh tokens are directly usable credentials. The SELECT * projection makes future schema additions (e.g., a new token column) automatically visible without a code change.

Important Files Changed

Filename Overview
apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/analytics/tables/page-client.tsx Registers 11 additional ClickHouse views; refresh_tokens is included with SELECT *, which risks exposing raw token credentials through the analytics UI.
apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/auth-methods/page-client.tsx Passes local passwordEnabled, otpEnabled, passkeyEnabled state into mockProject.config so the sign-in preview updates on toggle without save — correct fix.
apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/email-drafts/page-client.tsx Moves icons from inline children to the icon prop on DropdownMenuItem in both dropdown variants — straightforward fix, no issues.
apps/dashboard/src/components/data-table/api-key-table.tsx Wraps DesignDataTable in an outer DesignCard glassmorphic so useInsideDesignCard() is true and the toolbar renders inside the DataTable, fixing stale filter state; introduces a minor padding change (pt-2 → pt-5).
apps/dashboard/src/components/repeating-input.tsx Changes pl-7 to !pl-7 (Tailwind !important modifier) to ensure prefix padding wins regardless of CSS bundle order — correct fix.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["InternalApiKeyTable"] --> B["DesignCard glassmorphic (new outer wrapper)"]
    B --> C["DesignDataTable (no glassmorphic prop)"]
    C --> D{"useInsideDesignCard()"}
    D -->|"true (fixed)"| E["needsOwnCard = false"]
    E --> F["div.borderReset > DataTable"]
    F --> G["Toolbar renders INSIDE DataTable tree ✅"]

    D2{"OLD: useInsideDesignCard()"}
    D2 -->|"false (bug)"| E2["needsOwnCard = true"]
    E2 --> F2["Toolbar rendered OUTSIDE via table ref"]
    F2 --> G2["Filter clicks update rows but toolbar parent never re-renders ❌"]
Loading
Prompt To Fix All With AI
This is a comment left during a code review.
Path: apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/analytics/tables/page-client.tsx
Line: 107-112

Comment:
**`refresh_tokens` exposed via `SELECT *`**

Adding `refresh_tokens` to `AVAILABLE_TABLES` with `baseQuery: "SELECT * FROM default.refresh_tokens"` will render all columns of that ClickHouse view — including any raw or hashed token values — in the analytics UI. Unlike the other tables (`users`, `contact_channels`, etc.), refresh tokens are live credentials that can be used to impersonate users. Even in an admin-only context, surfacing them through a browsable table increases attack surface if an admin account is compromised. Consider either (a) excluding `refresh_tokens` from this UI, or (b) projecting only non-sensitive columns (`user_id`, `created_at`, `revoked_at`, etc.) in the `baseQuery`.

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: apps/dashboard/src/components/data-table/api-key-table.tsx
Line: 147-155

Comment:
**Content padding differs from previous rendering**

When `DesignDataTable` internally created its own `DesignCard`, it passed `contentClassName={cn("pt-2", borderReset)}`, resulting in `pt-2` (8 px) top padding inside the card. The new outer `<DesignCard glassmorphic>` has no `contentClassName`, so `bodyPaddingClass = "p-5"` (20 px) applies uniformly on all sides. The table header will now sit visibly lower than before. If the original `pt-2` was intentional, forward it via `contentClassName`:

```tsx
return (
  <DesignCard glassmorphic contentClassName="pt-2">
    <DesignDataTable
      ...
    />
  </DesignCard>
);
```

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "Fix five dashboard UI issues" | Re-trigger Greptile

Comment thread apps/dashboard/src/components/data-table/api-key-table.tsx
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/tables/page-client.tsx:
- Line 120: AVAILABLE_TABLES is currently typed too loosely and TableId is just
string; change AVAILABLE_TABLES to be a compile-time literal (use an object with
a const assertion, e.g. declare the mapping with "as const" or convert the Map
to a const-record) and then derive TableId from its keys with "type TableId =
keyof typeof AVAILABLE_TABLES"; remove the runtime "as TableId" cast at the
selection callsite (where the table ID is passed/selected) so the compiler
enforces valid table IDs; reference symbols: AVAILABLE_TABLES and TableId.
🪄 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: 3f36e157-f89b-4fcf-a5b3-bdfd7a3165d6

📥 Commits

Reviewing files that changed from the base of the PR and between 88d3317 and b9dbdb4.

📒 Files selected for processing (5)
  • apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/analytics/tables/page-client.tsx
  • apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/auth-methods/page-client.tsx
  • apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/email-drafts/page-client.tsx
  • apps/dashboard/src/components/data-table/api-key-table.tsx
  • apps/dashboard/src/components/repeating-input.tsx

@github-actions github-actions Bot assigned BilalG1 and unassigned N2D4 Apr 15, 2026
@BilalG1 BilalG1 merged commit c66bdfb into dev Apr 15, 2026
43 checks passed
@BilalG1 BilalG1 deleted the random-dashboard-fixes branch April 15, 2026 02:38
@promptless
Copy link
Copy Markdown
Contributor

promptless Bot commented Apr 15, 2026

Promptless prepared a documentation update related to this change.

Triggered by PR #1337

Updated the Analytics documentation to list all 12 available ClickHouse tables. Previously only the Events table was documented; now users can see the full list including users, teams, contact_channels, and more.

Review: Update Analytics Tables documentation

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