Skip to content

Commit c384541

Browse files
committed
Release v0.0.18
## What's New ### Features - Added Cmd+Enter shortcut for "Implement plan" button - Improved archive popover: auto-unarchive on selection, input clears on revisit ### Fixes - Fixed sidebar flickering when switching between chats
1 parent 1181c7a commit c384541

3 files changed

Lines changed: 25 additions & 21 deletions

File tree

src/renderer/features/agents/main/active-chat.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3041,7 +3041,7 @@ function ChatViewInner({
30413041
isDragOver && "ring-2 ring-primary/50 border-primary/50",
30423042
isFocused && !isDragOver && "ring-2 ring-primary/50",
30433043
)}
3044-
maxHeight={240}
3044+
maxHeight={200}
30453045
onSubmit={handleSend}
30463046
contextItems={
30473047
images.length > 0 || files.length > 0 ? (
@@ -3110,7 +3110,7 @@ function ChatViewInner({
31103110
onShiftTab={() => setIsPlanMode((prev) => !prev)}
31113111
placeholder="Plan, @ for context, / for commands"
31123112
className={cn(
3113-
"bg-transparent max-h-[240px] overflow-y-auto p-1",
3113+
"bg-transparent max-h-[200px] overflow-y-auto p-1",
31143114
isMobile && "min-h-[56px]",
31153115
)}
31163116
onPaste={handlePaste}
@@ -3380,7 +3380,7 @@ function ChatViewInner({
33803380
className="h-7 gap-1.5 rounded-lg"
33813381
>
33823382
Implement plan
3383-
<Kbd className="text-primary-foreground/80">
3383+
<Kbd className="text-primary-foreground/70">
33843384
⌘↵
33853385
</Kbd>
33863386
</Button>

src/renderer/features/sub-chats/sub-chat-selector.tsx

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import {
2323
useAgentSubChatStore,
2424
type SubChatMeta,
2525
} from "../agents/stores/sub-chat-store"
26+
import { useShallow } from "zustand/react/shallow"
2627
import { PopoverTrigger } from "../../components/ui/popover"
2728
import {
2829
Tooltip,
@@ -80,15 +81,16 @@ export function SubChatSelector({
8081
isDiffSidebarOpen = false,
8182
diffStats,
8283
}: SubChatSelectorProps) {
83-
const activeSubChatId = useAgentSubChatStore((state) => state.activeSubChatId)
84-
const openSubChatIds = useAgentSubChatStore((state) => state.openSubChatIds)
85-
const pinnedSubChatIds = useAgentSubChatStore(
86-
(state) => state.pinnedSubChatIds,
87-
)
88-
const allSubChats = useAgentSubChatStore((state) => state.allSubChats)
89-
const parentChatId = useAgentSubChatStore((state) => state.chatId)
90-
const togglePinSubChat = useAgentSubChatStore(
91-
(state) => state.togglePinSubChat,
84+
// Use shallow comparison to prevent re-renders when arrays have same content
85+
const { activeSubChatId, openSubChatIds, pinnedSubChatIds, allSubChats, parentChatId, togglePinSubChat } = useAgentSubChatStore(
86+
useShallow((state) => ({
87+
activeSubChatId: state.activeSubChatId,
88+
openSubChatIds: state.openSubChatIds,
89+
pinnedSubChatIds: state.pinnedSubChatIds,
90+
allSubChats: state.allSubChats,
91+
parentChatId: state.chatId,
92+
togglePinSubChat: state.togglePinSubChat,
93+
}))
9294
)
9395
const [loadingSubChats] = useAtom(loadingSubChatsAtom)
9496
const subChatUnseenChanges = useAtomValue(agentsSubChatUnseenChangesAtom)

src/renderer/features/sub-chats/sub-chats-sidebar.tsx

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
useAgentSubChatStore,
2121
type SubChatMeta,
2222
} from "../../lib/stores/sub-chat-store"
23+
import { useShallow } from "zustand/react/shallow"
2324
import {
2425
ArchiveIcon,
2526
IconDoubleChevronLeft,
@@ -69,15 +70,16 @@ export function SubChatsSidebar({
6970
isLoading = false,
7071
agentName,
7172
}: SubChatsSidebarProps) {
72-
const activeSubChatId = useAgentSubChatStore((state) => state.activeSubChatId)
73-
const openSubChatIds = useAgentSubChatStore((state) => state.openSubChatIds)
74-
const pinnedSubChatIds = useAgentSubChatStore(
75-
(state) => state.pinnedSubChatIds,
76-
)
77-
const allSubChats = useAgentSubChatStore((state) => state.allSubChats)
78-
const parentChatId = useAgentSubChatStore((state) => state.chatId)
79-
const togglePinSubChat = useAgentSubChatStore(
80-
(state) => state.togglePinSubChat,
73+
// Use shallow comparison to prevent re-renders when arrays have same content
74+
const { activeSubChatId, openSubChatIds, pinnedSubChatIds, allSubChats, parentChatId, togglePinSubChat } = useAgentSubChatStore(
75+
useShallow((state) => ({
76+
activeSubChatId: state.activeSubChatId,
77+
openSubChatIds: state.openSubChatIds,
78+
pinnedSubChatIds: state.pinnedSubChatIds,
79+
allSubChats: state.allSubChats,
80+
parentChatId: state.chatId,
81+
togglePinSubChat: state.togglePinSubChat,
82+
}))
8183
)
8284
const [loadingSubChats] = useAtom(loadingSubChatsAtom)
8385

0 commit comments

Comments
 (0)