Skip to content

feat(autolink): tg#<id> message refs + GitHub-anchor line specs#34

Open
alex-mextner wants to merge 1 commit into
mainfrom
tg-autolink-excerpt
Open

feat(autolink): tg#<id> message refs + GitHub-anchor line specs#34
alex-mextner wants to merge 1 commit into
mainfrom
tg-autolink-excerpt

Conversation

@alex-mextner

Copy link
Copy Markdown
Owner

Three bounded fixes (ROADMAP §9 / tg-cli #28, #29, #32):

tg#28 — tg#<id> message-ref convention. The inbound inject wrap now
renders an inbound message id as tg#<id> (was bare #<id>), and a new
autolink-msgrefs feature (ON by default) links those refs in outbound
text. It runs BEFORE the #N PR pass, so a quoted-back tg#3715 is never
mis-resolved as issue/PR #3715. Deep link only for a supergroup chat; in a
private DM the ref is marked but unlinked (no public per-message URL).

tg#29 — file-excerpt attachment now also recognizes the GitHub permalink
anchor forms file#L10, file#L10-L20, file#L10-20 (second L optional)
alongside file:N / :N-M / :N:C, so a pasted GitHub line link gets the
inline excerpt + marker-injected attachment. Line numbers are 1-based across
ALL forms now (a 0 line is rejected consistently).

tg#32 — AGENTS.md stale "~578 tests" updated to the real current count.

VERSION 1.11.0 -> 1.12.0 + CHANGELOG. New spec docs/specs/autolink-msgrefs.md;
auto-attach spec updated for the #L forms.

Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com

Three bounded fixes (ROADMAP §9 / tg-cli #28, #29, #32):

tg#28 — `tg#<id>` message-ref convention. The inbound inject wrap now
renders an inbound message id as `tg#<id>` (was bare `#<id>`), and a new
`autolink-msgrefs` feature (ON by default) links those refs in outbound
text. It runs BEFORE the `#N` PR pass, so a quoted-back `tg#3715` is never
mis-resolved as issue/PR #3715. Deep link only for a supergroup chat; in a
private DM the ref is marked but unlinked (no public per-message URL).

tg#29 — file-excerpt attachment now also recognizes the GitHub permalink
anchor forms `file#L10`, `file#L10-L20`, `file#L10-20` (second `L` optional)
alongside `file:N` / `:N-M` / `:N:C`, so a pasted GitHub line link gets the
inline excerpt + marker-injected attachment. Line numbers are 1-based across
ALL forms now (a 0 line is rejected consistently).

tg#32 — AGENTS.md stale "~578 tests" updated to the real current count.

VERSION 1.11.0 -> 1.12.0 + CHANGELOG. New spec docs/specs/autolink-msgrefs.md;
auto-attach spec updated for the `#L` forms.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@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: f165a0fe63

ℹ️ 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".

* cleanly. */
function styledRef(token: string): string {
const uni = toBoldItalic(token);
return uni !== null ? escapeHtml(uni) : `<i>${escapeHtml(token)}</i>`;

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 Prevent private tg refs from being re-linked as GitHub refs

In private DMs/basic groups msgRefUrl() returns null, so this path renders tg#3715 as plain styled text while leaving the ASCII #3715 outside any tag. If the same outbound message also has a resolved bare #3715, the later GitHub linkifier sees 𝒕𝒈#3715 as a valid #3715 boundary and rewrites the message reference into a GitHub link, defeating the namespace separation specifically in the no-deep-link case.

Useful? React with 👍 / 👎.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant