Repository navigation
fix(ui): onboarding error toast + JobForm draft floor + typed submit params (SC-112, SC-123, SC-124) - #334
Merged
Conversation
…params (SC-112, SC-123, SC-124) SC-112 — onboarding submission errors: - `completeMutation.onError` was the only user-visible signal that the prerequisites form failed to save; the form-level `catch` only `console.error`s. The toast title was a generic "Error", the message was a 6-word "Please try again", and the duration was the default 6000ms — easy to miss. - Toast now leads with "Couldn't save profile" (the problem), the fallback message names connection + retry as the action, and the duration is bumped to 10000ms so the user can read it and tap Submit again. SC-123 — JobForm "Save as Draft" disable predicate drift: - The draft button enabled on `formData.title` truthy / description non-empty / organization set, which is laxer than the server's `createJobBodySchema` (title `.min(3).max(100)`, description `.min(10)`, per SC-122). Users could tap into a guaranteed-fail 400. - Predicate now requires `title.trim().length >= 3`, `descriptionPlainText.trim().length >= 10`, and an `organization_id` — extracted as a memoized `meetsDraftMinimums`. The Post/Schedule button reuses the same floor plus its existing location + future- date requirements. SC-124 — JobForm.handleSubmit unsafe Record cast: - Submit data was built as `Record<string, unknown>` and double-cast (`as unknown as Parameters<typeof createJob.mutate>[0]`) into the typed mutation params. A missing required field was caught only by the server 400, not at compile time. - New `buildJobParams(asDraft)` returns a typed `OfficeCreateJobParams` literal. The mutation calls are now type-checked end-to-end; no `unknown` casts. The update path threads through the same builder into `OfficeUpdateJobParams`. As a safety net, handleSubmit also re-checks `meetsDraftMinimums` and toasts a clear "missing required fields" message if somehow invoked while disabled. The for-loop that previously copied every truthy form field into the payload was dropping all of them server-side anyway (the route's Zod schema strips unknown keys), so the new typed builder is behaviorally equivalent for valid inputs. Verified: - `pnpm exec tsc -p packages/scf-core --noEmit` clean. - `pnpm exec tsc -p apps/scaffald --noEmit` clean. - Web app boots without runtime errors (`preview_start` + load `/`). - End-to-end UI flows (logged-in employer creating a job; onboarding submission failure path) not exercised in this session — reviewer sanity-check welcome. Co-Authored-By: Claude Opus 4.7 <[email protected]>
thinkclay
added a commit
that referenced
this pull request
Jun 9, 2026
…shot) Moves the three v1.9.0 UI polish tickets from Todo to In Github with fix comments linking to PR #334. Co-Authored-By: Claude Opus 4.7 <[email protected]>
Contributor
3 tasks
This was referenced Jul 23, 2026
Syntax errors in 8 test files (from #334) silently break Deno test suites for packages/supabase
#418
Closed
Closed
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
Bundles the three v1.9.0 UI polish tickets — all in-repo, no submodule.
SC-112 — onboarding submission error UX
apps/scaffald/app/(protected)/onboarding/index.tsx:99catchinonSubmitonlyconsole.errors, so the mutation'sonErrortoast is the only user-visible signal of failure.SC-123 —
JobForm"Save as Draft" disable predicate driftpackages/scf-core/features/office/components/JobForm.tsx:1304title/ non-emptydescription/ organization set — laxer than the server'screateJobBodySchema(.min(3) / .max(100)title,.min(10)description from SC-122). Users could tap into a guaranteed 400.meetsDraftMinimumsmirrors the server floor (title.trim() >= 3,descriptionPlainText.trim() >= 10, org set). Both Save-as-Draft and Post/Schedule reuse it; Post additionally still requireslocation+ a futurescheduled_publish_atif set.SC-124 —
JobForm.handleSubmitunsafeRecordcastpackages/scf-core/features/office/components/JobForm.tsx:482(pre-refactor line)handleSubmitbuilt aRecord<string, unknown>then double-cast (as unknown as Parameters<typeof createJob.mutate>[0]). A missing required field surfaced only at the server 400.buildJobParams(asDraft)returns a typedOfficeCreateJobParamsliteral. The mutation call sites are type-checked end-to-end — nounknowncasts. Update path threads the same builder throughOfficeUpdateJobParams.handleSubmitalso re-checksmeetsDraftMinimumsand toasts a clear error if invoked while disabled (belt-and-suspenders).Test plan
pnpm exec tsc -p packages/scf-core --noEmitclean.pnpm exec tsc -p apps/scaffald --noEmitclean.pnpm prepush(affected build + test) green.pnpm webboots without runtime errors.Closes SC-112, SC-123, SC-124.
🤖 Generated with Claude Code