Skip to content

Add jot link command to attach external issue/PR URLs to notes#19

Open
Intina47 wants to merge 1 commit into
mainfrom
mamba/add-url-linking-to-notes
Open

Add jot link command to attach external issue/PR URLs to notes#19
Intina47 wants to merge 1 commit into
mainfrom
mamba/add-url-linking-to-notes

Conversation

@Intina47

Copy link
Copy Markdown
Owner

Motivation

  • Provide a simple way to attach external issue/PR URLs to the most recent note so context can be preserved with a note.
  • Persist URL metadata alongside the journal so links can be surfaced when reviewing notes.

Description

  • Add a jot link <url> command entrypoint in main.go and implement jotLink to parse, enrich, and persist link metadata in ~/.jot/links.jsonl using a new LinkMetadata struct.
  • Implement parseLinkURL to validate schemes and extract GitHub owner/repo/kind/number when applicable, and latestNoteTimestamp to associate links with the most recent note.
  • Load stored links in jot list via loadLinksByTimestamp and render associated URLs under their linked note in the interactive listing.
  • Add unit tests for URL parsing and storage (TestParseLinkURLGitHubPull, TestParseLinkURLRejectsScheme, TestJotLinkStoresMetadata) and update README.md with a usage example and storage location (~/.jot/links.jsonl).

Testing

  • Ran the test suite with go test ./..., and all tests passed.
  • Added unit tests exercise parsing and end-to-end storage of a GitHub PR URL, and those tests succeeded under CI-local run.
  • Formatted changes with gofmt before running the tests.

Codex Task

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread main.go
Comment on lines +116 to +118

info.NoteTimestamp = lastTimestamp
info.AddedAt = now().UTC().Format(time.RFC3339)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant