mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-03-18 22:33:08 +00:00
Fix concurrency limits and remote branch fetching issues (#788)
* Changes from fix/bug-fixes * feat: Refactor worktree iteration and improve error logging across services * feat: Extract URL/port patterns to module level and fix abort condition * fix: Improve IPv6 loopback handling, select component layout, and terminal UI * feat: Add thinking level defaults and adjust list row padding * Update apps/ui/src/store/app-store.ts Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * feat: Add worktree-aware terminal creation and split options, fix npm security issues from audit * feat: Add tracked remote detection to pull dialog flow * feat: Add merge state tracking to git operations * feat: Improve merge detection and add post-merge action preferences * Update apps/ui/src/components/views/board-view/dialogs/git-pull-dialog.tsx Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update apps/ui/src/components/views/board-view/dialogs/git-pull-dialog.tsx Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix: Pass merge detection info to stash reapplication and handle merge state consistently * fix: Call onPulled callback in merge handlers and add validation checks --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
@@ -35,6 +35,8 @@ interface UICacheState {
|
||||
cachedWorktreePanelCollapsed: boolean;
|
||||
/** Collapsed nav sections */
|
||||
cachedCollapsedNavSections: Record<string, boolean>;
|
||||
/** Selected worktree per project (path + branch) for instant restore on PWA reload */
|
||||
cachedCurrentWorktreeByProject: Record<string, { path: string | null; branch: string }>;
|
||||
}
|
||||
|
||||
interface UICacheActions {
|
||||
@@ -52,19 +54,29 @@ export const useUICacheStore = create<UICacheState & UICacheActions>()(
|
||||
cachedSidebarStyle: 'unified',
|
||||
cachedWorktreePanelCollapsed: false,
|
||||
cachedCollapsedNavSections: {},
|
||||
cachedCurrentWorktreeByProject: {},
|
||||
|
||||
updateFromAppStore: (state) => set(state),
|
||||
}),
|
||||
{
|
||||
name: STORE_NAME,
|
||||
version: 1,
|
||||
version: 2,
|
||||
partialize: (state) => ({
|
||||
cachedProjectId: state.cachedProjectId,
|
||||
cachedSidebarOpen: state.cachedSidebarOpen,
|
||||
cachedSidebarStyle: state.cachedSidebarStyle,
|
||||
cachedWorktreePanelCollapsed: state.cachedWorktreePanelCollapsed,
|
||||
cachedCollapsedNavSections: state.cachedCollapsedNavSections,
|
||||
cachedCurrentWorktreeByProject: state.cachedCurrentWorktreeByProject,
|
||||
}),
|
||||
migrate: (persistedState: unknown, version: number) => {
|
||||
const state = persistedState as Record<string, unknown>;
|
||||
if (version < 2) {
|
||||
// Migration from v1: add cachedCurrentWorktreeByProject
|
||||
state.cachedCurrentWorktreeByProject = {};
|
||||
}
|
||||
return state as unknown as UICacheState & UICacheActions;
|
||||
},
|
||||
}
|
||||
)
|
||||
);
|
||||
@@ -82,6 +94,7 @@ export function syncUICache(appState: {
|
||||
sidebarStyle?: 'unified' | 'discord';
|
||||
worktreePanelCollapsed?: boolean;
|
||||
collapsedNavSections?: Record<string, boolean>;
|
||||
currentWorktreeByProject?: Record<string, { path: string | null; branch: string }>;
|
||||
}): void {
|
||||
const update: Partial<UICacheState> = {};
|
||||
|
||||
@@ -100,6 +113,9 @@ export function syncUICache(appState: {
|
||||
if ('collapsedNavSections' in appState) {
|
||||
update.cachedCollapsedNavSections = appState.collapsedNavSections;
|
||||
}
|
||||
if ('currentWorktreeByProject' in appState) {
|
||||
update.cachedCurrentWorktreeByProject = appState.currentWorktreeByProject;
|
||||
}
|
||||
|
||||
if (Object.keys(update).length > 0) {
|
||||
useUICacheStore.getState().updateFromAppStore(update);
|
||||
@@ -142,6 +158,15 @@ export function restoreFromUICache(
|
||||
collapsedNavSections: cache.cachedCollapsedNavSections,
|
||||
};
|
||||
|
||||
// Restore last selected worktree per project so the board doesn't
|
||||
// reset to main branch after PWA memory eviction or tab discard.
|
||||
if (
|
||||
cache.cachedCurrentWorktreeByProject &&
|
||||
Object.keys(cache.cachedCurrentWorktreeByProject).length > 0
|
||||
) {
|
||||
stateUpdate.currentWorktreeByProject = cache.cachedCurrentWorktreeByProject;
|
||||
}
|
||||
|
||||
// Restore the project context when the project object is available.
|
||||
// When projects are not yet loaded (empty array), currentProject remains
|
||||
// null and will be properly set later by hydrateStoreFromSettings().
|
||||
|
||||
Reference in New Issue
Block a user