From 2e9632de495a1580dda088081687340d6609e750 Mon Sep 17 00:00:00 2001 From: "IETM_FIXE\\ietm6" Date: Sat, 17 Oct 2026 15:34:41 +0200 Subject: [PATCH] Mobile et tablette : arborescence en navigation par niveaux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Avant : sur téléphone, toucher un arc ouvrait sa page et refermait le volet ; pour voir chapitres et scènes il fallait viser une flèche de 12 px. - En mode tiroir (< 1024 px), un niveau à la fois : toucher un nœud qui a des enfants entre dedans sans quitter le volet, bouton « retour » vers le niveau parent ; seule une feuille (scène, page…) navigue et ferme le volet. - En-tête de niveau : titre, « Ouvrir la fiche » et actions de création du nœud (« Nouveau chapitre », « Nouvelle scène », « Nouvelle page »…). - Lignes de 48 px minimum, titres sur deux lignes au plus, compteur d'éléments, pastilles de readiness conservées ; glisser-déposer réservé à l'ordinateur ; volet de 400 px sur tablette. - Le volet rouvert montre le niveau de la page courante (élément surligné) ; l'accueil de la section n'est pas pris pour la page courante. - Campagnes et Lore (panneau Templates gardé à la racine). Ordinateur inchangé : arbre classique. Vérifié : web build + 342 vitest (logique de navigation testée), lint sans erreur, e2e 80/80 dont le parcours mobile hub → scène réécrit pour les niveaux, essais au doigt à 375 et 768 px (campagne et Lore). À redéployer : web. --- web/e2e/tests/responsive/mobile-shell.spec.ts | 25 ++- .../secondary-sidebar.component.html | 149 ++++++++++++------ .../secondary-sidebar.component.scss | 144 ++++++++++++++++- .../secondary-sidebar.component.ts | 97 +++++++++++- .../secondary-sidebar/tree-drilldown.spec.ts | 51 ++++++ .../secondary-sidebar/tree-drilldown.ts | 68 ++++++++ web/src/assets/i18n/en.json | 4 + web/src/assets/i18n/fr.json | 4 + .../assets/i18n/fragments/tree-drill.en.json | 6 + .../assets/i18n/fragments/tree-drill.fr.json | 6 + 10 files changed, 498 insertions(+), 56 deletions(-) create mode 100644 web/src/app/shared/secondary-sidebar/tree-drilldown.spec.ts create mode 100644 web/src/app/shared/secondary-sidebar/tree-drilldown.ts create mode 100644 web/src/assets/i18n/fragments/tree-drill.en.json create mode 100644 web/src/assets/i18n/fragments/tree-drill.fr.json diff --git a/web/e2e/tests/responsive/mobile-shell.spec.ts b/web/e2e/tests/responsive/mobile-shell.spec.ts index d0753fd..4711ae9 100644 --- a/web/e2e/tests/responsive/mobile-shell.spec.ts +++ b/web/e2e/tests/responsive/mobile-shell.spec.ts @@ -133,19 +133,30 @@ test.describe('Shell mobile (375 px)', () => { await page.getByRole('button', { name: "Ouvrir l'arborescence" }).tap(); await expect(tree).toBeVisible(); - // Déplie « Scènes » puis l'arc / le chapitre jusqu'à la scène, au doigt. - for (const label of [/Scènes/, new RegExp(arc.name), new RegExp(chapter.name)]) { - const row = tree.locator('.tree-row', { has: page.locator('.tree-btn', { hasText: label }) }).first(); - if (await tree.getByRole('button', { name: scene.name }).isVisible()) break; - const chevron = row.locator('.chevron-btn'); - if (await chevron.count()) await chevron.tap(); + // Navigation par niveaux : toucher une ligne qui a des enfants « entre » dedans + // (sans quitter le volet), jusqu'à la scène. Mode plat ou arc/chapitre selon le seed. + const sceneRow = tree.locator('.drill-row', { hasText: scene.name }); + for (const label of ['Scènes', arc.name, chapter.name]) { + if (await sceneRow.isVisible()) break; + const row = tree.locator('.drill-row', { hasText: label }).first(); + if (await row.count()) { + await row.tap(); + await expect(tree.locator('.drill-back')).toBeVisible(); + await expect(tree).toBeVisible(); + } } - await tree.getByRole('button', { name: scene.name }).tap(); + await sceneRow.tap(); await expect(page).toHaveURL(new RegExp(`/scenes/${scene.id}$`)); await expect(page.getByRole('heading', { level: 1, name: scene.name })).toBeVisible(); await expect(tree).toBeHidden(); await expectNoHorizontalScroll(page); + + // En rouvrant le volet, on retrouve le niveau de la scène, surlignée ; « retour » remonte. + await page.getByRole('button', { name: "Ouvrir l'arborescence" }).tap(); + await expect(tree.locator('.drill-row.active', { hasText: scene.name })).toBeVisible(); + await tree.locator('.drill-back').tap(); + await expect(tree.locator('.drill-row.active', { hasText: scene.name })).toHaveCount(0); }); test('écran de séance : journal et horloges lisibles sans scroll horizontal', async ({ page, request }) => { diff --git a/web/src/app/shared/secondary-sidebar/secondary-sidebar.component.html b/web/src/app/shared/secondary-sidebar/secondary-sidebar.component.html index e23151d..c6d5646 100644 --- a/web/src/app/shared/secondary-sidebar/secondary-sidebar.component.html +++ b/web/src/app/shared/secondary-sidebar/secondary-sidebar.component.html @@ -13,61 +13,122 @@ } @if (!collapsed) { - @if (titleRoute) { - - } @else { - - } - @if (createActions.length) { -
- @for (action of createActions; track action) { - + + @if (drawerMode && drillLevel; as level) { +
+ +

{{ level.label }}

+ @if (level.route || level.createActions?.length) { +
+ @if (level.route) { + + } + @for (a of level.createActions; track a.id) { + + } +
}
+ } @else { + @if (titleRoute) { + + } @else { + + } + @if (createActions.length) { +
+ @for (action of createActions; track action) { + + } +
+ } } -
- - - @if (bottomPanel) { + } + + @if (bottomPanel && !(drawerMode && drillLevel)) {