дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-09 19:25:54 +02:00
feat(vcs): group commit changes by staging state (#1080)
Commit view › Group By gains "Staging State". When it is on, Changes splits into Staged Changes and Unstaged Changes; a partially staged file appears in both, and its diff compares HEAD with the Index under Staged and the Index with the working copy under Unstaged. The choice is remembered across sessions. Closes #1067 Co-authored-by: florentvdry <[email protected]>
Цей коміт міститься в:
1 джерело
2f75628c87
коміт
5e7339e4c2
7 files changed
+128
-10
No files matched your search
@@ -14,6 +14,8 @@ interface CommitState {
|
||||
/** Commit Options › Run Git hooks. */
|
||||
runHooks: boolean;
|
||||
groupByDir: boolean;
|
||||
/** Group the changes into Staged / Unstaged instead of one "Changes" group. */
|
||||
groupByStaging: boolean;
|
||||
/** Whether the Git window's Local Changes tab previews the selection's diff. */
|
||||
diffPreview: boolean;
|
||||
/** User overrides of the inclusion checkboxes (absolute path → state). */
|
||||
@@ -44,6 +46,7 @@ export const useCommit = create<CommitState>(() => ({
|
||||
author: "",
|
||||
runHooks: true,
|
||||
groupByDir: readBool("openidea.vcs.groupByDir", false),
|
||||
groupByStaging: readBool("openidea.vcs.groupByStaging", false),
|
||||
diffPreview: readBool("openidea.vcs.diffPreview", true),
|
||||
checks: new Map(),
|
||||
excludedHunks: new Map(),
|
||||
@@ -74,6 +77,15 @@ export function setGroupByDir(v: boolean) {
|
||||
}
|
||||
}
|
||||
|
||||
export function setGroupByStaging(v: boolean) {
|
||||
useCommit.setState({ groupByStaging: v });
|
||||
try {
|
||||
localStorage.setItem("openidea.vcs.groupByStaging", String(v));
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
export function setDiffPreview(v: boolean) {
|
||||
useCommit.setState({ diffPreview: v });
|
||||
try {
|
||||
|
||||
Reference in new issue
Заблокувати користувача