feature: merge conflict detection and resolution (#6)

- pulls now correctly identify merge conflicts and enter a merge state
- user resolves each file individually
- commit resolve merge state
- allows users to keep custom changes and pull in updates
- improve commit message component
- seperated commit / add functionality
This commit is contained in:
Sam Chau
2024-11-18 08:30:42 +10:30
committed by Sam Chau
parent 6afb274e41
commit ca84a1c95b
45 changed files with 4102 additions and 1444 deletions

View File

@@ -0,0 +1,41 @@
stateDiagram-v2
[*] --> CheckingForUpdates: User Initiates Pull
CheckingForUpdates --> NormalPull: No Conflicts Detected
CheckingForUpdates --> ConflictDetected: Conflicts Found
NormalPull --> [*]: Pull Complete
ConflictDetected --> ResolutionState: Enter Resolution Mode
note right of ResolutionState
System returns conflict object
containing all conflicted files
end note
state ResolutionState {
[*] --> FileSelection
FileSelection --> FileResolution: Select Unresolved File
FileResolution --> ConflictChoice
state ConflictChoice {
[*] --> DecisionMaking
DecisionMaking --> KeepLocal: User Keeps Local
DecisionMaking --> AcceptIncoming: User Accepts Incoming
DecisionMaking --> CustomMerge: User Combines/Modifies
KeepLocal --> MarkResolved
AcceptIncoming --> MarkResolved
CustomMerge --> MarkResolved
}
ConflictChoice --> AddFile: File Resolved
AddFile --> FileSelection: More Files\nto Resolve
AddFile --> AllFilesResolved: No More\nConflicts
}
ResolutionState --> CommitChanges: All Files Resolved
CommitChanges --> [*]: Resolution Complete

View File

@@ -0,0 +1,24 @@
Profilarr Sync Flow
```mermaid
flowchart TD
A[User Opens App] --> B[Check Git Status]
B --> C{Changes Detected?}
C -->|No Changes| D[Up to Date]
C -->|Changes Exist| E{Type of Change}
E -->|Incoming Only| F[Fast Forward Available]
E -->|Outgoing Only| G[Push Available*]
E -->|Both| H{Conflicts?}
H -->|Yes| I[Show Conflict UI]
H -->|No| J[Auto-merge]
I --> K[User Resolves]
K --> L[Apply Resolution]
L --> M[Update Git State]
J --> M
F --> M
G --> M
%% Add note about push restrictions
N[*Push only available for developers<br/>on specific branches]
N -.- G
```