Skip to content

feat: add optional start date to planning initiatives - #283

Merged
AdamJ merged 2 commits into
mainfrom
claude/happy-mayer-ugxqpj
Nov 10, 2026
Merged

AdamJ merged 2 commits into
mainfrom
claude/happy-mayer-ugxqpj

Conversation

@AdamJ

@AdamJ AdamJ commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

Summary

Planning initiatives only had a deadline, so every timeline bar started at the initiative's creation date. This adds an optional start date so a bar can cover the full start-to-deadline scope, and pre-fills the deadline pickers with sensible defaults.

Type of Change

  • New feature
  • Update to existing feature
  • Bug fix
  • Documentation update
  • Other (describe below)

Related Issue

N/A

Changes Made

  • InitiativeSheet.tsx: new optional "Start date" field. A deadline before the start date is rejected. An explicit start date replaces the creation-date floor on the deadline, so past work can be logged retroactively. Clearing the field in edit mode unsets it.
  • InitiativeSheet.tsx: the deadline pickers open pre-filled. "Specific date" defaults to today's local date and "Quarter" defaults its year to the current year (the quarter is still chosen by the user). Start date stays blank. Edit mode keeps saved values and only falls back to these defaults when switching deadline type.
  • InitiativeTimeline.tsx: bars run from startDate (falling back to createdAt) to the deadline. The label reads "Start – Deadline" when a start is set.
  • initiativeUtils.ts: resolveInitiativeStart, isDeadlineBeforeStart (local-day comparison, same UTC-midnight care as the existing helpers), and toLocalDateString.
  • TimeTrackingContext.tsx: Initiative.startDate?: string.
  • Persistence: Supabase service maps start_date, new migration supabase/migrations/20261110_initiative_start_date.sql. SQL backend repository maps start_date, and server/schema.ts adds the column to existing databases on startup. Guest localStorage and SqlApiService pass the full object through, so they needed no change.
  • Tests added for the utils, form validation, prefill defaults, submit/clear behavior, timeline label and bar position, Supabase mapping, and localStorage round-trip.
  • Docs: CHANGELOG.md, README.md, README-EXT.md, AGENTS.md.

Checklist

Documentation

  • Any notable changes added to the README.md
  • CHANGELOG.md updated accordingly
  • N/A — no README changes

General

  • Branch is up to date with main
  • No unrelated files included in this PR
  • Tested locally by invoking the pnpm test, pnpm lint, and pnpm build

Notes for Reviewers

  • Deploy step: run 20261110_initiative_start_date.sql against existing Supabase projects before this ships, otherwise initiative upserts will fail on the unknown start_date column.
  • Existing initiatives have no start date and render exactly as before.
  • Not tested against a live Supabase project or a live Postgres/MySQL backend; Supabase mapping is covered by unit tests with a mocked client, and the SQL backend column add is untested.
  • AGENTS.md lists pnpm check:design-tokens, pnpm lint:markdown, and pnpm check:a11y as pre-commit steps, but none of those scripts exist in package.json, so they were not run.
  • The first commit on the branch carries a Co-Authored-By: trailer that the repo's AGENTS.md forbids; removing it needs a history rewrite and force-push.

Initiatives previously only had a deadline, with the timeline bar starting
at the creation date. Add an optional startDate across the form, timeline,
localStorage, Supabase (new start_date column + migration), and the SQL
backend (column auto-added to existing databases).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WpYBKifQTutKUHHgtRMNTM
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Deploying timetrackerpro with  Cloudflare Pages  Cloudflare Pages

Latest commit: cc38266
Status: ✅  Deploy successful!
Preview URL: https://212856df.timetrackerpro.pages.dev
Branch Preview URL: https://claude-happy-mayer-ugxqpj.timetrackerpro.pages.dev

View logs

@github-actions github-actions Bot added automation For items related to release/documentation/workflow automations documentation Improvements or additions to documentation frontend labels Nov 10, 2026
The Specific date picker now opens on today's local date and the Quarter
picker's year on the current year. Start date stays blank. Edit mode keeps
saved values and only falls back to the defaults when switching deadline type.

Claude-Session: https://claude.ai/code/session_01WpYBKifQTutKUHHgtRMNTM
@AdamJ AdamJ self-assigned this Nov 10, 2026
@AdamJ AdamJ added this to Timetraked Nov 10, 2026
@github-project-automation github-project-automation Bot moved this to Backlog in Timetraked Nov 10, 2026
@AdamJ AdamJ changed the title [Timetraked] feat: add optional start date to planning initiatives feat: add optional start date to planning initiatives Nov 10, 2026
@AdamJ
AdamJ merged commit 9ca764b into main Nov 10, 2026
3 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Timetraked Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation For items related to release/documentation/workflow automations documentation Improvements or additions to documentation frontend

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants