#616 Show Managers Who Has A Draft Application, Without Exposing Answers - #674
#616 Show Managers Who Has A Draft Application, Without Exposing Answers#674b-at-neu wants to merge 3 commits into
Conversation
Adds a purpose-built read path (getDraftApplications) so a manager or admin sees who has started an application for their position, without ever exposing answers, files, or the draft detail page. listable, reviewable, and getApplicationForReview stay untouched. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
b-at-neu
left a comment
There was a problem hiding this comment.
Code Review — Cycle 1 · needs revision
2 open — 2 🟡 Low (see inline)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Revision — Cycle 1fixed R1-L1, R1-L2 · 78904ec |
b-at-neu
left a comment
There was a problem hiding this comment.
Code Review — Cycle 2 · approved
0 open — clean
Feedback from human design reviewSimplify the draft-visibility UI — three changes:
Keep everything else: the "Draft" status filter option, the identity-only |
Drop the persistent DraftsInProgressNotice card and the bespoke DraftApplicationsTable/Results; drafts now render through the same ApplicationsTable/ApplicationsResults, with an isDraftView flag switching columns, sort fields and the inert row treatment. The privacy explainer moves above the table and only shows in draft view; the Draft filter option gains a small count instead. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Revision — human design reviewAddressed the design-review comment above: deleted |
Closes #616
Summary
getDraftApplications/getDraftApplicationsCount) that selects only identity and timestamps, never answers or files.buildApplicationWhere,getApplicationForReview, andREVIEWER_APPLICATION_STATUSESare all deliberately untouched —/manage/applications/[id]still 404s for a draft, for managers and admins alike.Draft) swaps the results region for an inert, identity-only table, and a "N applications in progress" strip under the page header keeps the count visible without filtering.Changes
prisma/data/applications.ts—getDraftApplications/getDraftApplicationsCountplus privatebuildDraftListWhere/buildDraftListOrderBy;buildApplicationListWhereguarded so adraftstatus filter can never overwritelistable's ownstatus: { not: 'draft' }.lib/types.ts—DraftApplicationListItem(nostatus, noapplicantName, no answer relations) andApplicationStatusFilter; widenedApplicationFilters['status']. Removed the now-deadReviewerStatusalias.lib/constants.ts— comment-only change:APPLICATION_STATUS_VALUES/APPLICATION_STATUS_OPTIONSdocumented as the queue's filter list (draft in, withdrawn out);REVIEWER_APPLICATION_STATUSES/_OPTIONSuntouched.lib/utils.ts— extractedbuildApplicationsHref(filters, page?)fromapplications-pagination.tsx, now shared by pagination and the count strip's link.app/(main)/(auth)/manage/applications/page.tsx— widened thestatussearchParam enum, fetches the draft count alongside positions/applicants, branches the results region onfilters.status === 'draft'.components/features/draft-applications-results.tsx(new, server) — draft rows + count, pagination, page clamping, privacy line.components/features/draft-applications-table.tsx(new, client) —DataTablewith no checkbox column, no row links, no status actions.components/features/drafts-in-progress-notice.tsx(new, server) — the count strip.components/features/applications-pagination.tsx—nounprop (default'application') so the drafts view reads "… drafts".components/features/applications-toolbar.tsx— statusSelectnow mapsAPPLICATION_STATUS_OPTIONS(includes Draft); the bulk bar and status dialog keep the reviewer-only list since those are write paths.components/features/applications-table-skeleton.tsx—showSelectionprop so the drafts skeleton renders no checkbox column.prisma/actions/applications.ts—revalidatePath('/manage/applications')added tocreateDraftApplication's success paths anddeleteDraftApplication.docs/PERMISSIONS.md— thedraftrow's reviewer-visibility cell replaced ("identity only … never answers, files or the detail page"); a new bullet records the split as deliberate policy.docs/WORKFLOWS.md— PM-8 updated (drafts filter, strip, inert rows) and corrected "scoped byreviewable" →listable, matching the actual query. AP-5 is untouched — applicants are not notified.tests/db/draft-visibility.test.ts; extendedtests/db/authorization.test.ts,tests/unit/constants.test.ts,tests/unit/utils.test.ts.Testing plan
/manage/applicationsshows "2 applications in progress" and none of the drafts in the default queue.⋯, applicant name is not a link, and the bulk bar never appears./manage/applications/<id>— 404, as a manager and as an admin.Automated checks
npm run prettier:check— passnpm run eslint:check— passnpm run tsc:check— passnpm run test:unit— 316/316 pass (one pre-existing, unrelated failure intests/unit/email-delivery-events.test.tsdue to a missingDATABASE_URLat module scope — not caused by this change)npm run test(db project) — could not run in this sandbox: local Postgres port 5432 is already bound by an unrelated container andnpm run db:startfails to bind. PerCLAUDE.md's documented fallback ("fall back totest:unitif Postgres is unavailable"), the new/extended DB tests (tests/db/draft-visibility.test.ts,tests/db/authorization.test.tsadditions) are unverified against a live database here, though they type-check and follow the exact fixture/scoping patterns of the neighboring passing tests. Please runnpm run testin CI/review to confirm.Notes