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

Closed
kayg wants to merge 0 commits from issue/149-smart-note into dev
Owner

Closes #149.

→ on * 09:30 - 10:30 description #area/abc in a day's note now makes description with

---
start: 2026-10-14T09:30:00+05:30
end: 2026-10-14T10:30:00+05:30
tags: [area/abc]
---
# description

and the line becomes * 09:30 - 10:30 [description](<description.md>) #area/abc. One undo takes both notes back.

How

  • The server reads the line (crates/notes/src/smartline.rs), so the CLI and agents get the same result. Trailing #tags on any line go to tags: and stay on the line. Tags in the middle of the words, in code or in links stay words. A line with only times and tags is read as plain words.
  • Log times come from the daily plugin's own parser through a small LineTimes reader that DailyPlugin::new gives the notes plugin (crates/daily/src/times.rs, log::entry_at). Only day notes (YYYY-MM-DD.md) have times. An end before the start falls on the next day.
  • notes.make-note takes an optional tz, which the web app sends. Without it, the note's date: offset is used, then UTC.
  • The web app's "already a link, just open it" check now also matches a log line with times and tags.
  • Shape's unused content field is removed. contracts/actions.json and actions.gen.ts are regenerated for tz.

Tests

  • Property tests (512 cases each, crates/daily/src/times_tests.rs) cover times with and without an end, past midnight, seconds, multiple and nested tags, tags in code or links, a line with only tags, emoji and CJK, plus any input being safe to read.
  • The engine test runs make-note on a log line, then a past-midnight line, then undoes both. The source comes back byte for byte.
  • apps/web/e2e/smart-note.spec.ts (Chromium and WebKit, 1440) presses → on a log line, then checks the title, the frontmatter, the rewritten line and Undo.

Perf: reading the one line is 0.27 ms on a 5000-line day note and about 1 µs for tags only. A first version that parsed the whole day took 37 ms, so it was changed to read only the one line.

🤖 Generated with Claude Code

Closes #149. → on `* 09:30 - 10:30 description #area/abc` in a day's note now makes **description** with ``` --- start: 2026-10-14T09:30:00+05:30 end: 2026-10-14T10:30:00+05:30 tags: [area/abc] --- # description ``` and the line becomes `* 09:30 - 10:30 [description](<description.md>) #area/abc`. One undo takes both notes back. **How** - The server reads the line (`crates/notes/src/smartline.rs`), so the CLI and agents get the same result. Trailing `#tags` on any line go to `tags:` and stay on the line. Tags in the middle of the words, in code or in links stay words. A line with only times and tags is read as plain words. - Log times come from the daily plugin's own parser through a small `LineTimes` reader that `DailyPlugin::new` gives the notes plugin (`crates/daily/src/times.rs`, `log::entry_at`). Only day notes (`YYYY-MM-DD.md`) have times. An end before the start falls on the next day. - `notes.make-note` takes an optional `tz`, which the web app sends. Without it, the note's `date:` offset is used, then UTC. - The web app's "already a link, just open it" check now also matches a log line with times and tags. - Shape's unused `content` field is removed. `contracts/actions.json` and `actions.gen.ts` are regenerated for `tz`. **Tests** - Property tests (512 cases each, `crates/daily/src/times_tests.rs`) cover times with and without an end, past midnight, seconds, multiple and nested tags, tags in code or links, a line with only tags, emoji and CJK, plus any input being safe to read. - The engine test runs make-note on a log line, then a past-midnight line, then undoes both. The source comes back byte for byte. - `apps/web/e2e/smart-note.spec.ts` (Chromium and WebKit, 1440) presses → on a log line, then checks the title, the frontmatter, the rewritten line and Undo. **Perf**: reading the one line is 0.27 ms on a 5000-line day note and about 1 µs for tags only. A first version that parsed the whole day took 37 ms, so it was changed to read only the one line. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
→ on a log line makes a smart note: title, times, tags, link back (#149)
Some checks failed
CI / rust (pull_request) Successful in 2m14s
CI / web (pull_request) Failing after 9m21s
16b70d97ac
The server reads the line → was pressed on (crates/notes/src/smartline.rs):
- a log line's times become start:/end: in the new note, with the date and
  zone (an end before the start is the next day). The daily plugin reads
  them with its own log parser, handed to the notes as a LineTimes reader
  by DailyPlugin::new, so a log line means the same thing everywhere.
- trailing #tags on any line become tags: and stay on the line.
- only the words become the title and the link; the rest of the line
  stays exactly as it was. One job, so one undo takes both notes back.

notes.make-note takes an optional tz; the web app sends the device's.
Property tests for the line reader (times with and without an end, past
midnight, many and nested tags, tags in code or links, only tags, emoji,
CJK) and an e2e test in Chromium and WebKit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T
Author
Owner

Review: the server parses the line, with times from the daily plugin's own parser through a hook.

  • Start and end are ISO with the zone; an end before the start rolls to the next day.
  • Tags go to frontmatter and stay on the line; only the words become the link.
  • One undo puts everything back.

After merging dev: fmt passes; calternal, notes (140) and daily (21) tests pass; svelte-check reports 0 errors.

Merging.

Review: the server parses the line, with times from the daily plugin's own parser through a hook. - Start and end are ISO with the zone; an end before the start rolls to the next day. - Tags go to frontmatter and stay on the line; only the words become the link. - One undo puts everything back. **After merging dev:** fmt passes; calternal, notes (140) and daily (21) tests pass; svelte-check reports 0 errors. Merging.
kayg closed this pull request 2026-10-14 11:12:02 +00:00
Some checks failed
CI / rust (pull_request) Successful in 2m14s
CI / web (pull_request) Failing after 9m21s

Pull request closed

Sign in to join this conversation.
No reviewers
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!223
No description provided.