Skip to content

fix(settings): compact scheduled task lists and run history - #694

Merged
nixuuu merged 1 commit into
devfrom
fix/compact-scheduled-tasks
Nov 14, 2026
Merged

nixuuu merged 1 commit into
devfrom
fix/compact-scheduled-tasks

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

Scheduled tasks repeated the message as a truncated title, wrapped metadata across several lines, and showed five long thread links for every task. Finished tasks could fill most of the settings page.

Tasks now use a compact message line with a status badge and one metadata line. The run count expands the full message, edit details and recent history. Run rows link as a whole, group dates, and omit the task's thread title unless the target differs. Computer names match the worker display names. The mobile Scheduled tasks screen uses the same compact presentation and hides its actions in a sheet.

Before: two finished tasks showed duplicate Polish messages, repeated thread titles, separate computer/edit lines and always-open run history.
After: each task starts with a single truncated message and short metadata; details and history open on demand. Explicit names distinct from messages stay visible.

The existing API supports cancellation with retained history, rather than permanent deletion. This change preserves that behavior and terminal-task restrictions.

Validation:

  • bun install, bun run gen:check, bun run typecheck, bun run lint, bun run format:check: passed. Latest mobile/web changes also passed focused typechecks.
  • bun test packages/domain/src/schedule-display.test.ts: 2 tests passed (15 assertions). Tests cover the API's 60-character fallback, preservation of explicit names, and recurring schedule descriptions.
  • bun run --filter @canopy/web build: passed. Existing chunk-size/dynamic-import warnings remain.
  • Isolated browser review with realistic long Polish messages: light/dark, 1440px desktop, 760px narrow and 390px/320px phone widths; once/recurring, paused/finished, explicit names, five recent runs, missed/skipped/expired outcomes and a different run thread. No horizontal page overflow; heading coordinates and width stayed unchanged on disclosure toggle. History links have no underlines. Review services, database and temporary files cleaned up afterwards.
  • No UI test suite added. Native mobile code passed typecheck; a simulator/device runtime review was not performed.

History reflects scheduler dispatch outcomes. The API does not expose a scheduled turn's final success/failure here; started runs use a play icon rather than implying completion.

Copy audit (docs/copy.md §8):

  • Long introduction → “Messages sent once or on repeat.” One short sentence; existing glossary terms.
  • “Every hour at :00 (Europe/Warsaw)” → “Hourly at :00” when the device uses the same zone; different zones remain visible. “6 of 6 runs” → “6 runs” in the row; the limit stays in details.
  • Duplicate name/message and repeated run thread titles → one message preview and only differing run targets. Full text remains in details.
  • Empty states → “Create a task to send a message later.” / “Completed and cancelled tasks appear here.” One sentence each; “New task” retained as requested.
  • Actions retain existing verb labels and cancellation confirmation. Status text accompanies badges; run outcome icons have accessible labels. No new errors, jargon, glossary entries or decorative copy. Short, typical and long text checked at desktop, narrow and phone widths in both themes. Informational run-count disclosures retain the requested count label.

@nixuuu
nixuuu force-pushed the fix/compact-scheduled-tasks branch from 046a38c to 1874fcd Compare November 14, 2026 08:52
@nixuuu
nixuuu marked this pull request as ready for review November 14, 2026 08:52
@nixuuu
nixuuu merged commit d2ced97 into dev Nov 14, 2026
11 checks passed
@nixuuu
nixuuu deleted the fix/compact-scheduled-tasks branch November 14, 2026 09:03
nixuuu added a commit that referenced this pull request Nov 14, 2026
## Problem

In Settings → Scheduled tasks, collapsing a task's details (the "N runs"
disclosure) cleared the content at once and left a blank band. The rows
below then snapped up instead of easing. The user's 120 fps recording
shows the clip shrinking far faster than the row box.

## Cause

`expandGrid` (motion.ts) tweened `grid-template-rows: t fr` on the
wrapper. In an auto-height grid, Chromium sizes the wrapper to t ×
content but the `t fr` track (the clipping child) to t² × content.
Measured in headless Chromium at t = 0.5: wrapper 84 px, clip 42 px.
Content vanished early, and the leftover band snapped shut when the
element unmounted. Expanding had the same mismatch in reverse.

## Fix

- `expandGrid(node)` tweens the wrapper's measured height
(`--duration-fast`, `--ease-smooth-out`, with a fade), and the `1fr`
track follows it exactly (verified: wrapper = clip at every step). The
height comes from the clipping child's `scrollHeight`, so a toggle
reversed mid-way keeps its scale. Reduced motion stays instant. The grid
mode of `Disclosure` (activity frames) gets the same fix.
- The schedule row body is now a flex column, and the details wrapper
cancels its 2 px gap (`-mt-0.5` / `pt-2.5`), so nothing moves at either
end of the motion. A grid row would clamp the negative margin. The final
layout is unchanged.
- Mobile: details used to mount at full height in one frame. A new
shared `ui/Accordion` (measured height + fade on `fast`, the same both
ways, instant with reduced motion) makes the cards below glide. JS only;
the runtime fingerprint is unchanged, so it ships OTA.

Fixes: #694
Related: #491

## Checks

- `bun install`, `bun run gen:check`, `bun run typecheck`, `bun run
lint`, `bun run format:check`: clean
- web build: passed; `expo export` iOS + Android: passed; fingerprint
sources contain none of the changed files
- Browser review on an isolated stack: built web, fixture schedules,
Chromium via Playwright, sampled every animation frame:
- Before: on collapse the clip fell far behind the wrapper, leaving a
blank band, then the rows snapped.
- After, collapse at 1440 px light: wrapper = clip on every frame (246 →
174 → 81 → 32 → 11 → 3 → 0 px), next row 525 → 279 px, no step at mount
or unmount. Expand mirrors it.
  - After, 390 px dark: the same (298 → 0 px).
  - With `prefers-reduced-motion: reduce` it is instant both ways.
- Pre-existing and unrelated: an intermittent `Cannot read properties of
undefined (reading 'component')` in SvelteKit's client router on the
first navigation. It reproduces on plain `dev` (4397875) in the same
stack.
- Mobile: typecheck and export pass; not checked on a device.

## Copy audit (§8)

No UI text changes.
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