feat(authoring-screens): mutation flows for create/edit/post/manage#38
Merged
Conversation
This was referenced May 17, 2026
themightychris
added a commit
that referenced
this pull request
May 17, 2026
npm install -w apps/web react-hook-form @hookform/resolvers sonner zod
npx shadcn@latest add select textarea label checkbox --yes --cwd apps/web
Used by the shared <MarkdownEditor> on every authoring screen so that no markdown library ships to the client. Renders source through the same sanitize-and-demote pipeline that produces serialized *Html fields, with a 50k-char cap.
- POST/PATCH/DELETE methods for projects, members, updates, buzz, help-wanted, people, tags, plus session revoke and newsletter toggle. - Auto-set Content-Type on string bodies. - Slugify helper for client-side title→slug derivation. - Forward refs in shadcn Input / Textarea so react-hook-form and imperative focus/selection work.
MarkdownEditor: side-by-side source + preview, toolbar, char count. Preview is rendered server-side via POST /api/_preview per specs/behaviors/markdown-rendering.md — no client-side markdown library. TagPicker: namespace-scoped autocomplete against /api/tags. Staff can create new tags inline; non-staff sees autocomplete only.
- PostUpdateModal — composes via MarkdownEditor, posts to updates - PostHelpWantedModal — title, description, hours, tags - AddMemberModal — slug + optional role; inline 409 error surfaced - ManageMembersModal — inline role edits, transfer, remove - ExpressInterestModal — optional message; honors 30-day rate-cap - FillRoleModal — optional filledBySlug - PostRolePickerModal — project picker for /help-wanted CTA - TagEditModal — staff edit/merge with confirmation
- ProjectEdit (/projects/create + /projects/:slug/edit): title, slug with availability check (staff-only on edit), summary, overview (MarkdownEditor), stage select, links, chat channel, tag pickers, staff featured toggle, admin Danger-zone delete-with-undo-toast. - ProfileEdit (/members/:slug/edit): name, bio, slug rename for staff, Slack handle, topic + tech tag pickers, avatar multipart upload. - Account (/account): identity card (GitHub-sourced), newsletter toggle via private-only PATCH, sessions table with revoke/sign-out, legacy-claim link, danger zone.
- App.tsx: route /projects/create + /:slug/edit → ProjectEdit; /members/:slug/edit → ProfileEdit; /account → Account; mount Sonner Toaster. - ProjectDetail: replace disabled Post Update with PostUpdateModal, surface Add Member / Manage Members buttons for maintainer+staff, Express Interest + Fill / Close transitions, +Add in Members sidebar; honor ?openModal=help-wanted from the picker. - HelpWantedCard: open ExpressInterestModal instead of disabled stub. - HelpWantedIndex: 'Post a role' picker for signed-in users. - TagDetail: staff inline Edit / Merge / Delete via TagEditModal.
…tModal - ProjectEdit: filling title auto-fills slug and POST /api/projects fires with the right payload (happy path). - ExpressInterestModal: POSTs to the correct express-interest endpoint with optional message; 30-day rate-cap is exercised via 409 already_expressed mock.
… 400 to 422 Fastify's ajv validation returns statusCode 400 but the project's setErrorHandler converts every body validation failure into the unified 422 validation_failed envelope (see apps/api/src/lib/errors.ts).
0c8cf45 to
7c7ff04
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the authoring-screens plan, replacing the
public-screensread-only stubs with real authoring flows:/projects/create,/projects/:slug/edit) — full form with slug availability check, markdown overview, tag pickers, staff featured toggle, admin Danger-zone delete-with-undo-toast./projects/:slug— Post Update, Post Help-Wanted Role, Add Member, Manage Members (role edit / transfer maintainer / remove), Express Interest, Fill Role, Close Role./members/:slug/edit) — name, bio (MarkdownEditor), staff slug rename, Slack handle, topic + tech tag pickers, multipart avatar upload./account) — identity card, newsletter toggle (private-only PATCH), sessions table with revoke + sign-out, legacy-claim entry, danger zone./tags/:namespace/:slugfor staff.Shared building blocks:
MarkdownEditorcomponent with toolbar + char count. Preview is rendered server-side via newPOST /api/_previewperspecs/behaviors/markdown-rendering.md— no client-side markdown library in the bundle (verified by grep on the production build).TagPicker— namespace-scoped autocomplete against/api/tags. Staff can create new tags inline.<Toaster>mounted inAppfor success / error toasts on every mutation.Test plan
npm run -w apps/web type-check/npm run -w apps/api type-checkcleannpm run lintcleannpm run -w apps/web test— 11 files, 30 tests passing (includes new ProjectEdit create-flow smoke test and ExpressInterestModal happy + rate-cap tests)npm run -w apps/web buildsucceeds and emits no markdown library symbols (verifiedgrep -E 'remark|micromark|markdown-it|marked|unified' dist/assets/*.jsreturns zero)POST /api/_previewAPI tests pass (4/4, including sanitization of<script>+javascript:URLs)/projects/createand/members/:slug/editshow "Sign in required" for anonymous users;/accountredirects anonymous →/login?return=/account; noSign in to …stubs remain except the genuinely-anonymous CTAs called out in the plan ("Sign in to contribute" on project detail header, "Sign in to express interest" on help-wanted cards)🤖 Generated with Claude Code