From f71b69ca8bd811aa3ec0f55dd53a78c0539f3f7d Mon Sep 17 00:00:00 2001 From: James Magahern Date: Sat, 30 May 2026 18:33:58 -0700 Subject: [PATCH] some ui tweaks --- web/src/App.tsx | 116 ++++++++++++++++++++++++++++-------------------- 1 file changed, 67 insertions(+), 49 deletions(-) diff --git a/web/src/App.tsx b/web/src/App.tsx index f38b496..2290668 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -821,6 +821,7 @@ export default function App() { const [isRenamingChat, setIsRenamingChat] = useState(false); const [isChatSettingsOpen, setIsChatSettingsOpen] = useState(false); const [isSavingChatSettings, setIsSavingChatSettings] = useState(false); + const [isTogglingChatSettingsStar, setIsTogglingChatSettingsStar] = useState(false); const [chatSettingsError, setChatSettingsError] = useState(null); const [draftChatTitle, setDraftChatTitle] = useState(""); const [chatSettingsTitleDraft, setChatSettingsTitleDraft] = useState(""); @@ -957,6 +958,7 @@ export default function App() { setPendingAttachments([]); setIsChatSettingsOpen(false); setIsSavingChatSettings(false); + setIsTogglingChatSettingsStar(false); setChatSettingsError(null); setDraftChatTitle(""); setChatSettingsTitleDraft(""); @@ -1353,11 +1355,6 @@ export default function App() { return chats.find((chat) => chat.id === selectedItem.id) ?? null; }, [chats, selectedItem]); - const selectedSidebarItem = useMemo(() => { - if (!selectedItem) return null; - return sidebarItems.find((item) => item.kind === selectedItem.kind && item.id === selectedItem.id) ?? null; - }, [selectedItem, sidebarItems]); - const selectedSearchSummary = useMemo(() => { if (!selectedItem || selectedItem.kind !== "search") return null; return searches.find((search) => search.id === selectedItem.id) ?? null; @@ -1737,6 +1734,29 @@ export default function App() { } }; + const handleToggleChatSettingsStar = async () => { + if (draftKind !== null || selectedItem?.kind !== "chat" || isTogglingChatSettingsStar) return; + const current = sidebarItems.find((item) => item.kind === "chat" && item.id === selectedItem.id); + const nextStarred = !current?.starred; + setIsTogglingChatSettingsStar(true); + setChatSettingsError(null); + setError(null); + + try { + const updatedChat = await updateChatStar(selectedItem.id, nextStarred); + applyChatSummary(updatedChat, false); + } catch (err) { + const message = err instanceof Error ? err.message : String(err); + if (message.includes("bearer token")) { + handleAuthFailure(message); + } else { + setChatSettingsError(message); + } + } finally { + setIsTogglingChatSettingsStar(false); + } + }; + const handleDeleteFromContextMenu = async () => { if (!contextMenu || isItemRunning(contextMenu.item)) return; const target = contextMenu.item; @@ -2817,6 +2837,10 @@ export default function App() { } }; + const chatSettingsChatId = draftKind === null && selectedItem?.kind === "chat" ? selectedItem.id : null; + const chatSettingsStarred = chatSettingsChatId + ? sidebarItems.find((item) => item.kind === "chat" && item.id === chatSettingsChatId)?.starred ?? false + : false; if (isCheckingSession) { return ( @@ -2995,8 +3019,8 @@ export default function App() {
-
-
+
+
- ) : null} - {draftKind === null && selectedItem?.kind === "chat" ? ( - - ) : null}
-
+
{!isSearchMode ? (
-