Fix: Dev server detection bug fixes. Settings sync bug fixes. Cli provider fixes. Terminal background/foreground colors (#791)

* Changes from fix/dev-server-state-bug

* feat: Add configurable max turns setting with user overrides. Address pr comments

* fix: Update default behaviors and improve state management across server and UI

* feat: Extract branch sync logic to separate service. Fix settings sync bug. Address pr comments

* refactor: Extract magic numbers to named constants and improve branch tracking logic

- Add DEFAULT_MAX_TURNS (1000) and MAX_ALLOWED_TURNS (2000) constants to settings-helpers
- Replace hardcoded 1000 values with DEFAULT_MAX_TURNS constant throughout codebase
- Improve max turns validation with explicit Number.isFinite check
- Update getTrackingBranch to split on first slash instead of last for better remote parsing
- Change isBranchCheckedOut return type from boolean to string|null to return worktree path
- Add comments explaining skipFetch parameter in worktree creation
- Fix cleanup order in AgentExecutor finally block to run before logging
```

* feat: Add comment refresh and improve model sync in PR dialog
This commit is contained in:
gsxdsm
2026-02-21 08:57:04 -08:00
committed by GitHub
parent c81ea768a7
commit 3ddf26f666
41 changed files with 2705 additions and 274 deletions

View File

@@ -182,25 +182,39 @@ function selectAutoOpenProject(
function RootLayoutContent() {
const location = useLocation();
const {
setIpcConnected,
projects,
currentProject,
projectHistory,
upsertAndSetCurrentProject,
getEffectiveTheme,
getEffectiveFontSans,
getEffectiveFontMono,
// Subscribe to theme and font state to trigger re-renders when they change
theme,
fontFamilySans,
fontFamilyMono,
sidebarStyle,
skipSandboxWarning,
setSkipSandboxWarning,
fetchCodexModels,
} = useAppStore();
const { setupComplete, codexCliStatus } = useSetupStore();
// IMPORTANT: Use individual selectors instead of bare useAppStore() to prevent
// re-rendering on every store mutation. The bare call subscribes to the ENTIRE store,
// which during initialization causes cascading re-renders as multiple effects write
// to the store (settings hydration, project settings, auto-open, etc.). With enough
// rapid mutations, React hits the maximum update depth limit (error #185).
//
// Each selector only triggers a re-render when its specific slice of state changes.
const projects = useAppStore((s) => s.projects);
const currentProject = useAppStore((s) => s.currentProject);
const projectHistory = useAppStore((s) => s.projectHistory);
const sidebarStyle = useAppStore((s) => s.sidebarStyle);
const skipSandboxWarning = useAppStore((s) => s.skipSandboxWarning);
// Subscribe to theme and font state to trigger re-renders when they change
const theme = useAppStore((s) => s.theme);
const fontFamilySans = useAppStore((s) => s.fontFamilySans);
const fontFamilyMono = useAppStore((s) => s.fontFamilyMono);
// Subscribe to previewTheme so that getEffectiveTheme() re-renders when
// hover previews change the document theme. Without this, the selector
// for getEffectiveTheme (a stable function ref) won't trigger re-renders.
const previewTheme = useAppStore((s) => s.previewTheme);
void previewTheme; // Used only for subscription
// Actions (stable references from Zustand - never change between renders)
const setIpcConnected = useAppStore((s) => s.setIpcConnected);
const upsertAndSetCurrentProject = useAppStore((s) => s.upsertAndSetCurrentProject);
const getEffectiveTheme = useAppStore((s) => s.getEffectiveTheme);
const getEffectiveFontSans = useAppStore((s) => s.getEffectiveFontSans);
const getEffectiveFontMono = useAppStore((s) => s.getEffectiveFontMono);
const setSkipSandboxWarning = useAppStore((s) => s.setSkipSandboxWarning);
const fetchCodexModels = useAppStore((s) => s.fetchCodexModels);
const setupComplete = useSetupStore((s) => s.setupComplete);
const codexCliStatus = useSetupStore((s) => s.codexCliStatus);
const navigate = useNavigate();
const [isMounted, setIsMounted] = useState(false);
const [streamerPanelOpen, setStreamerPanelOpen] = useState(false);