mirror of
https://github.com/hoornet/vega.git
synced 2026-05-09 13:49:12 -07:00
Fix thread reply UX: inline reply boxes below each note, scroll-to-parent
Reply boxes now open directly below the note you're replying to instead of scrolling to a top-level composer. "Replying to" link scrolls to the parent note when already visible in the thread instead of re-pushing the same thread.
This commit is contained in:
@@ -124,8 +124,16 @@ export function NoteCard({ event, focused, onReplyInThread }: NoteCardProps) {
|
||||
<button
|
||||
onClick={async (e) => {
|
||||
e.stopPropagation();
|
||||
// If already in thread view, try scrolling to parent first
|
||||
if (currentView === "thread") {
|
||||
const el = document.querySelector(`[data-note-id="${parentEventId}"]`);
|
||||
if (el) {
|
||||
el.scrollIntoView({ behavior: "smooth", block: "center" });
|
||||
return;
|
||||
}
|
||||
}
|
||||
const parent = await fetchNoteById(parentEventId);
|
||||
if (parent) openThread(parent, currentView as "feed" | "profile");
|
||||
if (parent) openThread(parent);
|
||||
}}
|
||||
className="hover:text-accent transition-colors"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user