Skip to content

feat(revisions): revision request flow — admin decisions, requests hub, deliverable promotion - #11

Merged
tanthehack merged 6 commits into
mainfrom
feature/revision-flow
Aug 28, 2026
Merged

feat(revisions): revision request flow — admin decisions, requests hub, deliverable promotion#11
tanthehack merged 6 commits into
mainfrom
feature/revision-flow

Conversation

@tanthehack

Copy link
Copy Markdown
Contributor

Builds out the revision request flow end to end — the client raises a change, the studio decides on it, and the outcome links back to a project. Covers docs/backend-requests §7a–§7d.

What's in it

Model (lib/api/models.ts)

  • attachments typed as RevisionAttachment[] ({url, name}) instead of unknown[].
  • decisionNote — the studio's message on a terminal decision, replacing resultingPhaseNote (kept and marked @deprecated so nothing breaks mid-migration).
  • deliverableId — set when a revision is raised from a deliverable rather than from scratch.
  • RevisionApproveInput reshaped: a new-phase approval now authors its phase, milestones[], and endDate inline at approval time.

Admin — components/admin/revisions/revision-detail.tsx

  • Approve-as-phase form with inline milestone authoring.
  • Approve-as-project form.
  • Decline with a required reason, surfaced to the client.
  • Attachment links rendered as real links.

Portal

  • /requests — a cross-project revision hub, plus a Requests tab in the portal shell.
  • Revision card now shows the decision note and links to the resulting project, wording itself "View the new project" vs "View the updated project" depending on whether the approval scaffolded a new project or folded into this one.
  • RevisionCard exported so the hub and the project view share one component.
  • A deliverable's "request changes" now opens a revision pre-linked to that deliverable.

Route paths

This branch predates the clients.* subdomain work, so its new routes were written with the /portal prefix. The rebase onto main merged cleanly because the changes sat in different regions of the same files — which left the Requests nav pointing at /portal/requests directly beside an already-rewritten /projects link.

Under proxy.ts that would have meant a 307 on every Requests click, and startsWith("/portal/requests") would never have matched, so the tab would never highlight. Fixed in 074764f.

Verified

tsc --noEmit clean. eslint clean apart from the pre-existing portal-guard.tsx set-state-in-effect error that is already on main. Routing matrix against the dev server:

Route Host Result
/requests clients.* 200 — "Revision requests — Clover Portal"
/portal/requests clients.* 307 → /requests
/portal/requests primary 200
/, /projects, /login clients.* 200
/admin, /admin/calendar primary 200
/auth-wash.png clients.* 200

No server errors in the dev log.

Backend dependencies

The UI is built against fields the backend does not serve yet — decisionNote, deliverableId, structured attachments, and the reshaped approve payload. Rendering degrades quietly (the note and links are conditional), but the write paths need the endpoints before the flow works against live data.

Related: #4, which carries the docs/backend-requests.md the §7x comments in this diff point at. That doc isn't on main yet, so those references dangle until #4 lands.

…roject form, decline reason, attachment links
This branch predates the clients.* subdomain work, so its new routes
still carried the /portal prefix. The rebase merged cleanly precisely
because the changes sat in different regions of the file — which left
the Requests nav pointing at /portal/requests right next to an
already-rewritten /projects link.

Under proxy.ts, clients.cloverdesign.xyz/portal/requests 307s to
/requests, so the nav would have bounced through a redirect on every
click and the active-state check (startsWith('/portal/requests'))
would never have matched.

  portal-shell:    /portal/requests            → /requests
  portal-revisions: /portal/projects/:id        → /projects/:id
@vercel

vercel Bot commented Aug 21, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
clover-admin Building Building Preview Aug 21, 2026 5:46pm

@tanthehack
tanthehack merged commit 45a8202 into main Aug 28, 2026
2 checks passed
tanthehack added a commit that referenced this pull request Aug 28, 2026
…ms on a phone

Follow-ups from the #11 merge.

- `RevisionApproveInput` didn't carry `decisionNote`, so approvals sent no
  message even though the live endpoint accepts one and puts it in the
  client's approval email ("Note shown to the client alongside the
  approval"). Both approve dialogs now take an optional note, sharing one
  ClientNoteField — the decline path already had this.

- The portal header regressed when #11 added the Requests nav item. Three
  items beside the wordmark and the sign-out needed 431px; an iPhone gives
  375, so it overflowed. The wordmark now drops below `sm` (the clover mark
  still reads as the logo and the link keeps its aria-label) and the pills
  and header gap tighten. Measured 431 → 360, so it fits at 375. It still
  doesn't at 320 — no longer a width worth designing for.

- Preview harness gains a `requests` view and the two new revision fields
  in its fixtures, so #11's hub is visible locally. The approved fixture
  carries a decisionNote, which confirms the display path renders it.
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