feat(domain,application,infrastructure,backend,web-server,app-tauri,frontend): lot utilisateur #325 #326 — icônes projet avec watermark CLI custom et localisation FR/EN (QA verte)

Lot en un seul commit: les deux features partagent les mêmes contrats
(domain/settings.rs, DTO, commandes Tauri/HTTP, web-server) et les mêmes
surfaces UI — la séparation par fichiers était impossible sans chirurgie
de hunks risquant des états intermédiaires non compilables (convention
lot des batches #310-#313 et #315).

#325 — icône configurable par projet, watermark CLI custom:
- domaine: ProjectIconSet (devicon, simple-icons, lucide, idea),
  ProjectIconRef validé (nom ASCII 1..=64, -_. internes), champ icon
  optionnel sur ProjectSettings; sérialisation camelCase et try_from
  strict
- application: UpdateProjectSettings.execute accepte un patch
  theme_color OU icon (absent = inchangé, null = défaut produit), tests
  in-dependants avec store mémoire
- backend/app-tauri/web-server: ProjectIconRefDto, UpdateProjectSettingsRequestDto
  avec icon optionnel (désérialisation additive), commandes
  update_project_settings alignées Tauri/HTTP, tests DTO et HTTP
  (défaut null, set, clear, nom invalide rejeté)
- frontend: catalogue projectIcons (recherche EN), ProjectIconPicker en
  grille multi-lignes dans Paramètres projet, affichage de l'icône dans
  ProjectTabs et watermark grand format à faible opacité en fond de CLI
  custom; ports ProjectSettings.icon, Partial<ProjectSettings>,
  adapters tauri/mock/http et tests alignés

#326 — localisation FR/EN et traduction des textes IdeA:
- domaine: IdeaLanguage (fr | en), champ language optionnel sur
  IdeaUserSettings (absence = défaut produit, série additive validée)
- backend/web-server: UserSettingsDto.language, update_user_settings
  accepte language, tests HTTP alignés; fixtures structured_launch_d3
  mises à jour
- frontend: i18n/ (catalogue FR/EN, I18nProvider, scan anti-régression
  des sources visibles), GeneralSettings avec sélecteur de langue dans
  les paramètres, setupI18n dans vitest; migration de l'ensemble des
  textes hardcodés vers le catalogue sur toutes les surfaces (agents,
  layout, projets, tickets, sprints, web, plugins, permissions, git,
  templates, skills, mémoire, model servers, embedder, first-run,
  devices, scheduled tasks, workstate, dialogs), FR conservé par défaut;
  recherche d'icônes #325 en anglais conformément au ticket

QA verte sur feature/batch-325-326-project-icons-localisation. Aucun push.
This commit is contained in:
2026-09-11 21:53:56 +02:00
parent cd744b5f18
commit 1a1429f10e
157 changed files with 4531 additions and 3129 deletions

View File

@ -4,7 +4,7 @@
*
* Covers:
* - status shows staged/unstaged groupings
* - stage moves a file from Unstaged to Staged
* - indexer moves a file from Unstaged to Staged
* - commit with empty message is blocked (button disabled)
* - commit with message but nothing staged is blocked (button disabled)
* - commit moves staged files out and adds an entry to the log
@ -41,7 +41,7 @@ function renderPanel(git: MockGitGateway = new MockGitGateway()) {
/** Waits until the "Changes" section is rendered (panel stabilised). */
async function waitForPanel() {
await waitFor(() => {
expect(screen.getByRole("region", { name: "Changes" })).toBeTruthy();
expect(screen.getByRole("region", { name: "Modifications" })).toBeTruthy();
});
}
@ -59,15 +59,15 @@ describe("GitPanel (with MockGitGateway)", () => {
renderPanel(git);
await waitForPanel();
await screen.findByText("Staged");
await screen.findByText("Unstaged");
// src/main.rs is staged → Unstage button exists
await screen.findByText("Indexées");
await screen.findByText("Non indexées");
// src/main.rs is staged → Unindexer button exists
expect(
screen.getByRole("button", { name: "unstage src/main.rs" }),
screen.getByRole("button", { name: "désindexer src/main.rs" }),
).toBeTruthy();
// README.md is unstaged → Stage button exists
expect(
screen.getByRole("button", { name: "stage README.md" }),
screen.getByRole("button", { name: "indexer README.md" }),
).toBeTruthy();
});
@ -77,19 +77,19 @@ describe("GitPanel (with MockGitGateway)", () => {
// Stage README.md
const stageBtn = await screen.findByRole("button", {
name: "stage README.md",
name: "indexer README.md",
});
fireEvent.click(stageBtn);
// After staging, an Unstage button should appear for README.md
// After staging, an Unindexer button should appear for README.md
await waitFor(() => {
expect(
screen.getByRole("button", { name: "unstage README.md" }),
screen.getByRole("button", { name: "désindexer README.md" }),
).toBeTruthy();
});
});
it("clicking Unstage moves a file back to Unstaged", async () => {
it("clicking Unindexer moves a file back to Unstaged", async () => {
const git = new MockGitGateway();
await git.init(PROJECT_ID);
await git.stage(PROJECT_ID, "src/main.rs");
@ -98,13 +98,13 @@ describe("GitPanel (with MockGitGateway)", () => {
await waitForPanel();
const unstageBtn = await screen.findByRole("button", {
name: "unstage src/main.rs",
name: "désindexer src/main.rs",
});
fireEvent.click(unstageBtn);
await waitFor(() => {
expect(
screen.getByRole("button", { name: "stage src/main.rs" }),
screen.getByRole("button", { name: "indexer src/main.rs" }),
).toBeTruthy();
});
});
@ -121,7 +121,7 @@ describe("GitPanel (with MockGitGateway)", () => {
renderPanel();
await waitForPanel();
fireEvent.change(screen.getByLabelText("commit message"), {
fireEvent.change(screen.getByLabelText("message de commit"), {
target: { value: "my message" },
});
@ -138,7 +138,7 @@ describe("GitPanel (with MockGitGateway)", () => {
renderPanel(git);
await waitForPanel();
fireEvent.change(screen.getByLabelText("commit message"), {
fireEvent.change(screen.getByLabelText("message de commit"), {
target: { value: "initial commit" },
});
@ -148,7 +148,7 @@ describe("GitPanel (with MockGitGateway)", () => {
// After commit, no files should remain (both were staged).
await waitFor(() => {
expect(screen.getByText("No changes.")).toBeTruthy();
expect(screen.getByText("Aucune modification.")).toBeTruthy();
});
// The commit should appear in the log.
@ -168,9 +168,9 @@ describe("GitPanel (with MockGitGateway)", () => {
expect(branchesSection).toBeTruthy();
// Create & checkout a new branch via the form.
const branchInput = screen.getByLabelText("new branch name");
const branchInput = screen.getByLabelText("nom de la nouvelle branche");
fireEvent.change(branchInput, { target: { value: "feature/new-thing" } });
fireEvent.click(screen.getByRole("button", { name: /create.*checkout/i }));
fireEvent.click(screen.getByRole("button", { name: /créer.*basculer/i }));
// After checkout, the new branch should appear (may show in current + list).
await waitFor(() => {
@ -181,7 +181,7 @@ describe("GitPanel (with MockGitGateway)", () => {
// A checkout button for "main" should now appear (since it's no longer current).
await waitFor(() => {
expect(
screen.getByRole("button", { name: "checkout main" }),
screen.getByRole("button", { name: "basculer sur main" }),
).toBeTruthy();
});
});
@ -190,7 +190,7 @@ describe("GitPanel (with MockGitGateway)", () => {
renderPanel();
await waitForPanel();
expect(screen.getByText("No commits yet.")).toBeTruthy();
expect(screen.getByText("Aucun commit.")).toBeTruthy();
});
});
@ -213,7 +213,7 @@ describe("MockGitGateway (unit)", () => {
expect(Array.isArray(files)).toBe(true);
});
it("stage toggles a file to staged=true", async () => {
it("indexer toggles a file to staged=true", async () => {
const gw = new MockGitGateway();
const before = await gw.status("p");
const target = before[0].path;
@ -223,7 +223,7 @@ describe("MockGitGateway (unit)", () => {
expect(file.staged).toBe(true);
});
it("unstage toggles a file back to staged=false", async () => {
it("désindexer toggles a file back to staged=false", async () => {
const gw = new MockGitGateway();
const files = await gw.status("p");
const target = files[0].path;