Add jot link command to attach external issue/PR URLs to notes#19
Add jot link command to attach external issue/PR URLs to notes#19Intina47 wants to merge 1 commit into
jot link command to attach external issue/PR URLs to notes#19Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: adce37a722
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| info.NoteTimestamp = lastTimestamp | ||
| info.AddedAt = now().UTC().Format(time.RFC3339) |
There was a problem hiding this comment.
Use unique note IDs when storing links
Because jotLink persists only the note timestamp, links are keyed solely by the minute-level stamp used in note lines (format 2006-01-02 15:04 in jotInit). If a user records two notes within the same minute, they share the same NoteTimestamp, so a later jot link will show under all notes with that timestamp rather than just the most recent one. This violates the “attach to the most recent note” behavior and will surface incorrect associations whenever multiple notes exist in the same minute; consider storing a unique identifier (e.g., full line or line index) to disambiguate.
Useful? React with 👍 / 👎.
Motivation
Description
jot link <url>command entrypoint inmain.goand implementjotLinkto parse, enrich, and persist link metadata in~/.jot/links.jsonlusing a newLinkMetadatastruct.parseLinkURLto validate schemes and extract GitHub owner/repo/kind/number when applicable, andlatestNoteTimestampto associate links with the most recent note.jot listvialoadLinksByTimestampand render associated URLs under their linked note in the interactive listing.TestParseLinkURLGitHubPull,TestParseLinkURLRejectsScheme,TestJotLinkStoresMetadata) and updateREADME.mdwith a usage example and storage location (~/.jot/links.jsonl).Testing
go test ./..., and all tests passed.gofmtbefore running the tests.Codex Task