From d23442a1a1c1f2a67ac2df05be6c724244f2b9fe Mon Sep 17 00:00:00 2001 From: ScreenTinker Date: Tue, 28 Jul 2026 18:39:05 -0500 Subject: [PATCH] Open the calendar on the working day and say what it is for MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two things a browser run made obvious that reading the code did not. The week view opened at midnight. A new user landed on four hours of empty night with every hour anything is actually scheduled in below the fold, which reads as an empty product rather than an empty morning. It now opens on the earliest scheduled hour, or the start of a working day when nothing is scheduled yet, and only on the first render so it never yanks the view back while someone is scrolling. The grid is also its own scroll container now, with the day header pinned. A full day at the new row height is a thousand pixels; without this the controls scroll away and you lose track of which column you are in. An empty calendar said nothing at all. It now carries a line explaining that dragging across a time creates a schedule and right-click has more — placed outside the grid so it cannot intercept the gesture it describes. Getting there took two wrong attempts, both caught by looking: the hint was first appended after the grid, which put it a thousand pixels below the fold, and the scroll used offsetTop while the container was not a positioned ancestor, so it measured from the page body and overshot by hours. The scroll is plain grid arithmetic now, and the container is positioned. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01Uaeo9MvzKoyXuN6ZsbhtkL --- frontend/js/views/schedule.js | 38 ++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/frontend/js/views/schedule.js b/frontend/js/views/schedule.js index b40418a..7e9c5c2 100644 --- a/frontend/js/views/schedule.js +++ b/frontend/js/views/schedule.js @@ -10,6 +10,8 @@ import { const API = (url, opts = {}) => fetch('/api' + url, { headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${localStorage.getItem('token')}`, ...opts.headers }, ...opts }).then(r => r.json()); const HOURS = Array.from({ length: 24 }, (_, i) => i); +// Where the week view opens when nothing is scheduled yet — the start of a working day. +const DEFAULT_SCROLL_HOUR = 8; function esc(str) { const d = document.createElement('div'); d.textContent = str; return d.innerHTML; } @@ -51,8 +53,8 @@ export async function render(container) { -
-
+
+