Skip to content

Mobile polish, phase 2: Plan and Calendar as a day view on phones - #24

Merged
antonsxh merged 1 commit into
mainfrom
mobile-polish-2
Nov 22, 2026
Merged

antonsxh merged 1 commit into
mainfrom
mobile-polish-2

Conversation

@antonsxh

@antonsxh antonsxh commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

Phase 2 of the iPhone PWA polish. On phones (≤ 720px), Plan and Calendar now show one day instead of a sideways-scrolling week. Desktop and iPad are unchanged.

What changes

  • Day strip (DayStrip.svelte): Mon–Sun under the header.
    • The selected day sits on a pill that slides between days, and today is marked.
    • Each day gets at most one dot (open tasks on Plan, logged time on Calendar). There are no counts.
    • The selected day lives in ?day=, so it survives reloads and form actions (formAction()). Changing the day replaces the history entry instead of adding one.
  • Swipe (DaySwipe.svelte, rules in #lib/swipe.ts and #lib/day-view.ts):
    • swipe sideways to step to the previous or next day, crossing week boundaries;
    • the axis locks after 10px and the area is touch-action: pan-y, so vertical scrolling stays native;
    • the content follows the finger a little and the new day slides in from its side;
    • the day strip and the week arrows do the same with a tap.
  • Plan:
    • one full-width PlanColumn, with ▶ ↑ ↓ ⋯ on one row per card;
    • an empty day shows "Nothing planned for " and a primary Add a task button;
    • the backlog opens in a bottom sheet, with a one-tap Move to per row (the desktop rail is unchanged);
    • drag & drop stays desktop-only.
  • Calendar:
    • WeekGrid now takes selected and a column count, and phones show the selected day full width;
    • the day's total is in the grid header, and the week totals are hidden on phones;
    • the now line shows only on today;
    • logging time, editing sessions and "Show plan" work as before.
  • Menus inside sheets: Menu opens as a popover inside an open dialog. Before this, menus and the quest picker could not be used inside sheets.
  • Fix: tapping an empty calendar slot on a touch screen logged the wrong time (13:22 became 13:00), because the press feedback shrank the slot under the finger. The slot no longer shrinks when pressed.

Decision: Both pages still render the whole week, and CSS shows only the selected day on phones. The server can't know the screen size, so this avoids a flash on load and leaves desktop untouched.

Screenshots

iPhone 390×844 (Chromium emulation).

Before After
Plan
Plan backlog
Calendar
After: empty day Calendar (today, no sessions) Log time from a slot

Desktop is unchanged: plan · calendar

Video (swipes across the week boundary, strip taps, backlog sheet, Calendar swipes): after-swipe.webm

Tests

  • Unit: day-view.test.ts and swipe.test.ts. bun run test reports 388 pass.
  • e2e: new e2e/specs/day-view.spec.ts with four @mobile tests, passing with --repeat-each=3.
    • Tapping a day in the strip shows its tasks, and ?day= survives a reload.
    • An added task is saved on the selected day.
    • Swiping on Sunday goes to next week's Monday, while a vertical scroll keeps the day.
    • Moving a task from the backlog sheet saves it on the selected day.
    • Tapping an empty calendar slot logs a session at the tapped time.
  • Rule 5: each of these three tests failed when its behaviour was broken on purpose (?day= ignored, no axis lock, slot press-scale), then passed again.
  • Results: test:e2e 87 passed, 6 skipped. test:e2e:mobile 47 passed, 7 skipped. check, lint and build are clean.
  • Not tested on a real iPhone: how the swipe feels, how vertical scrolling is handed back to Safari, and whether iOS's long-press drag is really off on cards.

🤖 Generated with Claude Code

Phones (≤ 720px) show one day of the week instead of a sideways-scrolling
board/grid; desktop and iPad are unchanged.

- DayStrip (Mon–Sun, sliding pill, one dot per day) + DaySwipe (pointer
  swipe ±1 day with axis lock, follow and slide-in; tap equivalents: strip,
  week arrows). Selected day in ?day= (client-only), pure helpers in
  #lib/day-view.ts and #lib/swipe.ts.
- Plan: only the selected column, full width; compact card meta row; calm
  empty day with a primary "Add a task"; backlog in a bottom sheet with
  "Move to <selected day>".
- Calendar: WeekGrid takes `selected` (CSS shows one column), compact day
  header with the total, now line only on today, per-day scroll target.
- Menu opens as a popover inside open dialogs (menus/quest picker in sheets).
- Fix: the calendar slot took the touch press scale, shifting tapped times.
- Unit tests for day-view/swipe, e2e day-view.spec.ts (@mobile).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@antonsxh
antonsxh merged commit a201238 into main Nov 22, 2026
6 checks passed
@antonsxh
antonsxh deleted the mobile-polish-2 branch November 22, 2026 13:31
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