refactor(console): Settings — tabs, real approval-policy state, invite copy-link, integrations#53
Conversation
…e copy-link, integrations table
|
Warning Review limit reached
Next review available in: 33 seconds Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
… policy activate honest
|
Addressed the Greptile honesty findings in
Gates: build ✓ · typecheck ✓ · lint ✓ (exit 0, no Settings.tsx diagnostics) · test ✓ (68 passing, incl. the 4 Settings tests). No test changes needed. |
Closes #39. Splits Settings into tabs — Team / Approval policy / Recovery / Payees / Integrations — under an org header (name + country + KYB badge). Fixes the approval-policy contradiction: when none exists you get a real "No approval policy configured" empty state with Create default policy (then a "created — review and activate" draft), instead of copy that contradicts the dashboard; the existing require-N-over-$X editor persists via updatePolicy. The team list is now a Member · Email · Role · Status · Actions table (role = neutral MetaPill). Pending invites no longer expose the raw claim URL — Copy link / Resend / Revoke actions instead. Integrations become a Integration · Connected account · Last sync · Status · Actions table with actionable errors (Reconnect on error, Connect on disconnected). Roles matrix behavior is unchanged. Gates: build ✓ · typecheck ✓ (Settings suite updated + green). Part of tracker #41.
Greptile Summary
This PR refactors the Settings screen into five tabs (Team, Approval policy, Recovery, Payees, Integrations) under a new org-identity header, and introduces a "Create default policy" empty state that replaces the misleading "no policy yet" copy. The approval-policy flow now distinguishes between a freshly created session-local draft and a persisted store policy, with honest feedback when the backend create path is absent.
<table>layouts with headers; pending invites hide the raw claim URL behind Copy link / Resend / Revoke actions.createDefault()seeds a local policy with a synthetic ID;save()attemptsapi.updatePolicywith that ID and degrades gracefully to a session-only warning on failure.fireEvent.click("Approval policy")is added before the existing policy assertions to navigate the new tab gate.Confidence Score: 4/5
Safe to merge for UI-only audiences, but several action buttons (Resend, Reconnect, Connect, and Activate policy on a newly created default) produce success-toned feedback without making any backend call, which will mislead users in a production environment until the API integrations are wired up.
The tab restructuring and table layouts are straightforward and well-tested. The main concern is that multiple user-facing actions across the screen fire confirmatory toasts while silently doing nothing on the backend — a pattern that creates incorrect expectations in production. These gaps are documented in earlier review threads but remain unaddressed in this changeset.
apps/console/src/screens/Settings.tsx — specifically the invite Resend handler, the integration Reconnect/Connect handlers, and the Activate policy success path for session-local drafts.
Important Files Changed
org.nameis absent.Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[SettingsScreen] --> B{tab state} B -->|team| C[TeamCard] B -->|policy| D[ApprovalPolicyCard] B -->|recovery| E[RecoveryCard] B -->|payees| F[PayeesCard] B -->|integrations| G[IntegrationsCard] D --> H{storePolicy exists?} H -->|No| I[Empty state\nCreate default policy] H -->|Yes| J[Editor\nAmount + N steppers] I --> K[createDefault\nsetLocalPolicy fake-id] K --> L[Draft banner + Editor] L --> M[Activate policy] M --> N{api.updatePolicy\nfake id} N -->|success| O[refresh → storePolicy set\nActivated toast] N -->|catch| P[localPolicy persisted\nSession-only warning toast] J --> Q[dirty + amountValid?] Q -->|yes| R[api.updatePolicy\nreal id] R --> S[refresh → toast saved]%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% flowchart TD A[SettingsScreen] --> B{tab state} B -->|team| C[TeamCard] B -->|policy| D[ApprovalPolicyCard] B -->|recovery| E[RecoveryCard] B -->|payees| F[PayeesCard] B -->|integrations| G[IntegrationsCard] D --> H{storePolicy exists?} H -->|No| I[Empty state\nCreate default policy] H -->|Yes| J[Editor\nAmount + N steppers] I --> K[createDefault\nsetLocalPolicy fake-id] K --> L[Draft banner + Editor] L --> M[Activate policy] M --> N{api.updatePolicy\nfake id} N -->|success| O[refresh → storePolicy set\nActivated toast] N -->|catch| P[localPolicy persisted\nSession-only warning toast] J --> Q[dirty + amountValid?] Q -->|yes| R[api.updatePolicy\nreal id] R --> S[refresh → toast saved]Reviews (2): Last reviewed commit: "fix(console): Settings — make invite res..." | Re-trigger Greptile