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

Closed
kayg wants to merge 0 commits from issue/149-merge 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

(Replaces #223, merged with current dev. Review on #223.)

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) (Replaces #223, merged with current dev. Review on #223.)
→ 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
Merge remote-tracking branch 'origin/dev' into issue/149-smart-note
Some checks failed
CI / web (pull_request) Failing after 27s
CI / rust (pull_request) Successful in 1m45s
af03d990d4
Author
Owner

Closing: this branch is already fully contained in dev (it landed through a merge train). Branch cleanup, 2026-10-15.

Closing: this branch is already fully contained in `dev` (it landed through a merge train). Branch cleanup, 2026-10-15.
kayg closed this pull request 2026-10-15 08:34:36 +00:00
Some checks failed
CI / web (pull_request) Failing after 27s
CI / rust (pull_request) Successful in 1m45s

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!241
No description provided.