[US-13.2 / OBT-243] Change-requests: admin review + manager request flows - #31
Conversation
Add the manager change-request UX. ChangeRequestsSection lists pending create/edit requests as cards (requester name, email, proposed name/code/description) with Accept/Reject; the accept dialog for a project request has a grant-manager-access switch. It is mounted for platform admins on the Projects page (create_project) and Languages page (create_language, edit_language). Managers' New Project / New Language and the per-card language edit pencil submit requests instead of mutating directly; platform admins keep direct create. - changeRequestsAPI + types - ChangeRequestsSection component - ProjectsPage and LanguagesPage manager flows + admin review section
…age, fix visibility - Fix regression: a manager granted a project via an approved change request could not see it. ProjectsPage filtered the list by the manager's organization, but change-request projects have no org, so they were hidden. Removed the org filter; the backend already scopes projects per managed project. - Rework ChangeRequestsSection into a Users-style Requests tab: status filter, EmptyState, status/reason on reviewed cards, language + "New" indicator, and an onReviewed callback for real-time refresh (accepted projects/languages appear without an F5). - Add MyChangeRequestsSection: a manager "My Requests" tab listing their project and language requests with status and the admin's review note. - ProjectFormDialog: request/create a new language inline with a project. - Wire tabs on Projects and Languages; add new-language types. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…admin view Projects shows only the manager's create_project requests; Languages gains a "My Requests" tab with their create/edit language requests. Mirrors the admin Requests tabs so request types are no longer mixed on one page. MyChangeRequestsSection gains an emptyLabel prop for per-page guidance. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Warning Review limit reached
Next review available in: 42 minutes 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: Organization UI Review profile: QUIET Plan: Pro Plus Run ID: 📒 Files selected for processing (10)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
[US-13.2 / OBT-243] Change-requests: admin review toggle, manager "My Requests", real-time + regression fix
Summary
Platform admins review managers' create/edit requests, and managers submit requests instead of mutating directly. This iteration reworks that UI and fixes a regression:
create_projectrequest) could not see it.ProjectsPagewas filtering the list by the manager's organization, but change-request projects have no org, so they were hidden. The backend already scopes projects per-managed-project, so the org filter is removed.Changes
1. Regression —
src/components/pages/ProjectsPage.tsxfetchProjectsno longer sendsorganization_id; it callsprojectsAPI.list(). The backend returns exactly the projects the user manages (per-project), so change-request projects with manager access now appear. Languages are also fetched on mount so project cards show the language name immediately.2. Admin review toggle —
src/components/pages/ChangeRequestsSection.tsx(reworked)Adapted to the
AccessRequestsSectionpattern: aFilterBar(status: pending/approved/rejected/all),EmptyState, status badges, reviewed reason + date, and anonReviewedcallback. Accept dialog keeps the grant manager access toggle for project requests and now notes when a new language will be created. Mounted inside a Requests tab on Projects (create_project) and Languages (create_language+edit_language).3. Manager "My Requests" —
src/components/pages/changeRequests/MyChangeRequestsSection.tsx(new)Lists the caller's own requests (
GET /api/change-requests/mine) with a status filter. Each card shows status and, when reviewed, the admin'sreview_reason. Scoped per page, mirroring the admin view: the Projects page tab shows onlycreate_projectrequests, and the Languages page tab showscreate_language+edit_languagerequests (per-pagekinds+emptyLabel).4. Shared card —
src/components/pages/changeRequests/ChangeRequestCard.tsx(new)Presentational card used by both sections: requester, kind, proposed name/code, language (resolved via the languages store) with a New badge when the request proposes a new language, status badge, review reason, and optional Accept/Reject actions.
5. New language in a project request —
src/components/pages/projects/ProjectFormDialog.tsx(new)Extracts the project create/edit/request dialog. The language Select offers "+ Create a new language"; choosing it reveals name + 3-char code inputs. Managers submit
new_language_name/new_language_codeon the request; platform admins create the language inline, then the project.6. Pages wired with tabs + real-time
ProjectsPage:Projects+ (Requestsfor admin /My Requestsfor manager); admin review passesonReviewed={fetchProjects}.LanguagesPage:Languages+Requests(admin), withonReviewedinvalidating + refetching the languages store.7. Types —
src/types/changeRequest.tsChangeRequestResponse/ChangeRequestCreategainnew_language_name/new_language_code.8. Review-pass hardening
LanguagesPage: full-page spinner only on initial load and controlled Tabs, so reviewing a request no longer flashes a spinner or bounces the admin back to the Languages tab.ChangeRequestCardsubscribes to the languages array (not the stable getter), so language names resolve as soon as languages load instead of sticking as raw ids.ChangeRequestsSection: approving a project request that carries a new language invalidates + refetches the languages store, so the new project card shows the language name.ProjectFormDialog(admin path): after the inline language is created, the form re-points at it, so a retry after a project-create failure doesn't re-create the language and 409.Type of Change
Testing
tsc --noEmit,eslint, andvite buildclean.