The latest updates on your projects. Learn more about Vercel for GitHub.
Round three: make AI visible, add offline client notes, and fix the project surfaces#101
Round three of the tester feedback, stacked on #100 so the two rounds stay reviewable apart.
AI is visible before it is unlocked
Eight AI features existed and a visitor without an account never met one. Each now names what it does where it lives, and says what unlocks it.
src/features/ai/ai-availability.tsxis the shared piece:AiLockedNotice(the action, the reason, and the control that fixes it),AiBadge, anduseAiAccount. A surface with no account shows "Sign in to use AI"; a signed-in Workspace with AI switched off shows "Turn on AI in Settings".src/features/ai/ai-tools.tslists all eight actions with the place each one runs, so the menus cannot drift apart. The top bar gains an AI menu (ai-tools-menu.tsx) listing every one of them, and the sidebar marks the hubs that hold them.- Ctrl+K leads with the three actions the feedback named — turn feedback into revisions, draft a client status update, import a brief — and carries the rest under an AI heading. A project action lands on the open project's own view (or its sample-studio twin) rather than on a list.
- Locked notices now replace the action on the deadline risk radar, earnings Q&A, change-order draft, status drafts, brief import, and the revision list, changelog and transcript review. The locked and unlocked labels use the same words.
- The AI switch says what stops it on the switch itself (
aria-describedby), and offers "Connect a workspace" where a workspace is the missing piece.
Client notes offline, with timecodes
Local mode has no comments table, so local-media-version-comments.ts keeps review notes in browser storage beside the Project Outputs they belong to. Each Media Version gets a "Client note" box with an optional timecode parsed by parseReviewTimestamp and rendered by formatReviewTimestamp ("At 1:23"), notes survive a reload and go with the version they belong to, and reading them needs no account and no AI. The Convex comment path and schema are untouched.
Four project-surface fixes
- Client Review needs the cloud, said at creation. Picking a template with a client-review stage in local mode puts that under the field, instead of leaving it for the dead end. Creation is never blocked.
- The version link field. The parser refused real client review links.
vimeo.com/<id>/<hash>, a player link with?h=,www.youtube.com/watch/?v=and the rest of the YouTube shapes are now accepted and canonicalised, and the Vimeo privacy hash is kept on the stored link and the embed — dropping it is why an accepted link then would not play.convex/projectOutputs.tshad its own copy of the parser that also stored the hash-less URL, which is the "saves anyway" half of the report; it now accepts the same shapes with the same messages. Refusals keep the typed value and show the message under the field. - "Open review workspace" went to the Project overview and now goes to the Project's Client Review view.
- The Project menu goes beyond Delete: Duplicate (a new id, "(copy)", the same client, schedule, stages and deliverables, with money and delivery records cleared), Archive (or Restore), Export CSV, and Delete. Permissions gate Duplicate, Archive and Delete; Export is always there.
The sample-load race
Independently: the sample load awaited projectWritesRef, which the setItemsState updater assigns, so with React's deferred updater the await resolved against the previous batch and the first-run screen reported a load while the project writes were still failing. setItems computes from an itemsRef and starts the writes in its own body, so the batch a caller awaits is the batch it started, and the updater has no side effects left. src/lib/data-context.sample-load.test.tsx renders the real cloud provider with Convex stubbed and fails against the previous code with promise resolved "undefined" instead of rejecting.
Verification
pnpm lint, pnpm --dir website lint, pnpm test:unit (259), pnpm test:convex (247) and pnpm build pass. pnpm audit --prod and the Workers Builds: relay-app check are red on main too, unchanged by this branch.
No browser or live-Convex run: this repo has no DOM test harness and live browser checking is out of scope here, so the click-through of the menus, the CSV files, the sample seed and the renamed AI actions rests on static renders, unit tests and builds.
Known limits
- A signed-in person who has not created a team Workspace still sees nothing in the dashboard's radar slot and the Reports panel: those gates ask for a workspace, and the locked notices cover local and signed-out visits. The top-bar AI menu and Settings carry the discovery for that case.
- A locked notice inside the sample studio appears on the version surfaces but not on the dashboard or Reports, which keep their sample-studio guard.
- A duplicate keeps the original's status and checklist progress and clears money and delivery records, which reads as "the same job, ready to run again". Say the word if a copy should start clean instead.
Checks
Failing2
- Failed
- Failed
In progress1
- In progress
Added 15 commits
- feat: show every AI action and what unlocks it10c1103
- Merge remote-tracking branch 'origin/feat/ai-local-visibility' into feat/review-round-313ea50c
- Merge remote-tracking branch 'origin/feat/ai-discoverability' into feat/review-round-31467dc2
- fix: name each AI action the same words in the menu and on its surface174d837
- feat: give AI a home in the nav and in the command menu33d57a1
- fix(project-outputs): accept the same review links in the cloud save path85d90ee
- feat: lock brief import while Workspace AI is off993cc9a
- Merge remote-tracking branch 'origin/feat/local-version-comments' into feat/review-round-3abc7228
- Show every AI feature locked to a local visitadec613
- Merge remote-tracking branch 'origin/feat/project-surface-fixes' into feat/review-round-3af4a965
- test: cover the version surface in a local and a signed-in workspaceb235888
- feat: keep review notes on local Media Versions and lock the version AIb2b537f
- fix(projects): warn about Client Review early and widen the Project surfacesd336d7d
- feat: add the shared AI availability notice and badgede433ce
- Merge remote-tracking branch 'origin/fix/review-round-2' into feat/review-round-3ef08fcd
Note
Currently processing new changes in this PR. This may take a few minutes, please wait...
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
16cff44d-c871-436b-a0b1-a0d2202b68fb
📥 Commits
Reviewing files that changed from the base of the PR and between fae3e7460e15e89fe0cf331d630b87999e363b6d and 22360334ad7488e810a8a7924354de41b567f83d.
📒 Files selected for processing: 50
convex/projectOutputs.test.tsconvex/projectOutputs.tssrc/components/media-version-comments.tsxsrc/components/new-project-dialog.tsxsrc/components/precision-workspaces.tsxsrc/components/project-portal-panel.tsxsrc/components/workspace-shell.test.tsxsrc/components/workspace-shell.tsxsrc/features/ai/ai-availability.tsxsrc/features/ai/ai-tools-menu.tsxsrc/features/ai/ai-tools.test.tssrc/features/ai/ai-tools.tssrc/features/client-portals/internal/status-drafts.test.tsxsrc/features/client-portals/internal/status-drafts.tsxsrc/features/dashboard/dashboard-application.test.tsxsrc/features/dashboard/dashboard-application.tsxsrc/features/dashboard/deadline-risk-radar.test.tsxsrc/features/dashboard/deadline-risk-radar.tsxsrc/features/media-version-comments/local-media-version-comments-data.tssrc/features/media-version-comments/local-media-version-comments-store.test.tssrc/features/media-version-comments/local-media-version-comments-store.tssrc/features/media-version-comments/local-media-version-comments.test.tssrc/features/media-version-comments/local-media-version-comments.tssrc/features/media-version-comments/media-version-comments-data.tssrc/features/media-version-comments/media-version-comments-surface.test.tsxsrc/features/media-version-comments/media-version-comments.tssrc/features/media-version-comments/revision-list.tsxsrc/features/media-version-comments/transcript-review.tsxsrc/features/media-version-comments/version-changelog.tsxsrc/features/project-outputs/project-output-controller.test.tssrc/features/project-outputs/project-output-domain.test.tssrc/features/project-outputs/project-output-domain.tssrc/features/projects/brief-import.test.tsxsrc/features/projects/brief-import.tsxsrc/features/projects/project-actions-provider.test.tsxsrc/features/projects/project-actions-provider.tsxsrc/features/projects/project-workspace.test.tsxsrc/features/projects/project-workspace.tsxsrc/features/reports/earnings-qa.test.tsxsrc/features/reports/earnings-qa.tsxsrc/features/reports/reports-application.test.tsxsrc/features/reports/reports-application.tsxsrc/features/revision-scope/change-order-draft.test.tsxsrc/features/revision-scope/change-order-draft.tsxsrc/features/revision-scope/revision-scope-panel.test.tsxsrc/features/revision-scope/revision-scope-panel.tsxsrc/features/settings/workspace-ai-settings.test.tsxsrc/features/settings/workspace-ai-settings.tsxsrc/lib/project-output-data.test.tssrc/lib/project-output-data.ts
| 1 | +---------------------------------------------------------------------------------------------------+ |
| 2 | | All problems in computer science can be solved with another level of indirection. - David Wheeler | |
| 3 | +---------------------------------------------------------------------------------------------------+ |
| 4 | \ |
| 5 | \ (\__/) |
| 6 | (•ㅅ•) |
| 7 | / づ |
✨ Finishing Touches
📝 Generate docstrings
- Commit to this branch
- Create a new PR
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Comment @coderabbitai help to get the list of available commands.
| … | … | @@ -168,16 +176,23 @@ export function StatusDrafts({ | |
| 169 | 177 | } | |
| 170 | 178 | } | |
| 171 | - | if (!isAuthenticated) return null; | |
| 179 | + | if (!isAuthenticated || !aiEnabled) { | |
Disabling AI makes saved client status drafts inaccessible
Medium Severity
After an Owner disables workspace AI, this early return hides the channel selector and DraftEditor even when saved drafts exist. Users can no longer read, edit, copy, or publish an already-generated client update without enabling AI again. Previously those operations remained available, and statusDrafts.list/update still authorize them without checking aiEnabled; only generation needs consent. Replace the generation controls with the locked notice while keeping saved draft selection and editing available.
Fixed in 2236033. Only the unauthenticated case returns the notice-only surface now. With a signed-in Workspace whose AI is off, the channel selector (shown when aiEnabled || drafts?.length), the saved draft, and Save draft, Copy text and Replace portal note all stay; the locked notice replaces the generate and retry buttons alone, as you say the mutations allow. The new test "keeps a saved draft readable, editable, and publishable while AI is off" asserts exactly that, including that "Retry with better model" is gone.
| … | … | @@ -60,6 +67,84 @@ const projectViews: ReadonlyArray<{ id: ProjectWorkspaceView; label: string }> = | |
| 128 | + | title: output.title, | |
| 129 | + | category: output.category, | |
| 130 | + | initialStatus: output.reviewState, | |
| 131 | + | })), | |
Project copies silently lose deliverables beyond the twelfth
Medium Severity
normalizeStoredItem in src/lib/data-context.tsx truncates templateDeliverables to 12, and this new duplication path passes every actual output through that template field before calling setItems. A valid project with 13 or more active outputs therefore produces a successful-looking copy containing only the first 12, in both local storage and the cloud creation payload. Preserve copied outputs through a duplication path that supports the full output count rather than the template normalization limit.
Fixed in 2236033. Duplicating no longer routes Outputs through templateDeliverables; the copy's Outputs are created through the Outputs store under the copy's own ids (<copyId>:output:N, the same scheme the template path uses, so the copy's panel sees them as materialised rather than re-creating them).
Local mode appends them to the browser record; cloud mode calls api.projectOutputs.create once per Output with its title, category, review state and due date. I used create rather than initializeFromTemplate because that mutation refuses more than twenty Outputs, and the point here is that the copy holds as many as the source. Archived Outputs are not copied, and templateDeliverables stays as the fallback for a Project with no materialised Outputs yet, now cloned rather than aliased. src/lib/project-output-data.test.ts proves thirteen Outputs all arrive, an Output written after mount arrives, review state and due date carry over, and the source is untouched. The old project-workspace.test.tsx expectation that a copy flattens Outputs into the Template list was replaced, since that flattening was the defect.
| … | … | @@ -155,6 +240,37 @@ export function ProjectWorkspace({ | |
| 243 | + | const { setItems, setToast } = useData(); | |
| 244 | + | const { archiveProject } = useProjectActions(); | |
| 245 | + | const access = useProjectAccess(); | |
| 246 | + | const { outputs: projectOutputs } = useProjectOutputs(project, false); | |
Local project duplication reads a stale output snapshot
Medium Severity
useProjectOutputs in src/lib/project-output-data.ts reads local storage only on mount and keeps state independently per caller. This new workspace-level instance therefore never receives output additions, renames, or archives made through ProjectOutputsPanel's separate instance. In local mode, edit an output or add a deliverable and then choose Duplicate project without leaving the workspace: projectCopy uses the old outputs, omitting new deliverables or restoring obsolete definitions. Share the live output state with the panel or obtain a current snapshot when duplicating.
Fixed in 2236033. The workspace-level useProjectOutputs instance is gone; Duplicate now calls useProjectOutputDuplication, which reads the source's Outputs at the moment the action runs, browser storage in local mode and the live projectOutputs.listForProject subscription in cloud mode, and projectCopy no longer takes an outputs argument.
One knock-on is worth flagging: because Duplicate now writes into the same browser record the Outputs panel owns, useProjectOutputs' local write does a read-modify-write against storage instead of against its own mount-time state, otherwise the panel's next edit would have erased the copy's Outputs. That is the same defect class as the comments finding, in the other store.
174d837Open thread| … | … | @@ -0,0 +1,96 @@ | |
| 45 | + | setStored((current) => { | |
| 46 | + | const next = updater(current); | |
| 47 | + | writeLocalMediaVersionComments(next); | |
| 48 | + | return next; | |
Offline note panels overwrite each other's persisted comments
High Severity
ProjectOutputsPanel mounts a MediaVersionComments instance for every output, and each hook reads the same global comments key only once. With outputs A and B open, adding a note to A updates only A's snapshot; adding a note to B then writes B's stale snapshot over the entire store, deleting A's note from persistence. Resolving a comment or pruning versions can cause the same loss. Use a shared synchronized comments store or output-scoped storage instead of replacing the global array from independent hook state.
Fixed in 2236033. You were right: ProjectOutputsPanel mounts one MediaVersionComments per Output, and each hook instance held its own snapshot of the single storage key, so the next write from a sibling panel replaced the whole array.
There is now one store, src/features/media-version-comments/local-media-version-comments-store.ts: a module-level snapshot, a listener set, and a single write path that reads the list as it stands at write time, applies the updater, persists, and notifies every subscriber. Panels read it through useSyncExternalStore and only ever write through it. getSnapshot returns the cached reference until a write replaces it, and a prune that removes nothing is skipped so mounted panels do not re-render on every mount. The storage key and the row shape are unchanged. local-media-version-comments-store.test.ts drives two reads and two writes without React and proves both notes survive in memory and in storage, plus resolution, notification and snapshot caching.
🚀 Deploying Preview to Cloudflare 🚀
Preview URL: https://feat-review-round-3-relay-web.buildin.workers.dev (commit 2236033)
This URL reflects your latest Preview deployment
Preview Deployments by commit
| Status | Deployment URL | Commit | Updated (UTC) | See this deployment's details |
|---|---|---|---|---|
View logs ↗ |
https://4fde9317-relay-web.buildin.workers.dev | 2236033 | 2026-10-15T08:39:22.104Z | Visit the dashboard ↗ |
View logs ↗ |
https://8b3e0e92-relay-web.buildin.workers.dev | 174d837 | 2026-10-15T08:28:52.510Z | Visit the dashboard ↗ |
🚀 Deploying Preview to Cloudflare 🚀
Preview Deployments by commit
| Status | Deployment URL | Commit | Updated (UTC) | See this deployment's details |
|---|---|---|---|---|
View logs ↗ |
2236033 | 2026-10-15T08:40:18.418Z | View logs ↗ | |
View logs ↗ |
174d837 | 2026-10-15T08:30:03.779Z | View logs ↗ |
Added 1 commit
- fix: keep offline notes, Project copies, and saved drafts whole2236033
| … | … | @@ -60,6 +66,85 @@ const projectViews: ReadonlyArray<{ id: ProjectWorkspaceView; label: string }> = | |
| 126 | + | : {}), | |
| 127 | + | ...(project.templateDeliverables | |
| 128 | + | ? { | |
| 129 | + | templateDeliverables: project.templateDeliverables.map( | |
Duplicated projects can regain archived template deliverables
Medium Severity
The changed copy path preserves the source project's entire templateDeliverables list while creating only unarchived outputs through projectOutputCopies. The unchanged initializer in src/lib/project-output-data.ts (lines 322-335) then runs when the duplicate is opened with edit rights: it derives expected output ids from the preserved template list and creates any id missing from the copy. Because archived source outputs are intentionally filtered out of the copy, a source with archived outputs leaves template ids missing, so the duplicate gains an extra active template deliverable that the source no longer shows. In local mode this writes the extra output to browser storage; in cloud mode it calls projectOutputs.initializeFromTemplate. Fix by not carrying stale template entries into a duplicate that already receives its live outputs, or by initializing the copy from the copied outputs without re-running template creation.
Fixed in 0b3e1cd. You found the seam: filtering archived Outputs out of the copy while preserving the source's Template list left those template ids missing, so the initializer in project-output-data.ts re-created the archived deliverable the first time the copy was opened with edit rights.
The copy now carries no Template list at all, and it draws its Outputs from one place: projectOutputPlans, which takes the source's live Outputs when it has any and falls back to its Template plan when it holds none yet (so a Project whose Outputs were never materialised still copies its plan, as real Outputs). That closes both directions: nothing the source no longer shows can be re-created, and nothing planned is lost. projectCopy drops the field, and the test that asserted a copy keeps the Template list was replaced by "carries no Template list, so a copy cannot regain a gone deliverable", which fails against the previous code with expected [ { title: 'Suggested master', …(2) } ] to be undefined. New coverage in src/lib/project-output-data.test.ts also pins the plan fallback and the due date and review state it carries.
pnpm lint, 271 unit tests, 247 convex tests and pnpm build pass.
Correction to the commit above: the fix is 7140078, not 0b3e1cd. Everything else in that reply stands.