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:
@ -30,6 +30,7 @@ import { useEffect, useRef, useState } from "react";
|
||||
import type { TicketRef } from "@/domain";
|
||||
import type { TicketListQuery } from "@/ports";
|
||||
import { Button, Spinner, cn, zIndex } from "@/shared";
|
||||
import { useI18n } from "@/i18n";
|
||||
import { TicketFacetsBar } from "./TicketFacetsBar";
|
||||
import { pickerFiltersKey } from "./ticketFilterPersistence";
|
||||
import { PriorityBadge, StatusBadge, TicketRef as TicketRefBadge } from "./ticketMeta";
|
||||
@ -79,8 +80,8 @@ const FOCUSABLE =
|
||||
export function TicketPicker({
|
||||
open,
|
||||
projectId,
|
||||
title = "Sélectionner un ticket",
|
||||
confirmLabel = "Sélectionner",
|
||||
title,
|
||||
confirmLabel,
|
||||
selectionMode = "single",
|
||||
excludeRefs,
|
||||
initialQuery,
|
||||
@ -88,12 +89,13 @@ export function TicketPicker({
|
||||
onSelect,
|
||||
onClose,
|
||||
}: TicketPickerProps) {
|
||||
const { tr } = useI18n();
|
||||
if (!open) return null;
|
||||
return (
|
||||
<TicketPickerBody
|
||||
projectId={projectId}
|
||||
title={title}
|
||||
confirmLabel={confirmLabel}
|
||||
title={title ?? tr("Sélectionner un ticket", "Select a ticket")}
|
||||
confirmLabel={confirmLabel ?? tr("Sélectionner", "Select")}
|
||||
selectionMode={selectionMode}
|
||||
excludeRefs={excludeRefs}
|
||||
initialQuery={initialQuery}
|
||||
@ -132,6 +134,7 @@ function TicketPickerBody({
|
||||
>
|
||||
> &
|
||||
Pick<TicketPickerProps, "excludeRefs" | "initialQuery">) {
|
||||
const { tr } = useI18n();
|
||||
const vm = useTicketSearch(projectId, {
|
||||
initialQuery,
|
||||
excludeRefs,
|
||||
@ -254,10 +257,10 @@ function TicketPickerBody({
|
||||
<Button
|
||||
size="sm"
|
||||
variant="ghost"
|
||||
aria-label="close ticket picker"
|
||||
aria-label={tr("Fermer le sélecteur de ticket", "Close ticket picker")}
|
||||
onClick={onClose}
|
||||
>
|
||||
Close
|
||||
{tr("Fermer", "Close")}
|
||||
</Button>
|
||||
</header>
|
||||
|
||||
@ -290,10 +293,10 @@ function TicketPickerBody({
|
||||
{vm.busy && vm.rows.length === 0 ? (
|
||||
<div className="flex items-center gap-2 text-sm text-muted">
|
||||
<Spinner size={14} />
|
||||
<span>Loading tickets…</span>
|
||||
<span>{tr("Chargement des tickets…", "Loading tickets…")}</span>
|
||||
</div>
|
||||
) : vm.rows.length === 0 ? (
|
||||
<p className="text-sm text-muted">No matching tickets.</p>
|
||||
<p className="text-sm text-muted">{tr("Aucun ticket correspondant.", "No matching tickets.")}</p>
|
||||
) : (
|
||||
<ul className="flex flex-col divide-y divide-border">
|
||||
{vm.rows.map((t) => {
|
||||
@ -302,7 +305,7 @@ function TicketPickerBody({
|
||||
<li key={t.ref} className="py-1.5 first:pt-0 last:pb-0">
|
||||
<button
|
||||
type="button"
|
||||
aria-label={`select ticket ${t.ref}`}
|
||||
aria-label={tr(`Sélectionner le ticket ${t.ref}`, `Select ticket ${t.ref}`)}
|
||||
{...(isMulti
|
||||
? { role: "checkbox", "aria-checked": checked }
|
||||
: {})}
|
||||
@ -353,7 +356,7 @@ function TicketPickerBody({
|
||||
loading={vm.busy}
|
||||
onClick={() => vm.loadMore()}
|
||||
>
|
||||
Load more
|
||||
{tr("Charger plus", "Load more")}
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
@ -364,20 +367,20 @@ function TicketPickerBody({
|
||||
{isMulti && (
|
||||
<footer className="flex shrink-0 items-center justify-between gap-2 border-t border-border px-4 py-3">
|
||||
<span className="text-xs text-muted" aria-live="polite">
|
||||
{selected.size} sélectionné{selected.size > 1 ? "s" : ""}
|
||||
{tr(`${selected.size} sélectionné${selected.size > 1 ? "s" : ""}`, `${selected.size} selected`)}
|
||||
</span>
|
||||
<div className="flex items-center gap-2">
|
||||
<Button
|
||||
size="sm"
|
||||
variant="ghost"
|
||||
aria-label="cancel ticket selection"
|
||||
aria-label={tr("Annuler la sélection de tickets", "Cancel ticket selection")}
|
||||
onClick={onClose}
|
||||
>
|
||||
Annuler
|
||||
{tr("Annuler", "Cancel")}
|
||||
</Button>
|
||||
<Button
|
||||
size="sm"
|
||||
aria-label="confirm ticket selection"
|
||||
aria-label={tr("Confirmer la sélection de tickets", "Confirm ticket selection")}
|
||||
loading={selecting}
|
||||
disabled={selected.size === 0 || selecting}
|
||||
onClick={() => void handleConfirm()}
|
||||
|
||||
Reference in New Issue
Block a user