Composer: each drag-create appends another time range as text ("15:33-16:11 15:30-16:15"); drags must set the time chips only #715

Open
opened 2026-10-02 10:41:54 +00:00 by kayg · 4 comments
Owner

Owner report (2026-10-02): "I can drag multiple times to get multiple time stamps like this?"

Screenshot: the Composer is open after a drag-create. Its chips read Today · 15:33 – 16:11, and its text field contains "15:33-16:11 15:30-16:15". Each new drag on the grid while the Composer is open appends another time range as text, and the first range is also typed as text while the chips already show it.

Expected

  • A drag-create (or click-create) sets the Composer's time chips. It never inserts the time as text into the entry body; the chips are the single source of the time.
  • Dragging again while the Composer is open replaces the chips' times (and moves the ghost). It does not append anything.
  • If the User types a time manually ("15:30-16:15"), the parser lifts it into the chips and removes it from the body (the existing recognised-chip behaviour), so the body never keeps a second copy.
  • Undo (⌘Z) inside the Composer restores the previous chip times.

Tests

e2e like a User: drag 15:33–16:11, then drag 15:30–16:15 → the chips show 15:30–16:15 and the body text is empty; type a title, save → one entry with the latest times. A keyboard path (arrow-key nudges of the chips) gives the same result.

## Owner report (2026-10-02): "I can drag multiple times to get multiple time stamps like this?" Screenshot: the Composer is open after a drag-create. Its chips read Today · 15:33 – 16:11, and its text field contains **"15:33-16:11 15:30-16:15"**. Each new drag on the grid while the Composer is open appends another time range as text, and the first range is also typed as text while the chips already show it. ## Expected - A drag-create (or click-create) sets the Composer's **time chips**. It never inserts the time as text into the entry body; the chips are the single source of the time. - Dragging again while the Composer is open **replaces** the chips' times (and moves the ghost). It does not append anything. - If the User types a time manually ("15:30-16:15"), the parser lifts it into the chips and removes it from the body (the existing recognised-chip behaviour), so the body never keeps a second copy. - Undo (⌘Z) inside the Composer restores the previous chip times. ## Tests e2e like a User: drag 15:33–16:11, then drag 15:30–16:15 → the chips show 15:30–16:15 and the body text is empty; type a title, save → one entry with the latest times. A keyboard path (arrow-key nudges of the chips) gives the same result.
Author
Owner

Starting #714 and #715 on branch job/snapedge-714, based on c4a61e8cf (origin/dev). I am tracing the shared Calendar snap path and will merge the approved #612 drag-ghost branch locally before implementing the fixes.

Starting #714 and #715 on branch job/snapedge-714, based on c4a61e8cf (origin/dev). I am tracing the shared Calendar snap path and will merge the approved #612 drag-ghost branch locally before implementing the fixes.
Author
Owner

Root-cause evidence: Composer.svelte applyTime writes a drag range into the textarea and replaces it only when parser.cached(line) already contains a time run. That cache is filled by the asynchronous parse scheduled after the request, so a second drag before that parse completes finds no run and appends a second range to the body.

Root-cause evidence: Composer.svelte applyTime writes a drag range into the textarea and replaces it only when parser.cached(line) already contains a time run. That cache is filled by the asynchronous parse scheduled after the request, so a second drag before that parse completes finds no run and appends a second range to the body.
Author
Owner

Starting the #715 time-chip fix on job/snapedge-714 at e49b211ba, based on origin/dev c4a61e8cf090170f35b1bed3350d9de20c83ecd5 plus the approved #612 drag-ghost merge. The existing applyTime() path writes Calendar ranges into Composer RAW text; I am replacing it with structured chip state and covering repeated selection, Undo, draft reload, and save.

