From 43fa95d7fe751577f7803e9b17f114bf9149062e Mon Sep 17 00:00:00 2001 From: limiteinductive Date: Sun, 29 Mar 2026 21:51:49 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20codex=20review=20=E2=80=94=20compact=20a?= =?UTF-8?q?cross=20midnight,=20typed=20msg=20badges,=20URL=20punct?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Don't compact after date separator (show full header on new day) - Don't compact typed messages (result/error/plan keep their badges) - URL regex stops before trailing ),. so links don't grab punctuation Co-Authored-By: Claude Opus 4.6 (1M context) --- ui/colony/src/App.tsx | 4 +++- ui/colony/src/components/MessageItem.tsx | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ui/colony/src/App.tsx b/ui/colony/src/App.tsx index 77779f4..8a1685b 100644 --- a/ui/colony/src/App.tsx +++ b/ui/colony/src/App.tsx @@ -210,10 +210,12 @@ export default function App() { const prev = i > 0 ? messages[i - 1] : null; const sameSender = prev && prev.user.username === msg.user.username; const withinWindow = prev && (new Date(msg.created_at).getTime() - new Date(prev.created_at).getTime()) < 5 * 60 * 1000; - const compact = !!(sameSender && withinWindow && !msg.reply_to); const prevDate = prev ? new Date(prev.created_at).toDateString() : null; const thisDate = new Date(msg.created_at).toDateString(); const showDate = prevDate !== thisDate; + // Don't compact: after date break, typed messages (non-text), or replies + const isTyped = msg.type !== "text"; + const compact = !!(sameSender && withinWindow && !msg.reply_to && !showDate && !isTyped); return (
diff --git a/ui/colony/src/components/MessageItem.tsx b/ui/colony/src/components/MessageItem.tsx index 96ab5a6..f34e5b1 100644 --- a/ui/colony/src/components/MessageItem.tsx +++ b/ui/colony/src/components/MessageItem.tsx @@ -35,7 +35,8 @@ function timeAgo(dateStr: string): string { function renderContent(text: string) { // Split on @mentions and URLs - const parts = text.split(/((?:https?:\/\/)[^\s]+|@[\w-]+)/g); + // URL regex: stop before trailing punctuation like ),. etc + const parts = text.split(/((?:https?:\/\/)[^\s),.\]}>]+|@[\w-]+)/g); return parts.map((part, i) => { if (part.startsWith("@")) { return (