From 51720980736b170569665e4863c4b7937a525e16 Mon Sep 17 00:00:00 2001 From: Shadow Date: Sun, 25 Jan 2026 22:30:18 -0600 Subject: [PATCH] Tlon: format reply IDs as @ud (#1837) --- CHANGELOG.md | 1 + extensions/tlon/src/urbit/send.ts | 25 +++++++++++++++++++------ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e5813b5d1..2b1dfa6fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ Status: unreleased. - Docs: add Render deployment guide. (#1975) Thanks @anurag. - Docs: credit both contributors for Control UI refresh. (#1852) Thanks @EnzeD. - Onboarding: add Venice API key to non-interactive flow. (#1893) Thanks @jonisjongithub. +- Tlon: format thread reply IDs as @ud. (#1837) Thanks @wca4a. - CI: increase Node heap size for macOS checks. (#1890) Thanks @realZachi. - macOS: avoid crash when rendering code blocks by bumping Textual to 0.3.1. (#2033) Thanks @garricn. - Browser: fall back to URL matching for extension relay target resolution. (#1999) Thanks @jonit-dev. diff --git a/extensions/tlon/src/urbit/send.ts b/extensions/tlon/src/urbit/send.ts index 35f7f2d74..621bbd69a 100644 --- a/extensions/tlon/src/urbit/send.ts +++ b/extensions/tlon/src/urbit/send.ts @@ -63,16 +63,28 @@ export async function sendGroupMessage({ const story = [{ inline: [text] }]; const sentAt = Date.now(); + // Format reply ID as @ud (with dots) - required for Tlon to recognize thread replies + let formattedReplyId = replyToId; + if (replyToId && /^\d+$/.test(replyToId)) { + try { + formattedReplyId = formatUd(BigInt(replyToId)); + } catch { + // Fall back to raw ID if formatting fails + } + } + const action = { channel: { nest: `chat/${hostShip}/${channelName}`, - action: replyToId + action: formattedReplyId ? { - reply: { - id: replyToId, - delta: { - add: { - memo: { + // Thread reply - needs post wrapper around reply action + // ReplyActionAdd takes Memo: {content, author, sent} - no kind/blob/meta + post: { + reply: { + id: formattedReplyId, + action: { + add: { content: story, author: fromShip, sent: sentAt, @@ -82,6 +94,7 @@ export async function sendGroupMessage({ }, } : { + // Regular post post: { add: { content: story,