mirror of
https://github.com/stablyai/orca.git
synced 2026-10-31 09:07:40 +00:00
* fix(mobile): list Source Control changes with desktop's sections, sort and row rules Conflicts get their own section in the user's group order, submodule rows lose stage and discard like desktop, paths sort with the shared collator, and review notes go out as desktop formats them. * fix(mobile): read the group order the host now publishes and keep submodule rows read-only The host's paired settings projection now carries sourceControlGroupOrder, the normalized status projection keeps submodule metadata, and conflict rows reuse the shared conflict-kind labels. * refactor(mobile): share Source Control grouping and row rules with desktop Desktop and mobile group rows through one shared helper, mobile's unstage button follows desktop's rule, and the group order resets when the host changes.
18 lines
591 B
TypeScript
18 lines
591 B
TypeScript
import type { GitStatusEntry } from './git-status-types'
|
|
import { compareFileNames } from './file-name-sort'
|
|
|
|
export function compareGitStatusEntries(a: GitStatusEntry, b: GitStatusEntry): number {
|
|
// Use compareFileNames to break numeric ties (2/02) consistently with File Explorer.
|
|
return getConflictSortRank(a) - getConflictSortRank(b) || compareFileNames(a.path, b.path)
|
|
}
|
|
|
|
function getConflictSortRank(entry: GitStatusEntry): number {
|
|
if (entry.conflictStatus === 'unresolved') {
|
|
return 0
|
|
}
|
|
if (entry.conflictStatus === 'resolved_locally') {
|
|
return 1
|
|
}
|
|
return 2
|
|
}
|