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

@@ -21,6 +21,7 @@ import {
Maximize2,
Check,
Undo2,
RefreshCw,
} from 'lucide-react';
import {
Dialog,
@@ -574,16 +575,6 @@ export function PRCommentResolutionDialog({
// Track previous open state to detect when dialog opens
const wasOpenRef = useRef(false);
// Sync model defaults only when dialog opens (transitions from closed to open)
useEffect(() => {
const justOpened = open && !wasOpenRef.current;
wasOpenRef.current = open;
if (justOpened) {
setModelEntry(effectiveDefaultFeatureModel);
}
}, [open, effectiveDefaultFeatureModel]);
const handleModelChange = useCallback((entry: PhaseModelEntry) => {
// Normalize thinking level when switching between adaptive and non-adaptive models
const isNewModelAdaptive =
@@ -605,10 +596,23 @@ export function PRCommentResolutionDialog({
const {
data,
isLoading: loading,
isFetching: refreshing,
error,
refetch,
} = useGitHubPRReviewComments(currentProject?.path, open ? pr.number : undefined);
// Sync model defaults and refresh comments when dialog opens (transitions from closed to open)
useEffect(() => {
const justOpened = open && !wasOpenRef.current;
wasOpenRef.current = open;
if (justOpened) {
setModelEntry(effectiveDefaultFeatureModel);
// Force refresh PR comments from GitHub when dialog opens
refetch();
}
}, [open, effectiveDefaultFeatureModel, refetch]);
const allComments = useMemo(() => {
const raw = data?.comments ?? [];
// Sort based on current sort order
@@ -846,10 +850,22 @@ export function PRCommentResolutionDialog({
<Dialog open={open} onOpenChange={handleOpenChange}>
<DialogContent className="max-w-3xl max-h-[80vh] flex flex-col">
<DialogHeader>
<DialogTitle className="flex items-center gap-2">
<MessageSquare className="h-5 w-5 text-blue-500" />
Manage PR Review Comments
</DialogTitle>
<div className="flex items-center justify-between">
<DialogTitle className="flex items-center gap-2">
<MessageSquare className="h-5 w-5 text-blue-500" />
Manage PR Review Comments
</DialogTitle>
<Button
variant="ghost"
size="sm"
className="h-7 w-7 p-0 shrink-0"
onClick={() => refetch()}
disabled={refreshing}
title="Refresh comments"
>
<RefreshCw className={cn('h-4 w-4', refreshing && 'animate-spin')} />
</Button>
</div>
<DialogDescription>
Select comments from PR #{pr.number} to create feature tasks that address them.
</DialogDescription>