Skip to content

armgit / alook

Public Imported from GitHub
0

Multi-Agent Collaboration for Team and Friends

fix(community): profile card animates out in place instead of flying to top-left

Generab8737388699
diff --git a/src/web/src/components/community/profile-card.tsx b/src/web/src/components/community/profile-card.tsx
index fafe8164b..e7c9df584 100644
--- a/src/web/src/components/community/profile-card.tsx
+++ b/src/web/src/components/community/profile-card.tsx
@@ -36,14 +36,16 @@ export function ProfileCard({ data, x, y, bp, onClose, onMessage, isSelf, onUpda
onUpdateStatus?: (emoji: string | null, text: string | null) => void
}) {
const [msg, setMsg] = useState("")
+ const [open, setOpen] = useState(true)
+ const mobile = bp === "mobile"
+ const close = () => setOpen(false)
const send = () => {
const text = msg.trim()
if (!text) return
onMessage?.(data.name, text)
setMsg("")
- onClose()
+ mobile ? onClose() : close()
}
- const mobile = bp === "mobile"
const gradient = generateGradient(data.name)
const card = (
<>
@@ -186,7 +188,7 @@ export function ProfileCard({ data, x, y, bp, onClose, onMessage, isSelf, onUpda
// desktop: shadcn Popover anchored to an invisible trigger at the click point
return (
- <Popover open onOpenChange={(o) => { if (!o) onClose() }}>
+ <Popover open={open} onOpenChange={setOpen} onOpenChangeComplete={(nowOpen) => { if (!nowOpen) onClose() }}>
<PopoverTrigger
aria-hidden
tabIndex={-1}
diff --git a/src/web/src/components/community/shell-frame.tsx b/src/web/src/components/community/shell-frame.tsx
index d63665d88..807967b11 100644
--- a/src/web/src/components/community/shell-frame.tsx
+++ b/src/web/src/components/community/shell-frame.tsx
@@ -408,7 +408,6 @@ export function ShellFrame({
}
const profileMessage = async (name: string, text: string) => {
- setProfile(null)
const member = members.find((m) => m.name === name)
const friend = friends.find((f) => f.name === name)
const targetUserId = member?.userId ?? friend?.userId