Skip to content

feat: add customisable button slots to service account views#1707

Merged
rohanchkrabrty merged 2 commits into
mainfrom
feat-disable-prop-service-account
Jun 18, 2026
Merged

feat: add customisable button slots to service account views#1707
rohanchkrabrty merged 2 commits into
mainfrom
feat-disable-prop-service-account

Conversation

@rohanchkrabrty

Copy link
Copy Markdown
Contributor

Summary

  • Introduce a generic Slot<TContext> render-prop type in shared/types.ts so consumers can customise internal view elements while keeping the customisation on their side.
  • Add a slots.addAccountButton slot to ServiceAccountsView (header toolbar + empty state), exposing the onClick handler and permission-derived disabled state.
  • Add a slots.generateKeyButton slot to ServiceAccountDetailsView, threaded into the token form and exposing the form's loading/disabled state.
  • Default buttons render as the conditional fallback, so behaviour is unchanged when no slot is provided.

@vercel

vercel Bot commented Jun 18, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
frontier Ready Ready Preview, Comment Jun 18, 2026 5:05am

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 855f4b01-8f3e-4600-8cf0-ccb81fa1b964

📥 Commits

Reviewing files that changed from the base of the PR and between b9071fc and 05c8399.

📒 Files selected for processing (1)
  • web/sdk/client/views/service-accounts/components/add-token-form.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • web/sdk/client/views/service-accounts/components/add-token-form.tsx

📝 Walkthrough

Summary by CodeRabbit

New Features

  • Service account details now allow customizing the “Generate new key” button for API key creation.
  • Service accounts list now allows customizing the “Add service account” button.
  • Introduced a slot-based UI customization pattern to support flexible component overrides.

Walkthrough

Adds a shared generic Slot<TContext> render-prop type to web/sdk/shared/types.ts. Uses it to introduce optional generateKeyButton slot on AddTokenForm and ServiceAccountDetailsView, and an optional addAccountButton slot on ServiceAccountsView, with a centralized handleAddServiceAccount handler and a useQuery select fix.

Changes

Service Account View Slot Customization

Layer / File(s) Summary
Shared Slot type
web/sdk/shared/types.ts
Exports new JSDoc-documented generic Slot<TContext> type as a render-prop function from context to React.ReactNode.
generateKeyButton slot in AddTokenForm and ServiceAccountDetailsView
web/sdk/client/views/service-accounts/components/add-token-form.tsx, web/sdk/client/views/service-accounts/service-account-details-view.tsx
AddTokenFormProps gains an optional generateKeyButton?: Slot<{ onClick; loading; disabled }> prop; the form conditionally renders it over the default submit button when provided. ServiceAccountDetailsViewProps adds slots.generateKeyButton, forwarded to AddTokenForm. useQuery adds a select to unwrap serviceuser directly from the response.
addAccountButton slot in ServiceAccountsView
web/sdk/client/views/service-accounts/service-accounts-view.tsx
ServiceAccountsViewProps adds slots.addAccountButton render-prop. A shared handleAddServiceAccount function is introduced; both the empty-state primaryAction and table toolbar conditionally render the slot or fall back to the default button. The unused exclamation-triangle.svg import is removed.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested reviewers

  • rohilsurana
  • rsbh
  • paanSinghCoder
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
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.


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.

@coveralls

coveralls commented Jun 18, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 27737972209

Coverage remained the same at 43.631%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 37036
Covered Lines: 16159
Line Coverage: 43.63%
Coverage Strength: 12.39 hits per line

💛 - Coveralls

Comment thread web/sdk/client/views/service-accounts/components/add-token-form.tsx
@rohanchkrabrty rohanchkrabrty merged commit 6dc16f9 into main Jun 18, 2026
8 checks passed
@rohanchkrabrty rohanchkrabrty deleted the feat-disable-prop-service-account branch June 18, 2026 07:30
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.

4 participants