Thanks to visit codestin.com
Credit goes to github.com

Skip to content

🤖 refactor: clean git status system and optimize performance - #108

Merged
ammario merged 1 commit into
mainfrom
bugs
Oct 10, 2025
Merged

🤖 refactor: clean git status system and optimize performance#108
ammario merged 1 commit into
mainfrom
bugs

Conversation

@ammar-agent

@ammar-agent ammar-agent commented Oct 9, 2025

Copy link
Copy Markdown
Collaborator

Eliminates infinite loops, removes flicker, and reduces IPC overhead by 5x.

Changes

Architecture: Merged useGitStatus into useWorkspaceManagement for single source of truth. Git polling uses refs to break circular dependencies, preventing infinite loops.

Performance: Consolidated 5 IPC calls per workspace into 1 bash script. With 10 workspaces polling every second: 50 calls/sec → 10 calls/sec.

UX: Incremental state updates preserve git status during workspace changes, eliminating flicker. 4-column CSS grid prevents layout shifts when git status loads.

Commits

  • Unified workspace metadata and git status hooks
  • Preserved git status incrementally to eliminate flicker
  • Consolidated git status polling into single script per workspace
  • Fixed input focus after workspace creation
  • Code formatting

All tests pass. No breaking changes.

Generated with cmux

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Comment thread src/services/ipcMain.ts Outdated
Comment thread src/hooks/useWorkspaceManagement.ts Outdated
@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Comment thread src/services/ipcMain.ts Outdated
@ammar-agent
ammar-agent force-pushed the bugs branch 7 times, most recently from ff96164 to 8c6fcb2 Compare October 10, 2025 02:38
@ammar-agent ammar-agent changed the title 🤖 fix: make workspace removal instant and optimize sidebar updates 🤖 refactor: clean git status system and optimize performance Oct 10, 2025
@ammar-agent
ammar-agent force-pushed the bugs branch 4 times, most recently from 3d7a26d to ced3dfa Compare October 10, 2025 15:32
Implements comprehensive git status system with background fetching:

Git Status System:
- Context-based git status polling (3s intervals)
- Smart git fetch with no prompts (prevents keychain spam)
- Exponential backoff on fetch failures (3s → 60s max)
- Deduplication: one fetch per project per interval
- Optimized fetch flags (protocol v2, --filter=blob:none)
- All errors logged to console, never shown to user

Sidebar Improvements:
- Swap workspace status and actions positions ([×] [git] Name [●])
- Right-align workspace names
- Fix layout shift when git status is null (render empty placeholder)
- Remove duplicate tooltip on remove button

Code Organization:
- Move backend git code to src/services/gitService.ts
- Frontend-safe shared code in src/utils/git/gitStatus.ts
- Centralize git status script and parsing logic (DRY)
- Debug tool reuses production code paths

Performance:
- Non-blocking background fetches
- Batched git status checks (max 5 concurrent)
- No CPU spikes or UI blocking

All static checks pass (lint, fmt, typecheck).
@ammario
ammario enabled auto-merge October 10, 2025 16:44
@ammario
ammario added this pull request to the merge queue Oct 10, 2025
Merged via the queue into main with commit 217e86a Oct 10, 2025
7 checks passed
@ammario
ammario deleted the bugs branch October 10, 2025 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants