Repository navigation
Remove source control group order preference - #12785
Conversation
Stages are closest to the commit action and most relevant to the commit workflow. Merges untracked files into Changes visually while preserving their Git area. Removes the untracked-first preset and includes migration logic for existing user settings.
Remove the sourceControlGroupOrder setting and related UI, migrations, and persistence logic. The source control view now always displays sections in the order: staged changes, unstaged changes, untracked files.
Aligns with the edit-stage-commit workflow by showing unstaged changes (active edits) before staged changes (queued for commit).
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (33)
📝 WalkthroughWalkthroughSource-control group ordering is no longer configurable or persisted. The application now uses a fixed order and merges untracked entries into the unstaged Changes section across desktop, mobile, and combined diff views. Discard operations include untracked entries, propagate untracked-file metadata, and show deletion-specific confirmation text and controls. Persistence removes retired settings fields, and tests and localization entries are updated accordingly. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/renderer/src/components/right-sidebar/source-control-discard-confirmation.ts (1)
63-83: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider an explicit destructive flag instead of string-prefix matching for icon selection.
source-control-discard-dialog.tsxselects the confirm-button icon withpendingDiscardCopy?.confirmLabel.startsWith('Delete'). The new'Delete and discard'label returned here forarea === 'unstaged' && hasUntrackedsatisfies that check only because it happens to start with the English word "Delete" after translation. In a non-English locale, the translated label may not start with the translated equivalent, causing the wrong icon to display.Add an explicit
destructive: booleanfield toDiscardConfirmationCopyand set it here, instead of relying on the confirm-button code inferring destructiveness from the translated string's prefix.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 13cf1054-5020-4bcf-8ce5-220c24f8d258
📒 Files selected for processing (28)
mobile/src/source-control/mobile-git-status.test.tsmobile/src/source-control/mobile-git-status.tssrc/main/codex-accounts/runtime-home-service.test.tssrc/main/codex-accounts/service.test.tssrc/main/persistence.test.tssrc/main/persistence.tssrc/renderer/src/components/editor/CombinedDiffFileTree.tsxsrc/renderer/src/components/right-sidebar/SourceControl.tsxsrc/renderer/src/components/right-sidebar/discard-all-sequence.test.tssrc/renderer/src/components/right-sidebar/discard-all-sequence.tssrc/renderer/src/components/right-sidebar/source-control-discard-confirmation.test.tssrc/renderer/src/components/right-sidebar/source-control-discard-confirmation.tssrc/renderer/src/components/right-sidebar/source-control-discard-dialog.tsxsrc/renderer/src/components/right-sidebar/source-control-section-order.test.tssrc/renderer/src/components/right-sidebar/source-control-section-order.tssrc/renderer/src/components/settings/GitPane.test.tssrc/renderer/src/components/settings/GitPane.tsxsrc/renderer/src/components/settings/git-search.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/shared/constants.test.tssrc/shared/constants.tssrc/shared/source-control-group-order.test.tssrc/shared/source-control-group-order.tssrc/shared/types.ts
💤 Files with no reviewable changes (11)
- src/shared/source-control-group-order.ts
- src/shared/source-control-group-order.test.ts
- src/main/codex-accounts/runtime-home-service.test.ts
- src/main/codex-accounts/service.test.ts
- src/shared/constants.ts
- src/renderer/src/components/settings/git-search.ts
- src/renderer/src/i18n/locales/zh.json
- src/shared/types.ts
- src/renderer/src/i18n/locales/es.json
- src/renderer/src/i18n/locales/ja.json
- src/renderer/src/i18n/locales/ko.json
| expect(getDefaultSettings('/tmp').mobilePairingCustomAddress).toBeNull() | ||
| expect(getDefaultSettings('/tmp').mobilePairingCustomAddresses).toEqual([]) | ||
| }) | ||
| it('uses a commit-oriented Source Control layout by default', () => {}) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Add an assertion to the renamed default-layout test.
The test body is empty: it('uses a commit-oriented Source Control layout by default', () => {}). This test always passes and does not verify any behavior. If the fixed workflow order has an observable default (for example, through getDefaultSettings or a related helper), assert on it here. If no observable default exists anymore, remove this test instead of keeping an empty placeholder.
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
* Reorder source control to show staged changes first by default Stages are closest to the commit action and most relevant to the commit workflow. Merges untracked files into Changes visually while preserving their Git area. Removes the untracked-first preset and includes migration logic for existing user settings. * Drop source control group order user preference Remove the sourceControlGroupOrder setting and related UI, migrations, and persistence logic. The source control view now always displays sections in the order: staged changes, unstaged changes, untracked files. * Reorder source control to show changes before staged Aligns with the edit-stage-commit workflow by showing unstaged changes (active edits) before staged changes (queued for commit).
stablyai#12955) This reverts commit b5c914e.
Problem
The source control group order was previously configurable via user settings, allowing users to customize whether Changes, Staged Changes, or Untracked Files appeared first. This setting added complexity with minimal benefit and was rarely used.
Solution
sourceControlGroupOrderuser preference entirelyImplementation
src/shared/source-control-group-order.ts(normalization logic)resolveSourceControlGroupOrder()with fixedSOURCE_CONTROL_GROUP_ORDERconstant insource-control-section-order.tsmergeUntrackedIntoChanges()to fold untracked entries into Changes section while preserving their Git area metadataTesting