Skip to content

armgit / mso

Public Imported from GitHub
0

Browser-based graphical shell and control plane for a Linux server you own — real terminal, file manager, live metrics and BYOK AI in one mobile-first workspace. Next.js 16 · React 19 · node-pty · Tailwind v4 · shadcn/ui. Public alpha, self-hosted.

fix(assistant): reset thread drawer state during render, not in effect

Abdurrahman Fakhrul101b3deead1e
diff --git a/frontend/slices/assistant/components/thread-list.tsx b/frontend/slices/assistant/components/thread-list.tsx
index cb1c7635..37e8daa4 100644
--- a/frontend/slices/assistant/components/thread-list.tsx
+++ b/frontend/slices/assistant/components/thread-list.tsx
@@ -40,13 +40,20 @@ export function ThreadList({
.catch(() => setError("Failed to load chats"));
}, []);
- useEffect(() => {
+ // Fresh drawer chrome every open (render-time state adjustment — no effect
+ // setState): reopening never lands mid-rename or with a stale error/confirm.
+ const [prevOpen, setPrevOpen] = useState(open);
+ if (open !== prevOpen) {
+ setPrevOpen(open);
if (open) {
- load();
setEditingId(null);
setConfirmDeleteId(null);
setError(null);
}
+ }
+
+ useEffect(() => {
+ if (open) load();
}, [open, load]);
async function resume(id: string) {