Skip to content

Timeline: crash fix + delete, extended grid, sidebar cleanup#4

Merged
guuse merged 2 commits into
mainfrom
fix/timeline-crash-undefined-starttime
Jun 2, 2026
Merged

Timeline: crash fix + delete, extended grid, sidebar cleanup#4
guuse merged 2 commits into
mainfrom
fix/timeline-crash-undefined-starttime

Conversation

@guuse
Copy link
Copy Markdown
Owner

@guuse guuse commented Jun 2, 2026

What

Started as a one-line crash hotfix, now also includes three timeline UX changes.

Crash fix

The app crashed on startup with TypeError: undefined is not an object (evaluating 'time.split'). The leftover-sidebar work replaced the timeline's startTime != null guard with !unplaced, so legacy/persisted blocks without a startTime reached DayTimeline and crashed timeToMinutes. Fix: filter(b => !b.unplaced && b.startTime != null).

Delete from the timeline

Concept blocks now show a hover that removes them straight from the day (new onDeleteConceptremoveBlock), no booking modal. Booked entries keep their edit/delete-via-modal flow.

Extend the grid past 18:00

The timeline extent is now dynamic: it grows to fit blocks that start before 08:00 or end after 18:00 (overflow work, late meetings) instead of clipping them off-screen. Hour labels, rows, positioning and drag handlers all derive from the computed extent; defaults to 08:00–18:00.

Remove "+ Toevoegen aan dag"

The leftover sidebar's per-chip + and the Alles + bulk add are gone — leftovers are now Boek or Negeer only. Auto-open reworked to a render-time state adjustment (no effect) to satisfy the hooks lint rule.

Tests

1682 passing, typecheck clean. New coverage for the crash regression (null-startTime block excluded), timeline delete, grid extension, and the no-add sidebar.

🤖 Generated with Claude Code

The leftover-sidebar change replaced the timeline's `startTime != null` guard
with `!unplaced`, so legacy/persisted blocks that have no startTime (previously
hidden) flowed into DayTimeline and crashed timeToMinutes ("undefined is not an
object (evaluating 'time.split')") on startup. Restore the guard: the timeline
shows only placed blocks that actually have a startTime; unplaced blocks still
route to the sidebar.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 99.14% (🎯 95%) 2668 / 2691
🔵 Statements 98.54% (🎯 95%) 3049 / 3094
🔵 Functions 98.24% (🎯 95%) 784 / 798
🔵 Branches 95.96% (🎯 95%) 1713 / 1785
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/ui/components/DayTimeline.tsx 99.3% 92.42% 100% 100% 139
src/ui/components/LeftoverSidebar.tsx 80.43% 73.58% 88.23% 83.33% 30-31, 36, 55-56, 111
src/ui/pages/WeekPage.tsx 93.52% 91.62% 87.95% 95.76% 205-228, 293, 343, 382, 449, 458, 487, 576, 582
Generated in workflow #15 for commit 5f776aa by the Vitest Coverage Report Action

…egen"

- DayTimeline: hover ✕ on concept blocks deletes them straight from the timeline
  (new onDeleteConcept prop, wired to removeBlock in WeekPage) — no booking modal.
  Booked entries keep their existing edit/delete-via-modal flow.
- DayTimeline: dynamic day extent. The grid now grows to fit blocks that start
  before 08:00 or end after 18:00 (e.g. overflow work, late meetings) instead of
  clipping them off-screen — start/end hours, labels, rows, blockTop/blockPx and
  the drag handlers all derive from the computed extent (default 08:00–18:00).
- LeftoverSidebar: removed the per-chip "+ Toevoegen aan dag" and the "Alles +"
  bulk add; leftovers are now Boek or Negeer only. Auto-open reworked to a
  render-time state adjustment (no effect) to satisfy the hooks lint rule.

Tests added for delete, grid extension, and the no-add sidebar. 1682 pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@guuse guuse changed the title Fix: timeline crash on blocks without a startTime Timeline: crash fix + delete, extended grid, sidebar cleanup Jun 2, 2026
@guuse guuse merged commit db83c32 into main Jun 2, 2026
1 check passed
@guuse guuse deleted the fix/timeline-crash-undefined-starttime branch June 2, 2026 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant