Conversation
- 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)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughAdded 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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Greptile SummaryFive independent dashboard UI fixes: live auth-method preview (passes local toggle state into
Confidence Score: 4/5Safe to merge after reviewing the One P1 security concern: apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/analytics/tables/page-client.tsx — confirm
|
| 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 ❌"]
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
There was a problem hiding this comment.
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
📒 Files selected for processing (5)
apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/analytics/tables/page-client.tsxapps/dashboard/src/app/(main)/(protected)/projects/[projectId]/auth-methods/page-client.tsxapps/dashboard/src/app/(main)/(protected)/projects/[projectId]/email-drafts/page-client.tsxapps/dashboard/src/components/data-table/api-key-table.tsxapps/dashboard/src/components/repeating-input.tsx
|
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. |
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.configinstead of the local pending state.Fix: pass the computed local state (
passwordEnabled,otpEnabled,passkeyEnabled) intoAuthPage'smockProject.configso the preview reflects toggles immediately.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
DropdownMenuItemand phosphor icons default todisplay: block.Fix: use
DropdownMenuItem's built-iniconprop (which absolute-positions the icon) instead of passing it as a child.3. Project-keys status filter: clicking options did nothing visible
DesignDataTablerenders the toolbar outside the card whenglassmorphic && !insideDesignCard. The table instance was captured once viaonTableReady; 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
InternalApiKeyTableinDesignCardsouseInsideDesignCard()returns true,needsOwnCardbecomes false, and the toolbar renders inside theDataTablewhere it re-renders normally. No changes to the sharedDesignDataTablecomponent.4. Analytics "Tables" page only listed Events
AVAILABLE_TABLESwas hardcoded to a single entry.Fix: registered all 12 ClickHouse views that exist in the
defaultschema (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. WidenedTableIdtostring.5. Price input
$prefix overlapped the number on prodThe Input composed
h-9 px-3 ... pl-7. In production's CSS bundle order.px-3declared after.pl-7, sopadding-leftresolved to 12px — same as the prefix'sleft-3position — 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-7inrepeating-input.tsxso the prefix padding wins regardless of CSS order.Test plan
pnpm --filter @stackframe/dashboard typecheckpnpm --filter @stackframe/dashboard lintDesignDataTableusages (api-key-table is the only one wrapped here)Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Style