Improve pull request flow, add branch selection for worktree creation, fix auto-mode concurrency count (#787)

* Changes from fix/fetch-before-pull-fetch

* feat: Improve pull request flow, add branch selection for worktree creation, fix for automode concurrency count

* feat: Add validation for remote names and improve error handling

* Address PR comments and mobile layout fixes

* ```
refactor: Extract PR target resolution logic into dedicated service
```

* feat: Add app shell UI and improve service imports. Address PR comments

* fix: Improve security validation and cache handling in git operations

* feat: Add GET /list endpoint and improve parameter handling

* chore: Improve validation, accessibility, and error handling across apps

* chore: Format vite server port configuration

* fix: Add error handling for gh pr list command and improve offline fallbacks

* fix: Preserve existing PR creation time and improve remote handling
This commit is contained in:
gsxdsm
2026-02-19 21:55:12 -08:00
committed by GitHub
parent ee52333636
commit 7df2182818
80 changed files with 4729 additions and 1107 deletions

View File

@@ -217,6 +217,52 @@ export { defaultBackgroundSettings, defaultTerminalState, MAX_INIT_OUTPUT_LINES
// Type definitions are imported from ./types/state-types.ts
// AppActions interface is defined in ./types/state-types.ts
/**
* Pre-populate sidebar/UI state from the UI cache at module load time.
* This runs synchronously before createRoot().render(), so the very first
* React render uses the correct sidebar width — eliminating the layout shift
* (wide sidebar → collapsed) that was visible when auth was pre-populated
* but sidebar state wasn't.
*/
function getInitialUIState(): {
sidebarOpen: boolean;
sidebarStyle: 'unified' | 'discord';
collapsedNavSections: Record<string, boolean>;
} {
try {
const raw = localStorage.getItem('automaker-ui-cache');
if (raw) {
const wrapper = JSON.parse(raw);
// zustand/persist wraps state under a "state" key
const cache = wrapper?.state;
if (cache) {
return {
sidebarOpen:
typeof cache.cachedSidebarOpen === 'boolean' ? cache.cachedSidebarOpen : true,
sidebarStyle: cache.cachedSidebarStyle === 'discord' ? 'discord' : 'unified',
collapsedNavSections: (() => {
const raw = cache.cachedCollapsedNavSections;
if (
raw &&
typeof raw === 'object' &&
!Array.isArray(raw) &&
Object.getOwnPropertyNames(raw).every((k) => typeof raw[k] === 'boolean')
) {
return raw as Record<string, boolean>;
}
return {};
})(),
};
}
}
} catch {
// fall through to defaults
}
return { sidebarOpen: true, sidebarStyle: 'unified', collapsedNavSections: {} };
}
const cachedUI = getInitialUIState();
const initialState: AppState = {
projects: [],
currentProject: null,
@@ -224,9 +270,9 @@ const initialState: AppState = {
projectHistory: [],
projectHistoryIndex: -1,
currentView: 'welcome',
sidebarOpen: true,
sidebarStyle: 'unified',
collapsedNavSections: {},
sidebarOpen: cachedUI.sidebarOpen,
sidebarStyle: cachedUI.sidebarStyle,
collapsedNavSections: cachedUI.collapsedNavSections,
mobileSidebarHidden: false,
lastSelectedSessionByProject: {},
theme: getStoredTheme() || 'dark',
@@ -942,6 +988,13 @@ export const useAppStore = create<AppState & AppActions>()((set, get) => ({
runningTasks: [],
branchName,
};
// Prevent duplicate entries - the same feature can trigger multiple
// auto_mode_feature_start events (e.g., from execution-service and
// pipeline-orchestrator), so we must guard against adding the same
// taskId more than once.
if (current.runningTasks.includes(taskId)) {
return state;
}
return {
autoModeByWorktree: {
...state.autoModeByWorktree,