Skip to content

A team of long-lived bots for DeepSeek Harness, with main bots, bot-to-bot messages and group chats.

Anchor the account menu before it opens as well as on resize

Fei241188e23acbc567
diff --git a/ds-bot/client.js b/ds-bot/client.js
index f102d3a0..cc565215 100644
--- a/ds-bot/client.js
+++ b/ds-bot/client.js
@@ -6784,12 +6784,17 @@ function AccountLauncher({ seat = true, settingsOpen, openSettings, openOnboardi
}
};
const tick = useViewport();
- (0, import_react11.useLayoutEffect)(() => {
- if (!open) return;
+ const anchor = () => {
const rect = button.current?.getBoundingClientRect();
if (rect) setBox({ left: rect.left, bottom: viewBottom() - rect.top + 5 });
+ };
+ (0, import_react11.useLayoutEffect)(() => {
+ if (open) anchor();
}, [open, tick]);
- const toggle = () => setOpen((value) => !value);
+ const toggle = () => {
+ if (!open) anchor();
+ setOpen((value) => !value);
+ };
(0, import_react11.useEffect)(() => {
if (open) return;
setConfirm(null);
diff --git a/ds-bot/src/client/sidebar.js b/ds-bot/src/client/sidebar.js
index 55afc4ac..2d7017cd 100644
--- a/ds-bot/src/client/sidebar.js
+++ b/ds-bot/src/client/sidebar.js
@@ -557,12 +557,12 @@ export function AccountLauncher({ seat = true, settingsOpen, openSettings, openO
}
}
const tick = useViewport()
- useLayoutEffect(() => {
- if (!open) return
+ const anchor = () => {
const rect = button.current?.getBoundingClientRect()
if (rect) setBox({ left: rect.left, bottom: viewBottom() - rect.top + 5 })
- }, [open, tick])
- const toggle = () => setOpen(value => !value)
+ }
+ useLayoutEffect(() => { if (open) anchor() }, [open, tick])
+ const toggle = () => { if (!open) anchor(); setOpen(value => !value) }
// Closing the menu drops a half-finished sign-out confirm with it.
useEffect(() => {
if (open) return