Skip to content

[US-13.2 / OBT-243] Change-requests: admin review + manager request flows - #31

Open
levigtri wants to merge 4 commits into
mainfrom
levigft/obt-243-us-132-change-requests-admin-review-on-projects-languages
Open

[US-13.2 / OBT-243] Change-requests: admin review + manager request flows#31
levigtri wants to merge 4 commits into
mainfrom
levigft/obt-243-us-132-change-requests-admin-review-on-projects-languages

Conversation

@levigtri

@levigtri levigtri commented Jul 9, 2026

Copy link
Copy Markdown
Member

[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:

  • Regression fix: a manager granted access to a project (via an approved create_project request) could not see it. ProjectsPage was 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.
  • Admin requests as a toggle (like the Users page): the requests section moved from an always-open block into a Requests tab with a status filter, so it no longer takes over the page.
  • Manager "My Requests" tab: managers get a tab showing their own project and language requests with status, and — once reviewed — the platform admin's description.
  • New language in a project request: a manager's "Request New Project" can propose a brand-new language inline.
  • Real-time: approving/rejecting refreshes the underlying projects/languages list without an F5.

Changes

1. Regression — src/components/pages/ProjectsPage.tsx

fetchProjects no longer sends organization_id; it calls projectsAPI.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 AccessRequestsSection pattern: a FilterBar (status: pending/approved/rejected/all), EmptyState, status badges, reviewed reason + date, and an onReviewed callback. 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's review_reason. Scoped per page, mirroring the admin view: the Projects page tab shows only create_project requests, and the Languages page tab shows create_language + edit_language requests (per-page kinds + 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_code on the request; platform admins create the language inline, then the project.

6. Pages wired with tabs + real-time

  • ProjectsPage: Projects + (Requests for admin / My Requests for manager); admin review passes onReviewed={fetchProjects}.
  • LanguagesPage: Languages + Requests (admin), with onReviewed invalidating + refetching the languages store.

7. Types — src/types/changeRequest.ts

ChangeRequestResponse / ChangeRequestCreate gain new_language_name / new_language_code.

Self-contained off origin/main: this branch duplicates src/components/common/FilterBar.tsx (from US-7.1) so the requests sections can filter by status; integration dedupes it.

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.
  • ChangeRequestCard subscribes 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

  • Bug fix (manager cannot see granted project)
  • Feature (new-language request, manager requests view, toggle UI, real-time refresh)

Testing

  • tsc --noEmit, eslint, and vite build clean.
  • Manual: manager requests a project with a new language → admin Requests tab shows the project + "New" language badge → accept with grant manager → project appears for the manager without refresh; manager's My Requests shows Approved + the admin's note.

levigtri and others added 3 commits July 9, 2026 16:38
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]>
@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@levigtri, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 42 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: QUIET

Plan: Pro Plus

Run ID: a0161374-2b2c-4c88-ae01-0f7dad66807c

📥 Commits

Reviewing files that changed from the base of the PR and between 130fc4a and 983f2ca.

📒 Files selected for processing (10)
  • src/components/common/FilterBar.tsx
  • src/components/pages/ChangeRequestsSection.tsx
  • src/components/pages/LanguagesPage.tsx
  • src/components/pages/ProjectsPage.tsx
  • src/components/pages/changeRequests/ChangeRequestCard.tsx
  • src/components/pages/changeRequests/MyChangeRequestsSection.tsx
  • src/components/pages/projects/ProjectFormDialog.tsx
  • src/services/api.ts
  • src/types/changeRequest.ts
  • src/types/index.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch levigft/obt-243-us-132-change-requests-admin-review-on-projects-languages

Comment @coderabbitai help to get the list of available commands.

@levigtri levigtri self-assigned this Jul 15, 2026
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.

1 participant