Action

Type

Resolved On

Auto Due UX 2025-12-22

Description

This UX improvement automatically suggests a due date when creating goals, particularly for weekly goals. The suggested due date is set to the Sunday of the specified week, providing a natural deadline for weekly planning and review.

This streamlines the goal creation workflow by eliminating the need to manually select a due date in most cases, while still allowing users to override the suggestion if needed.

Benefits

  • Faster goal creation without manual date selection
  • Consistent due dates aligned with week boundaries
  • Encourages weekly planning rhythm (goals due by end of week)
  • Reduces user friction in the planning interface

Implementation - RESOLVED ✓

Updated Components:

  • src/components/planner/benben/create/NewGoal.astro - Auto-calculate and pre-populate due date
  • src/components/planner/benben/Week.astro - Pass week number to NewGoal component

Logic: When creating weekly goals:

  1. Calculate the Sunday of the specified week number using startOfYear + addWeeks + endOfWeek
  2. Special handling for last week of year (WK53):
    • Detect if week number matches the last week of the year
    • Use YYYY-12-31 as the due date instead of Sunday
    • Matches the WeekNum() logic in src/lib/weekly.ts for December wrapping
  3. Pre-populate the due date input field with the calculated date
  4. Allow users to manually override the date if needed

Examples:

  • WK51 → Sunday of week 51
  • WK52 → Sunday of week 52
  • WK53 (last week of year) → December 31st

Affected Components

  • Goal creation forms in benben projects
  • Weekly planning interface
  • Due date picker/input components

Commits

  • 16c5527 - Implement Auto Due UX improvement for weekly goals
  • e8d56ba - Fix auto-due date calculation to use specified week number
  • b0614ab - Use Dec 31 as auto-due date for last week of year