reply UX: show username + content preview instead of hash

- ComposeBox takes ReplyContext {id, username, content} instead of string
- Reply chip shows "^ benji message preview..." with truncation
- App passes full reply context from messagesById

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-29 21:14:35 +02:00
parent c0f48c5672
commit 1f9201dd03
2 changed files with 18 additions and 6 deletions

View File

@@ -43,7 +43,7 @@ export default function App() {
const [activeChannelId, setActiveChannelId] = useState<string | null>(null);
const [messages, setMessages] = useState<Message[]>([]);
const [loading, setLoading] = useState(false);
const [replyTo, setReplyTo] = useState<string | null>(null);
const [replyTo, setReplyTo] = useState<{ id: string; username: string; content: string } | null>(null);
const [sheetOpen, setSheetOpen] = useState(false);
const scrollRef = useRef<HTMLDivElement>(null);
const prevMsgCountRef = useRef(0);
@@ -178,7 +178,12 @@ export default function App() {
key={msg.id}
message={msg}
replyTarget={msg.reply_to ? messagesById.get(msg.reply_to) : undefined}
onReply={setReplyTo}
onReply={(id) => {
const target = messagesById.get(id);
if (target) {
setReplyTo({ id, username: target.user.display_name, content: target.content });
}
}}
/>
))
)}