diff --git a/docs/guides/git.md b/docs/guides/git.md index 3538456..606252e 100644 --- a/docs/guides/git.md +++ b/docs/guides/git.md @@ -13,7 +13,7 @@ Git is part of RuneStone and is on by default. It needs the `git` program on the 3. Select a file to open its diff in an editor tab. **Open file** in that tab opens the file in the editor. 4. Select the plus button beside a file to stage it, or the minus button to unstage it. The button beside a group stages or unstages all files in that group. -Source control shows the current branch and two groups. **Staged changes** go into the next commit. **Changes** holds the files that still need review or staging. +Source control shows the current branch and the **Changes** section with two groups. **Staged changes** go into the next commit. **Unstaged changes** holds the files that still need review or staging. A file shows in both groups when only part of its content is staged. Unstage keeps the content of the working file. Source control reads the repository again after each change in the workspace, also in the `.git` folder, and when the window gets focus. **Refresh source control** reads it at once. diff --git a/src/lib/features/git/SourceControl.svelte b/src/lib/features/git/SourceControl.svelte index 78d31b8..7308beb 100644 --- a/src/lib/features/git/SourceControl.svelte +++ b/src/lib/features/git/SourceControl.svelte @@ -149,7 +149,7 @@ {#if group.changes.length}
-

{group.staged ? $t("Staged changes ({count})", { count: group.changes.length }) : $t("Changes ({count})", { count: group.changes.length })}

+

{group.staged ? $t("Staged changes ({count})", { count: group.changes.length }) : $t("Unstaged changes ({count})", { count: group.changes.length })}

stage(group.changes, group.staged)} />
{#each group.changes as change (change.path)} diff --git a/src/lib/i18n/messages.ts b/src/lib/i18n/messages.ts index 465f885..ab38a9b 100644 --- a/src/lib/i18n/messages.ts +++ b/src/lib/i18n/messages.ts @@ -3448,6 +3448,7 @@ export const messageRows: [string, string, string, string][] = [ ["Commit created.", "Commit créé.", "コミットを作成しました。", "已创建提交。"], ["Changes ({count})", "Modifications ({count})", "変更 ({count})", "更改 ({count})"], ["Staged changes ({count})", "Modifications indexées ({count})", "ステージ済みの変更 ({count})", "已暂存的更改 ({count})"], + ["Unstaged changes ({count})", "Modifications non indexées ({count})", "未ステージの変更 ({count})", "未暂存的更改 ({count})"], ["Stage all", "Tout indexer", "すべてステージ", "全部暂存"], ["Unstage all", "Tout désindexer", "すべてステージ解除", "全部取消暂存"], ["Stage {path}", "Indexer {path}", "{path} をステージ", "暂存 {path}"], diff --git a/tests/smoke/features/git.smoke.mjs b/tests/smoke/features/git.smoke.mjs index cc84400..2549e6f 100644 --- a/tests/smoke/features/git.smoke.mjs +++ b/tests/smoke/features/git.smoke.mjs @@ -50,7 +50,9 @@ await runSmoke("features/git", async ({ page }) => { await pane.getByText("main", { exact: true }).waitFor(); assert.equal(await loaded(), true, "The Source control pane loads the Git module"); await pane.getByRole("heading", { name: "Staged changes (1)", exact: true }).waitFor(); - await pane.getByRole("heading", { name: "Changes (2)", exact: true }).waitFor(); + await pane.getByRole("heading", { name: "Unstaged changes (2)", exact: true }).waitFor(); + assert.equal(await pane.locator("summary").textContent(), "Changes (3)", "The section title counts all changes"); + assert.equal(await pane.getByRole("heading", { name: "Changes (2)", exact: true }).count(), 0, "No group title repeats the section title"); await pane.getByRole("button", { name: "Stage new.md", exact: true }).click(); await page.waitForFunction(() => window.__TEST__.git.calls.some(([command]) => command === "stage"));