mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-03-20 23:13:07 +00:00
Fix: Restore views properly, model selection for commit and pr and speed up some cli models with session resume (#801)
* Changes from fix/restoring-view * feat: Add resume query safety checks and optimize store selectors * feat: Improve session management and model normalization * refactor: Extract prompt building logic and handle file path parsing for renames
This commit is contained in:
@@ -275,6 +275,7 @@ const initialState: AppState = {
|
||||
collapsedNavSections: cachedUI.collapsedNavSections,
|
||||
mobileSidebarHidden: false,
|
||||
lastSelectedSessionByProject: {},
|
||||
agentModelBySession: {},
|
||||
theme: getStoredTheme() || 'dark',
|
||||
fontFamilySans: getStoredFontSans(),
|
||||
fontFamilyMono: getStoredFontMono(),
|
||||
@@ -962,11 +963,15 @@ export const useAppStore = create<AppState & AppActions>()((set, get) => ({
|
||||
),
|
||||
})),
|
||||
deleteChatSession: (sessionId) =>
|
||||
set((state) => ({
|
||||
chatSessions: state.chatSessions.filter((s) => s.id !== sessionId),
|
||||
currentChatSession:
|
||||
state.currentChatSession?.id === sessionId ? null : state.currentChatSession,
|
||||
})),
|
||||
set((state) => {
|
||||
const { [sessionId]: _removed, ...remainingAgentModels } = state.agentModelBySession;
|
||||
return {
|
||||
chatSessions: state.chatSessions.filter((s) => s.id !== sessionId),
|
||||
currentChatSession:
|
||||
state.currentChatSession?.id === sessionId ? null : state.currentChatSession,
|
||||
agentModelBySession: remainingAgentModels,
|
||||
};
|
||||
}),
|
||||
setChatHistoryOpen: (open) => set({ chatHistoryOpen: open }),
|
||||
toggleChatHistory: () => set((state) => ({ chatHistoryOpen: !state.chatHistoryOpen })),
|
||||
|
||||
@@ -1598,6 +1603,16 @@ export const useAppStore = create<AppState & AppActions>()((set, get) => ({
|
||||
})),
|
||||
getLastSelectedSession: (projectPath) => get().lastSelectedSessionByProject[projectPath] ?? null,
|
||||
|
||||
// Agent model selection actions
|
||||
setAgentModelForSession: (sessionId, model) =>
|
||||
set((state) => ({
|
||||
agentModelBySession: {
|
||||
...state.agentModelBySession,
|
||||
[sessionId]: model,
|
||||
},
|
||||
})),
|
||||
getAgentModelForSession: (sessionId) => get().agentModelBySession[sessionId] ?? null,
|
||||
|
||||
// Board Background actions
|
||||
setBoardBackground: (projectPath, imagePath) =>
|
||||
set((state) => ({
|
||||
|
||||
Reference in New Issue
Block a user