fix: remove date field from contract signing section #14

Merged
forgejo_admin merged 1 commit from 13-remove-date-field into main 2026-03-24 20:21:47 +00:00

Summary

Remove the date input from the contract signing form. The server records the signing timestamp independently, making the client-side date field useless UI clutter.

Changes

  • src/routes/contract/[token]/+page.svelte:
    • Removed dateStr $state variable and its onMount block that formatted the current date
    • Removed the displayDate $derived value that depended on dateStr
    • Removed the date form-group div (label + disabled date input)
    • Inlined the date computation in the success overlay template using new Date().toLocaleDateString()

Test Plan

  • npm run build passes (no new warnings)
  • npm test passes (12/12 tests)
  • Verify contract signing page no longer shows a date input field
  • Verify success overlay still displays "Signed on [date]" correctly after signing

Review Checklist

  • Build passes (npm run build)
  • Tests pass (npm test — 12/12)
  • No unrelated changes — only the date field removed
  • Checkbox, signature pad, legal name, and submit button untouched
## Summary Remove the date input from the contract signing form. The server records the signing timestamp independently, making the client-side date field useless UI clutter. ## Changes - `src/routes/contract/[token]/+page.svelte`: - Removed `dateStr` `$state` variable and its `onMount` block that formatted the current date - Removed the `displayDate` `$derived` value that depended on `dateStr` - Removed the date `form-group` div (label + disabled date input) - Inlined the date computation in the success overlay template using `new Date().toLocaleDateString()` ## Test Plan - `npm run build` passes (no new warnings) - `npm test` passes (12/12 tests) - Verify contract signing page no longer shows a date input field - Verify success overlay still displays "Signed on [date]" correctly after signing ## Review Checklist - [x] Build passes (`npm run build`) - [x] Tests pass (`npm test` — 12/12) - [x] No unrelated changes — only the date field removed - [x] Checkbox, signature pad, legal name, and submit button untouched ## Related - Closes #13
The server records the signing timestamp independently, making the
client-side date input useless UI clutter. Removes the dateStr state,
its onMount initializer, and the date form-group div. The success
overlay now computes the display date inline.

Closes #13

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Author
Owner

QA Review

Scope: 1 file changed, +1 / -18 lines. Surgical removal.

Checklist

  • dateStr state variable removed -- no orphaned references in codebase
  • onMount block that set dateStr removed -- the other onMount (signature pad init) remains intact
  • displayDate derived value removed -- no orphaned references
  • onMount import retained correctly (still used by signature pad)
  • Date form-group div removed from template
  • Success overlay date inlined with new Date().toLocaleDateString('en-US', ...) -- correct locale options preserved
  • No unrelated changes -- checkbox, signature pad, legal name, submit button untouched
  • No CSS cleanup needed (date input used shared .form-group / .form-input classes)
  • npm run build passes
  • npm test passes (12/12)

Nits

None.

VERDICT: APPROVE

## QA Review **Scope:** 1 file changed, +1 / -18 lines. Surgical removal. ### Checklist - [x] `dateStr` state variable removed -- no orphaned references in codebase - [x] `onMount` block that set `dateStr` removed -- the other `onMount` (signature pad init) remains intact - [x] `displayDate` derived value removed -- no orphaned references - [x] `onMount` import retained correctly (still used by signature pad) - [x] Date form-group div removed from template - [x] Success overlay date inlined with `new Date().toLocaleDateString('en-US', ...)` -- correct locale options preserved - [x] No unrelated changes -- checkbox, signature pad, legal name, submit button untouched - [x] No CSS cleanup needed (date input used shared `.form-group` / `.form-input` classes) - [x] `npm run build` passes - [x] `npm test` passes (12/12) ### Nits None. **VERDICT: APPROVE**
Author
Owner

PR #14 Review

DOMAIN REVIEW

Stack: SvelteKit 5 (runes mode), TypeScript, adapter-node, direct Postgres.

Correctness of removal. The server endpoint (src/routes/contract/[token]/sign/+server.ts, line 84) uses contract_signed_at = NOW() to record the signing timestamp server-side. The client-side date field (dateStr, displayDate, the disabled <input type="date">) was purely cosmetic -- it was never submitted in the POST body. Removing it is the correct fix. This also eliminates the timezone/SSR mismatch chain that spawned issues #9 and #11.

Inline date in success overlay. The replacement new Date().toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric' }) is evaluated at render time when showSuccess becomes true. Since the overlay only appears immediately after the signing POST completes, this is functionally equivalent to the old displayDate derived value. No behavioral regression.

onMount import. Still used at line 107 for signature pad initialization. No dead import.

No remnants. Grep confirms zero references to dateStr, displayDate, or signDate anywhere in src/. Clean removal.

