migrate(admin): SDK admin and SDK app to Apsara v1 (rc.6)#1600
Conversation
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughLarge-scale migration to ChangesApsara v1 and Frontier client migration
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
|
Coverage Report for CI Build 26091377587Coverage remained the same at 42.472%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
There was a problem hiding this comment.
Actionable comments posted: 11
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
web/sdk/admin/components/multiselect/multiselect/index.tsx (1)
77-84:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winAdd
data-test-idattribute for the Clear action.Consistent with the options above, the Clear button should also have a
data-test-idattribute for test automation.🧪 Proposed fix
-<Command.Item onClick={onClear}> +<Command.Item onClick={onClear} data-test-id="admin-multiselect-clear"> <Flex justify="center"web/sdk/admin/views/organizations/details/edit/organization.tsx (1)
127-127:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winReview the watch default value for better UX.
The watch call uses
"other"as the default value: whentypeis undefined (which it is initially sincedefaultValuesis{}),watchreturns"other", causingshowOtherTypeFieldto betrueand the "industry (other)" field to display before the user selects an industry.Consider removing the default parameter so the field only appears after the user explicitly selects "Other":
Proposed fix
- const showOtherTypeField = watch("type", "other") === "other"; + const showOtherTypeField = watch("type") === "other";web/sdk/admin/views/users/details/security/sessions/revoke-session-final-confirm.tsx (1)
23-31:⚠️ Potential issue | 🟠 Major | ⚡ Quick winAwait
onConfirmto handle async operations properly.At line 25,
onConfirm()is not awaited inside the asynctry/catch. If the callback is ever async, promise rejections will not be caught and error handling will be bypassed. While the current call sites pass synchronous functions, the component should support async callbacks for better flexibility.Proposed fix
interface RevokeSessionFinalConfirmProps { isOpen: boolean; onOpenChange: (isOpen: boolean) => void; - onConfirm: () => void; + onConfirm: () => void | Promise<void>; isLoading?: boolean; } @@ const handleConfirm = async () => { try { - onConfirm(); + await onConfirm(); onOpenChange(false); } catch (error: any) { toastManager.add({
♻️ Duplicate comments (1)
web/sdk/admin/components/SheetHeader.tsx (1)
3-3:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winVerify the apsara-v1 Text API usage.
Same verification concern as in
web/apps/admin/src/components/sheet/header.tsx: confirm thatsize="regular"andweight="medium"are valid apsara-v1 Text props and produce the expected visual output.Also applies to: 14-16
🧹 Nitpick comments (1)
web/sdk/admin/views/organizations/details/layout/invite-users-dialog.tsx (1)
129-139: 💤 Low valueType assertion could be avoided.
The
as stringcast suggests TypeScript can't infer the type. Since the zod transform (line 36) runs only at validation time,field.valueshould always be a string during rendering. The defensiveArray.isArray()check is likely unnecessary.♻️ Simplify by removing defensive logic
render={({ field }) => { - const { value, ...rest } = field; return ( <TextArea - {...rest} - value={Array.isArray(value) ? value.join(", ") : (value ?? "") as string} + {...field} + value={field.value ?? ""} placeholder="abc@example.com, xyz@example.com" className={styles['invite-users-emails-textarea']} /> ); }}
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 3dfe76d2-419d-425d-b9d0-5016a365c7d8
⛔ Files ignored due to path filters (1)
web/pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (126)
web/apps/admin/package.jsonweb/apps/admin/src/App.tsxweb/apps/admin/src/components/Layout.tsxweb/apps/admin/src/components/Price.tsxweb/apps/admin/src/components/Sidebar/index.tsxweb/apps/admin/src/components/Sidebar/sidebar.module.cssweb/apps/admin/src/components/assign-role.tsxweb/apps/admin/src/components/collapsable-search/index.tsxweb/apps/admin/src/components/dialog/header.tsxweb/apps/admin/src/components/error-boundary.tsxweb/apps/admin/src/components/page-header.tsxweb/apps/admin/src/components/sheet/header.tsxweb/apps/admin/src/components/states/Loading.tsxweb/apps/admin/src/components/states/Unauthorized.tsxweb/apps/admin/src/configs/theme.tsxweb/apps/admin/src/containers/login.tsxweb/apps/admin/src/containers/magiclink.tsxweb/apps/admin/src/hooks/useRQL.tsxweb/apps/admin/src/layout/auth.tsxweb/apps/admin/src/main.tsxweb/apps/admin/src/routes.tsxweb/apps/admin/src/utils/transform-query.tsweb/sdk/admin/components/AssignRole.tsxweb/sdk/admin/components/CustomField.tsxweb/sdk/admin/components/PageHeader.tsxweb/sdk/admin/components/SheetFooter.tsxweb/sdk/admin/components/SheetHeader.tsxweb/sdk/admin/components/multiselect/multiselect/index.tsxweb/sdk/admin/views/admins/columns.tsxweb/sdk/admin/views/admins/index.tsxweb/sdk/admin/views/audit-logs/actor-cell.tsxweb/sdk/admin/views/audit-logs/columns.tsxweb/sdk/admin/views/audit-logs/index.tsxweb/sdk/admin/views/audit-logs/navbar.tsxweb/sdk/admin/views/audit-logs/sidepanel-details.tsxweb/sdk/admin/views/audit-logs/sidepanel-list-id.tsxweb/sdk/admin/views/audit-logs/sidepanel-list-link.tsxweb/sdk/admin/views/audit-logs/sidepanel-log-dialog.tsxweb/sdk/admin/views/invoices/columns.tsxweb/sdk/admin/views/invoices/index.tsxweb/sdk/admin/views/invoices/navbar.tsxweb/sdk/admin/views/organizations/details/apis/columns.tsxweb/sdk/admin/views/organizations/details/apis/details-dialog.tsxweb/sdk/admin/views/organizations/details/apis/index.tsxweb/sdk/admin/views/organizations/details/edit/billing.tsxweb/sdk/admin/views/organizations/details/edit/kyc.tsxweb/sdk/admin/views/organizations/details/edit/organization.tsxweb/sdk/admin/views/organizations/details/invoices/columns.tsxweb/sdk/admin/views/organizations/details/invoices/index.tsxweb/sdk/admin/views/organizations/details/layout/add-tokens-dialog.tsxweb/sdk/admin/views/organizations/details/layout/index.tsxweb/sdk/admin/views/organizations/details/layout/invite-users-dialog.tsxweb/sdk/admin/views/organizations/details/layout/navbar.tsxweb/sdk/admin/views/organizations/details/members/columns.tsxweb/sdk/admin/views/organizations/details/members/index.tsxweb/sdk/admin/views/organizations/details/members/remove-member.tsxweb/sdk/admin/views/organizations/details/pat/columns.tsxweb/sdk/admin/views/organizations/details/pat/components/pat-details-dialog.tsxweb/sdk/admin/views/organizations/details/pat/index.tsxweb/sdk/admin/views/organizations/details/projects/columns.tsxweb/sdk/admin/views/organizations/details/projects/index.tsxweb/sdk/admin/views/organizations/details/projects/members/add-members-dropdown.tsxweb/sdk/admin/views/organizations/details/projects/members/assign-role.tsxweb/sdk/admin/views/organizations/details/projects/members/columns.tsxweb/sdk/admin/views/organizations/details/projects/members/index.tsxweb/sdk/admin/views/organizations/details/projects/members/remove-member.tsxweb/sdk/admin/views/organizations/details/projects/rename-project.tsxweb/sdk/admin/views/organizations/details/projects/use-add-project-members.tsxweb/sdk/admin/views/organizations/details/security/block-organization.tsxweb/sdk/admin/views/organizations/details/security/domains-list.tsxweb/sdk/admin/views/organizations/details/security/index.tsxweb/sdk/admin/views/organizations/details/side-panel/billing-details-section.tsxweb/sdk/admin/views/organizations/details/side-panel/index.tsxweb/sdk/admin/views/organizations/details/side-panel/kyc-section.tsxweb/sdk/admin/views/organizations/details/side-panel/org-details-section.tsxweb/sdk/admin/views/organizations/details/side-panel/plan-details-section.tsxweb/sdk/admin/views/organizations/details/side-panel/tokens-details-section.tsxweb/sdk/admin/views/organizations/details/tokens/columns.tsxweb/sdk/admin/views/organizations/details/tokens/index.tsxweb/sdk/admin/views/organizations/list/columns.tsxweb/sdk/admin/views/organizations/list/create.tsxweb/sdk/admin/views/organizations/list/index.tsxweb/sdk/admin/views/organizations/list/navbar.tsxweb/sdk/admin/views/plans/columns.tsxweb/sdk/admin/views/plans/details.tsxweb/sdk/admin/views/plans/header.tsxweb/sdk/admin/views/plans/index.tsxweb/sdk/admin/views/preferences/PreferencesView.tsxweb/sdk/admin/views/preferences/columns.tsxweb/sdk/admin/views/preferences/details.tsxweb/sdk/admin/views/preferences/index.tsxweb/sdk/admin/views/products/columns.tsxweb/sdk/admin/views/products/details.tsxweb/sdk/admin/views/products/header.tsxweb/sdk/admin/views/products/index.tsxweb/sdk/admin/views/products/prices/columns.tsxweb/sdk/admin/views/products/prices/index.tsxweb/sdk/admin/views/roles/columns.tsxweb/sdk/admin/views/roles/details.tsxweb/sdk/admin/views/roles/header.tsxweb/sdk/admin/views/roles/index.tsxweb/sdk/admin/views/users/details/layout/layout.tsxweb/sdk/admin/views/users/details/layout/membership-dropdown.tsxweb/sdk/admin/views/users/details/layout/navbar.tsxweb/sdk/admin/views/users/details/layout/side-panel-details.tsxweb/sdk/admin/views/users/details/layout/side-panel-membership.tsxweb/sdk/admin/views/users/details/layout/side-panel.tsxweb/sdk/admin/views/users/details/layout/suspend-user.tsxweb/sdk/admin/views/users/details/security/block-user.tsxweb/sdk/admin/views/users/details/security/security.tsxweb/sdk/admin/views/users/details/security/sessions/index.tsxweb/sdk/admin/views/users/details/security/sessions/revoke-session-confirm.tsxweb/sdk/admin/views/users/details/security/sessions/revoke-session-final-confirm.tsxweb/sdk/admin/views/users/details/security/sessions/session-skeleton.tsxweb/sdk/admin/views/users/details/user-details.tsxweb/sdk/admin/views/users/list/columns.tsxweb/sdk/admin/views/users/list/invite-users.tsxweb/sdk/admin/views/users/list/list.tsxweb/sdk/admin/views/users/list/navbar.tsxweb/sdk/admin/views/webhooks/webhooks/columns.tsxweb/sdk/admin/views/webhooks/webhooks/create/index.tsxweb/sdk/admin/views/webhooks/webhooks/delete/index.tsxweb/sdk/admin/views/webhooks/webhooks/header.tsxweb/sdk/admin/views/webhooks/webhooks/index.tsxweb/sdk/admin/views/webhooks/webhooks/update/index.tsxweb/sdk/react/components/auth-header/auth-header.tsx
💤 Files with no reviewable changes (1)
- web/apps/admin/src/routes.tsx
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…gle (CLD-3132) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… dialog (CLD-3147) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…g stacks correctly Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…c.6 and adjust imports accordingly
…vigation in admin columns
…ed multiselect functionality in CustomField
Summary
sdk/admin/(103 files) andapps/admin/src/(22 files) from Apsara v0 → v1 (rc.6).@raystack/frontier/react(v0) →@raystack/frontier/client(v1). Trims ~680 KB JS / ~80 KB CSS from the admin bundle.AuthHeaderto passalign="center"to the innerHeadline(was defaulting to left).Scope
<Toast.Provider>mounted inmain.tsx; v0ToastContainerandsonnerremoved.sdk/react/views/left on v0 intentionally (out of scope);views-new/is already on v1 and surfaced via the/clientexport.Test plan
pnpm vite buildsucceeds; bundle smaller than mainpnpm exec tsc --noEmitis clean forapps/admin; SDK matches pre-migration baseline (30 pre-existing, 0 net new)