→ on a log line makes a smart note: title, times, tags, link back #149

Closed
opened 2026-10-14 05:57:41 +00:00 by kayg · 1 comment
Owner

kayg pressed → on the log line * 09:30 - 10:30 description #area/abc.

  • What happened: the new note's title became "09:30 - 10:30 description", its body became #area/abc, and the tag disappeared from the log line.

Design (kayg's proposal plus Claude's refinements; kayg can veto):

  • New note's title: description, with no times and no tags.
  • New note's frontmatter:
    • start: 2026-10-14T09:30:00+05:30 and end: 2026-10-14T10:30:00+05:30, ISO with the zone (ADR on times). An open entry (09:30 description) gets only start. An end before the start means the next day.
    • date: is set the usual way.
    • tags: [area/abc], so the body starts clean.
  • The log line stays where it is and keeps its tags: * 09:30 - 10:30 [description](<description.md>) #area/abc, so the day still reads the same and stays searchable.
  • Any line, not just log lines: trailing #tags on any line pressed → go to the new note's tags: and stay on the line. Only the words become the link.
  • Undo: one undo removes the new note and restores the line exactly.
  • Parsing: log-line parsing reuses the daily/log plugin's own parser, so the two can never disagree.
kayg pressed → on the log line `* 09:30 - 10:30 description #area/abc`. - **What happened:** the new note's title became "09:30 - 10:30 description", its body became `#area/abc`, and the tag disappeared from the log line. **Design** (kayg's proposal plus Claude's refinements; kayg can veto): - **New note's title:** `description`, with no times and no tags. - **New note's frontmatter:** - `start: 2026-10-14T09:30:00+05:30` and `end: 2026-10-14T10:30:00+05:30`, ISO with the zone (ADR on times). An open entry (`09:30 description`) gets only `start`. An end before the start means the next day. - `date:` is set the usual way. - `tags: [area/abc]`, so the body starts clean. - **The log line stays where it is and keeps its tags:** `* 09:30 - 10:30 [description](<description.md>) #area/abc`, so the day still reads the same and stays searchable. - **Any line, not just log lines:** trailing `#tags` on any line pressed → go to the new note's `tags:` and stay on the line. Only the words become the link. - **Undo:** one undo removes the new note and restores the line exactly. - **Parsing:** log-line parsing reuses the daily/log plugin's own parser, so the two can never disagree.
Author
Owner

PR #223.

Result for kayg's line * 09:30 - 10:30 description #area/abc in 2026-10-14.md, at +05:30 (tested in crates/daily/src/tests.rs):

  • New note description.md:
    ---
    start: 2026-10-14T09:30:00+05:30
    end: 2026-10-14T10:30:00+05:30
    tags: [area/abc]
    ---
    # description
    
    The usual calternal-id, date and last edited are added on save as always.
  • Log line: * 09:30 - 10:30 [description](<description.md>) #area/abc
  • - 23:30 - 00:15 Late call #work gets end: 2026-10-15T00:15:00+05:30.
  • One undo per job restores the day byte for byte and removes the note.

Choices to veto

  • Times are read only in day notes (YYYY-MM-DD.md), because only those have a date. In other notes, a time stays part of the words, but trailing tags are still moved.
  • A line that is only times and/or tags (- 09:30 #gym) has no words to name a note, so it is read as plain words, the same as before.
  • The timezone is the device's (the web sends it). Without it, the note's date: offset is used, then UTC.

Tests

  • Line parser property tests (512 cases each) pass. They cover times with and without an end, past midnight, seconds, multiple and nested tags, tags in code or links (they stay), only tags, emoji, CJK, and any input.
  • e2e smart-note.spec.ts passes 2/2 in Chromium and 2/2 in WebKit at 1440 (--repeat-each 2).

Perf (release, machine load ~100):

time per →
line read, 5000-line day note, first version (parsed the whole day) 37 ms
line read, 5000-line day note, shipped (reads only that line) 0.27 ms
tags-only read, any line ~1 µs

The make-note job itself is unchanged: same steps, same single undo.

Note: on this overloaded box, WebKit e2e often waits forever for the toast's Undo button to "be stable". This also happens on dev for links.spec.ts:101 and :11. My test hovers the toast with force so the Undo stays up.

PR #223. **Result** for kayg's line `* 09:30 - 10:30 description #area/abc` in `2026-10-14.md`, at +05:30 (tested in `crates/daily/src/tests.rs`): - New note `description.md`: ``` --- start: 2026-10-14T09:30:00+05:30 end: 2026-10-14T10:30:00+05:30 tags: [area/abc] --- # description ``` The usual `calternal-id`, `date` and `last edited` are added on save as always. - Log line: `* 09:30 - 10:30 [description](<description.md>) #area/abc` - `- 23:30 - 00:15 Late call #work` gets `end: 2026-10-15T00:15:00+05:30`. - One undo per job restores the day byte for byte and removes the note. **Choices to veto** - Times are read only in day notes (`YYYY-MM-DD.md`), because only those have a date. In other notes, a time stays part of the words, but trailing tags are still moved. - A line that is only times and/or tags (`- 09:30 #gym`) has no words to name a note, so it is read as plain words, the same as before. - The timezone is the device's (the web sends it). Without it, the note's `date:` offset is used, then UTC. **Tests** - Line parser property tests (512 cases each) pass. They cover times with and without an end, past midnight, seconds, multiple and nested tags, tags in code or links (they stay), only tags, emoji, CJK, and any input. - e2e `smart-note.spec.ts` passes 2/2 in Chromium and 2/2 in WebKit at 1440 (`--repeat-each 2`). **Perf** (release, machine load ~100): | | time per → | |---|---| | line read, 5000-line day note, first version (parsed the whole day) | 37 ms | | line read, 5000-line day note, shipped (reads only that line) | **0.27 ms** | | tags-only read, any line | ~1 µs | The make-note job itself is unchanged: same steps, same single undo. **Note**: on this overloaded box, WebKit e2e often waits forever for the toast's Undo button to "be stable". This also happens on dev for `links.spec.ts:101` and `:11`. My test hovers the toast with `force` so the Undo stays up.
kayg closed this issue 2026-10-14 11:12:08 +00:00
Sign in to join this conversation.
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#149
No description provided.