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:
@@ -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 });
|
||||
}
|
||||
}}
|
||||
/>
|
||||
))
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user