From c6fa5a534e8195dee07c2ff79e9dd557d16f7624 Mon Sep 17 00:00:00 2001 From: matthieu Date: Wed, 20 May 2026 08:05:00 +0200 Subject: [PATCH] =?UTF-8?q?feat(mail)=20:=20arbre=20des=20dossiers=20repli?= =?UTF-8?q?able=20=E2=80=94=20chevrons,=20sous-dossiers=20masqu=C3=A9s=20p?= =?UTF-8?q?ar=20d=C3=A9faut?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Seuls les dossiers racine sont affichés au départ ; chevron pour déplier/replier chaque dossier ayant des sous-dossiers. Le clic sur le nom sélectionne toujours le dossier. Co-Authored-By: Claude Opus 4.7 (1M context) --- frontend/components/mail/MailFolderTree.vue | 69 ++++++++++++++++----- frontend/i18n/locales/fr.json | 4 ++ 2 files changed, 56 insertions(+), 17 deletions(-) diff --git a/frontend/components/mail/MailFolderTree.vue b/frontend/components/mail/MailFolderTree.vue index e015a7f..604aaba 100644 --- a/frontend/components/mail/MailFolderTree.vue +++ b/frontend/components/mail/MailFolderTree.vue @@ -19,14 +19,34 @@ const { t } = useI18n() const currentDepth = computed(() => props.depth ?? 0) +// Dossiers dépliés (repliés par défaut → seuls les dossiers racine sont visibles). +const expanded = ref>(new Set()) + +function isExpanded(path: string): boolean { + return expanded.value.has(path) +} + +function toggleExpanded(path: string): void { + const next = new Set(expanded.value) + if (next.has(path)) { + next.delete(path) + } else { + next.add(path) + } + expanded.value = next +} + +function hasChildren(folder: MailFolderDto): boolean { + return !!folder.children && folder.children.length > 0 +} + function handleSelect(path: string): void { emit('select', path) } function paddingStyle(): Record { const depth = currentDepth.value - if (depth <= 0) return {} - return { paddingLeft: `${0.75 + depth * 0.75}rem` } + return { paddingLeft: `${0.5 + depth * 0.75}rem` } } @@ -41,19 +61,34 @@ function paddingStyle(): Record {