fix: ui fixes

This commit is contained in:
gosangam
2026-06-11 00:32:04 +05:30
parent 4b159cb4d9
commit ead8ad02e8
16 changed files with 769 additions and 266 deletions
@@ -37,12 +37,17 @@ type Status = "idle" | "saving" | "saved" | "auth" | "limit" | "error";
export function CollectionsDrawer({
open,
onClose,
onSaved,
isMobile,
selectedText,
existingPostId,
}: {
open: boolean;
onClose: () => void;
/** Called instead of onClose after a successful save. Lets the selection
* toolbar end the flow (drop the selection) rather than restore it the
* way a cancel/dismiss does. Falls back to onClose when omitted. */
onSaved?: () => void;
isMobile: boolean;
/** Provided by the selection toolbar — the drawer will create a fresh
* post from this text before adding it to a collection. */
@@ -150,7 +155,9 @@ export function CollectionsDrawer({
c.id === collectionID ? { ...c, item_count: c.item_count + 1 } : c,
),
);
setTimeout(onClose, 800);
// Leave the "Saved ✓" row state visible for a beat, then complete the
// flow — onSaved (don't restore the selection) when provided.
setTimeout(onSaved ?? onClose, 800);
} catch (err) {
if (err instanceof SocialError) {
const tone: Status =