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:
Jure
2026-03-21 15:41:48 +01:00
parent acb0d531c0
commit af32952fd8
3 changed files with 149 additions and 70 deletions

View File

@@ -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"
>