Starting the #715 time-chip fix on `job/snapedge-714` at `e49b211ba`, based on `origin/dev` `c4a61e8cf090170f35b1bed3350d9de20c83ecd5` plus the approved #612 drag-ghost merge. The existing `applyTime()` path writes Calendar ranges into Composer RAW text; I am replacing it with structured chip state and covering repeated selection, Undo, draft reload, and save.
Author
Owner

#715 implementation report

Head: 991251d7a (b8c603d3c contains the Composer fix).

Calendar-picked times now live in Composer draft metadata and time chips, not in entry RAW text. A later drag replaces the current range. The range survives draft reload, participates in Undo, and is frozen into Log/Event commits. A typed time token remains the source of truth when the User enters one manually.

Files changed for this behavior: apps/web/src/lib/composer/Composer.svelte, apps/web/src/lib/composer/drafts.svelte.ts, apps/web/src/lib/composer/commit.ts, and their component, draft, and commit tests. apps/web/e2e/calendar.mjs checks blank RAW text, chip values, and the save/reload path. The final live-browser rerun was not completed because of grid preference and scaled-scroll races in the e2e harness; the repeated replacement behavior is covered in Composer component tests.

Gates

bun run check:

User browser caches use userStorage; only documented device/public-link exceptions remain.
Text sizes and UI shape values use shared role tokens.
UI transitions and animation options use shared motion tokens or documented exceptions.
Loading svelte-check in workspace: /home/kayg/Developer/calternal-wt/snapedge-714/apps/web
Getting Svelte diagnostics...
svelte-check found 0 errors and 0 warnings

bun run test:

 Test Files  153 passed (153)
      Tests  1068 passed (1068)
   Start at  15:13:53
   Duration  160.67s (transform 62%, environment 16%, import 13%, tests 6%, setup 3%)

UX gaps closed: drag no longer mutates the body text; replacement, Undo, manual typed-time precedence, draft persistence, and committed values have coverage. UX gap left: no final live-server browser run of the repeated-drag interaction. See #714 for the six local Mac-emulated screenshots, performance numbers, and physical Mac steps pending while the Mac VM is offline. The fj issue CLI has no attachment command, so screenshot upload remains pending.

#715 implementation report Head: `991251d7a` (`b8c603d3c` contains the Composer fix). Calendar-picked times now live in Composer draft metadata and time chips, not in entry RAW text. A later drag replaces the current range. The range survives draft reload, participates in Undo, and is frozen into Log/Event commits. A typed time token remains the source of truth when the User enters one manually. Files changed for this behavior: `apps/web/src/lib/composer/Composer.svelte`, `apps/web/src/lib/composer/drafts.svelte.ts`, `apps/web/src/lib/composer/commit.ts`, and their component, draft, and commit tests. `apps/web/e2e/calendar.mjs` checks blank RAW text, chip values, and the save/reload path. The final live-browser rerun was not completed because of grid preference and scaled-scroll races in the e2e harness; the repeated replacement behavior is covered in Composer component tests. ## Gates `bun run check`: ```text User browser caches use userStorage; only documented device/public-link exceptions remain. Text sizes and UI shape values use shared role tokens. UI transitions and animation options use shared motion tokens or documented exceptions. Loading svelte-check in workspace: /home/kayg/Developer/calternal-wt/snapedge-714/apps/web Getting Svelte diagnostics... svelte-check found 0 errors and 0 warnings ``` `bun run test`: ```text Test Files 153 passed (153) Tests 1068 passed (1068) Start at 15:13:53 Duration 160.67s (transform 62%, environment 16%, import 13%, tests 6%, setup 3%) ``` UX gaps closed: drag no longer mutates the body text; replacement, Undo, manual typed-time precedence, draft persistence, and committed values have coverage. UX gap left: no final live-server browser run of the repeated-drag interaction. See #714 for the six local Mac-emulated screenshots, performance numbers, and physical Mac steps pending while the Mac VM is offline. The `fj issue` CLI has no attachment command, so screenshot upload remains pending.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal#715
No description provided.