Skip to content

Remove source control group order preference - #12785

Merged
AmethystLiang merged 4 commits into
mainfrom
fix-right-side-diff-order
Aug 5, 2026
Merged

AmethystLiang merged 4 commits into
mainfrom
fix-right-side-diff-order

Conversation

@AmethystLiang

Copy link
Copy Markdown
Contributor

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

  • Remove the sourceControlGroupOrder user preference entirely
  • Use a fixed, always-consistent layout: Changes (unstaged + untracked merged) → Staged Changes → Untracked Files
  • Merge untracked files into the Changes section for simpler visual hierarchy
  • Delete settings persistence and normalization logic
  • Migrate legacy persisted preferences on load by stripping them
  • Clean up related UI and i18n strings

Implementation

  • Deleted src/shared/source-control-group-order.ts (normalization logic)
  • Replaced resolveSourceControlGroupOrder() with fixed SOURCE_CONTROL_GROUP_ORDER constant in source-control-section-order.ts
  • Added mergeUntrackedIntoChanges() to fold untracked entries into Changes section while preserving their Git area metadata
  • Updated persistence layer to strip retired settings fields and remove normalization
  • Updated source control UI, mobile git status, and discard operations to use merged display structure
  • Removed group order setting from GitPane and search metadata

Testing

  • Settings migration test verifies retired fields are stripped on load
  • Discard operations preserve metadata for untracked files even when merged into Changes section
  • Display section ordering remains: unstaged + untracked → staged → untracked

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).
@AmethystLiang
AmethystLiang merged commit ae1ed5e into main Aug 5, 2026
42 checks passed
@coderabbitai

coderabbitai Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 05bfc9c2-d326-4e6b-95c7-54b3479013e1

📥 Commits

Reviewing files that changed from the base of the PR and between 2c2a326 and ceb1de2.

📒 Files selected for processing (33)
  • .oxlintrc.json
  • config/scripts/relay-watcher-fault-harness.mjs
  • mobile/src/source-control/mobile-git-status.test.ts
  • mobile/src/source-control/mobile-git-status.ts
  • src/main/codex-accounts/runtime-home-service.test.ts
  • src/main/codex-accounts/service.test.ts
  • src/main/persistence.test.ts
  • src/main/persistence.ts
  • src/main/runtime/orca-runtime.ts
  • src/renderer/src/components/editor/CombinedDiffFileTree.tsx
  • src/renderer/src/components/github/GitHubMarkdownComposerEditorPane.tsx
  • src/renderer/src/components/right-sidebar/SourceControl.tsx
  • src/renderer/src/components/right-sidebar/discard-all-sequence.test.ts
  • src/renderer/src/components/right-sidebar/discard-all-sequence.ts
  • src/renderer/src/components/right-sidebar/source-control-discard-confirmation.test.ts
  • src/renderer/src/components/right-sidebar/source-control-discard-confirmation.ts
  • src/renderer/src/components/right-sidebar/source-control-discard-dialog.tsx
  • src/renderer/src/components/right-sidebar/source-control-section-order.test.ts
  • src/renderer/src/components/right-sidebar/source-control-section-order.ts
  • src/renderer/src/components/settings/GitPane.test.ts
  • src/renderer/src/components/settings/GitPane.tsx
  • src/renderer/src/components/settings/git-search.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/shared/constants.test.ts
  • src/shared/constants.ts
  • src/shared/source-control-group-order.test.ts
  • src/shared/source-control-group-order.ts
  • src/shared/types.ts
  • tests/e2e/setup-script-prompt-unreadable-orca-yaml.spec.ts

📝 Walkthrough

Walkthrough

Source-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)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the problem, solution, implementation, and testing, but omits the required Screenshots, AI Review Report, Security Audit, Notes, and test checklist. Add all missing template sections, state “No visual change” if applicable, complete the test checklist, and document cross-platform and security review results.
Docstring Coverage ⚠️ Warning Docstring coverage is 6.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states that the configurable source control group order preference is being removed, matching the primary change.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 value

Consider an explicit destructive flag instead of string-prefix matching for icon selection.

source-control-discard-dialog.tsx selects the confirm-button icon with pendingDiscardCopy?.confirmLabel.startsWith('Delete'). The new 'Delete and discard' label returned here for area === 'unstaged' && hasUntracked satisfies 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: boolean field to DiscardConfirmationCopy and 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

📥 Commits

Reviewing files that changed from the base of the PR and between 2c2a326 and 6ea5bef.

📒 Files selected for processing (28)
  • mobile/src/source-control/mobile-git-status.test.ts
  • mobile/src/source-control/mobile-git-status.ts
  • src/main/codex-accounts/runtime-home-service.test.ts
  • src/main/codex-accounts/service.test.ts
  • src/main/persistence.test.ts
  • src/main/persistence.ts
  • src/renderer/src/components/editor/CombinedDiffFileTree.tsx
  • src/renderer/src/components/right-sidebar/SourceControl.tsx
  • src/renderer/src/components/right-sidebar/discard-all-sequence.test.ts
  • src/renderer/src/components/right-sidebar/discard-all-sequence.ts
  • src/renderer/src/components/right-sidebar/source-control-discard-confirmation.test.ts
  • src/renderer/src/components/right-sidebar/source-control-discard-confirmation.ts
  • src/renderer/src/components/right-sidebar/source-control-discard-dialog.tsx
  • src/renderer/src/components/right-sidebar/source-control-section-order.test.ts
  • src/renderer/src/components/right-sidebar/source-control-section-order.ts
  • src/renderer/src/components/settings/GitPane.test.ts
  • src/renderer/src/components/settings/GitPane.tsx
  • src/renderer/src/components/settings/git-search.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/shared/constants.test.ts
  • src/shared/constants.ts
  • src/shared/source-control-group-order.test.ts
  • src/shared/source-control-group-order.ts
  • src/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', () => {})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 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.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

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.

@AmethystLiang
AmethystLiang deleted the fix-right-side-diff-order branch August 6, 2026 22:25
@AmethystLiang
AmethystLiang restored the fix-right-side-diff-order branch August 6, 2026 22:25
AmethystLiang added a commit that referenced this pull request Aug 6, 2026
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
* 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).
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
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.

1 participant