Accessibility. The removed <input type="date" id="signDate" disabled> had a proper <label for="signDate"> association. Since both are removed together, no orphaned labels or broken ARIA references remain.

BLOCKERS

None.

This is a pure removal of 18 lines of dead UI code with 1 line of inline replacement. No new functionality is introduced, so the "new functionality must have tests" blocker criterion does not apply. No user input paths are added. No secrets. No auth changes.

NITS

  1. Locale consistency. The success overlay and the "already signed" block (line 146) both use identical toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric' }) formatting. If the locale or format options ever need to change, they would need to be updated in two places. Consider extracting a shared formatDate helper in $lib/. Non-blocking -- the duplication is trivial and read-only display logic.

SOP COMPLIANCE

  • Branch named after issue (13-remove-date-field references issue #13)
  • PR body follows template (Summary, Changes, Test Plan, Review Checklist, Related)
  • Related section references parent issue (Closes #13)
  • Related section references plan slug -- no plan slug referenced, but this is a standalone bug fix, not plan-driven work. Acceptable.
  • Tests pass (12/12 per PR body)
  • No secrets, .env files, or credentials committed
  • No unrelated changes -- single file, 1 addition / 18 deletions, all scoped to the date field
  • Commit message is descriptive (fix: remove date field from contract signing section)

PROCESS OBSERVATIONS

This PR closes the third issue in a chain (#9 SSR/timezone mismatch, #11 mobile date picker unresponsive, #13 remove the field entirely). The progression from "fix the date" to "make the date input work on mobile" to "remove the date entirely because the server records it" is a clean example of converging on the right solution. The removal eliminates an entire class of client-side date bugs.

Change failure risk: minimal. This is a subtraction, not an addition.

VERDICT: APPROVED

## PR #14 Review ### DOMAIN REVIEW **Stack:** SvelteKit 5 (runes mode), TypeScript, adapter-node, direct Postgres. **Correctness of removal.** The server endpoint (`src/routes/contract/[token]/sign/+server.ts`, line 84) uses `contract_signed_at = NOW()` to record the signing timestamp server-side. The client-side date field (`dateStr`, `displayDate`, the disabled `<input type="date">`) was purely cosmetic -- it was never submitted in the POST body. Removing it is the correct fix. This also eliminates the timezone/SSR mismatch chain that spawned issues #9 and #11. **Inline date in success overlay.** The replacement `new Date().toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric' })` is evaluated at render time when `showSuccess` becomes `true`. Since the overlay only appears immediately after the signing POST completes, this is functionally equivalent to the old `displayDate` derived value. No behavioral regression. **`onMount` import.** Still used at line 107 for signature pad initialization. No dead import. **No remnants.** Grep confirms zero references to `dateStr`, `displayDate`, or `signDate` anywhere in `src/`. Clean removal. **Accessibility.** The removed `<input type="date" id="signDate" disabled>` had a proper `<label for="signDate">` association. Since both are removed together, no orphaned labels or broken ARIA references remain. ### BLOCKERS None. This is a pure removal of 18 lines of dead UI code with 1 line of inline replacement. No new functionality is introduced, so the "new functionality must have tests" blocker criterion does not apply. No user input paths are added. No secrets. No auth changes. ### NITS 1. **Locale consistency.** The success overlay and the "already signed" block (line 146) both use identical `toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric' })` formatting. If the locale or format options ever need to change, they would need to be updated in two places. Consider extracting a shared `formatDate` helper in `$lib/`. Non-blocking -- the duplication is trivial and read-only display logic. ### SOP COMPLIANCE - [x] Branch named after issue (`13-remove-date-field` references issue #13) - [x] PR body follows template (Summary, Changes, Test Plan, Review Checklist, Related) - [x] Related section references parent issue (`Closes #13`) - [ ] Related section references plan slug -- no plan slug referenced, but this is a standalone bug fix, not plan-driven work. Acceptable. - [x] Tests pass (12/12 per PR body) - [x] No secrets, `.env` files, or credentials committed - [x] No unrelated changes -- single file, 1 addition / 18 deletions, all scoped to the date field - [x] Commit message is descriptive (`fix: remove date field from contract signing section`) ### PROCESS OBSERVATIONS This PR closes the third issue in a chain (#9 SSR/timezone mismatch, #11 mobile date picker unresponsive, #13 remove the field entirely). The progression from "fix the date" to "make the date input work on mobile" to "remove the date entirely because the server records it" is a clean example of converging on the right solution. The removal eliminates an entire class of client-side date bugs. Change failure risk: minimal. This is a subtraction, not an addition. ### VERDICT: APPROVED
forgejo_admin deleted branch 13-remove-date-field 2026-03-24 20:21:47 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
forgejo_admin/westside-contracts!14
No description provided.