Skip to content

[Data]: Enforce start ≤ due; keep week-before-due block when start is unset #2

Description

@rosspeili

Which layer?

.hppm/store.json metadata

Severity feel

Wrong write but recoverable

Before → after (redacted)

**Before:** User can set **due < start** in drawer/calendar; Timeline may show nonsensical ranges.

**After:**
- UI blocks or clamps due so `start ≤ due` when both are set (disable invalid dates, clamp, or inline error).
- Server/store rejects or clamps invalid pairs on write.
- When **only due** is set (no start), Timeline keeps today’s **tentative ~one week before due** bar — display-only; do **not** write a fake start into the store.

**Implementer notes:** Centralize validate/clamp in one helper used by drawer + API. Document due-only tentative week in `docs/views/timeline.md`. Unit tests for clamp. Out of scope: recurrence, time-of-day.

Steps (in app and/or external editor)

  1. Open task drawer; set start = next Friday, due = next Monday → should be impossible or auto-corrected.
  2. Clear start; set due only → Timeline shows ~7-day tentative bar ending on due (keep this).
  3. Confirm Calendar / Gantt still respect filters after clamp.

Tracker sections present?

  • Critical
  • Very High
  • High
  • Med
  • None
  • Done
  • Custom / nonstandard headings

HPPM version

0.26

Checklist

  • Sample is redacted / synthetic
  • I can share a tiny fixture project if asked

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:drawerTask drawer — fields, edit, delete, notesarea:markdownTracker *.md format, sections, checkbox linesarea:store.hppm store, fingerprints, preferences, registryarea:viewsOverview, Table, Kanban, Timeline, Neural, FruitsbugSomething is broken or behaves incorrectlyenhancementNew feature or improvement request

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions