Séances accessibles en un clic + règles du système sous la main en séance

- Raccourci « Séance en cours » dans le menu principal : visible dès qu'une
  séance tourne (liste dépliable s'il y en a plusieurs, la plus récente en
  tête), rafraîchi à la navigation et au démarrage/fin d'une séance.
- Hub campagne : bloc « Jouer » sous l'en-tête — reprendre la séance en
  cours, sinon démarrer une séance sur la partie la plus récente (menu pour
  en choisir une autre), ou créer une partie s'il n'y en a aucune.
- Arbre de campagne : section « Jeu > Parties » avant la narration.
- Onglet « Règles » en séance : sommaire des sections, sections repliables,
  recherche instantanée hors ligne (insensible aux accents, à la casse et aux
  ligatures, ne garde et ne surligne que les lignes concernées), sections
  épinglables (mémorisées par système), « Demander à l'IA » qui bascule sur
  l'onglet IA avec la question préremplie ; liens utiles si la campagne n'a
  pas de système ou si le système n'a pas de règles.
- Core : GET /api/sessions?active=true (séances en cours sans tout
  l'historique) ; l'arbre /campaigns/{id}/tree inclut les parties.

Vérifié : core test-compile + tests, web build + vitest (recherche dans les
règles, bloc « Jouer »), lint sans nouvelle erreur, testé desktop et 375 px.
À redéployer : core (aucune migration) + web.
This commit is contained in:
2026-10-17 14:00:32 +02:00
parent ad3ea0e9e6
commit c2947cfef8
39 changed files with 2322 additions and 32 deletions
@@ -0,0 +1,113 @@
:host { display: block; }
.active-shortcut {
display: flex;
flex-direction: column;
gap: 0.25rem;
margin-top: 0.75rem;
}
.shortcut-main {
display: flex;
align-items: center;
gap: 0.45rem;
width: 100%;
min-height: 44px; // cible tactile
padding: 0.45rem 0.5rem 0.45rem 0.6rem;
background: rgba(16, 185, 129, 0.1);
border: 1px solid rgba(16, 185, 129, 0.45);
border-radius: 8px;
color: #d1fae5;
cursor: pointer;
text-align: left;
transition: background 0.15s, border-color 0.15s;
&:hover { background: rgba(16, 185, 129, 0.18); border-color: #10b981; }
&:focus-visible { outline: 2px solid #10b981; outline-offset: 2px; }
&--current { background: rgba(16, 185, 129, 0.22); }
}
.live-dot {
flex: 0 0 auto;
width: 8px;
height: 8px;
border-radius: 50%;
background: #10b981;
box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
animation: live-pulse 2s infinite;
}
@keyframes live-pulse {
0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
@media (prefers-reduced-motion: reduce) {
.live-dot { animation: none; }
}
.shortcut-texts {
display: flex;
flex-direction: column;
min-width: 0;
flex: 1;
}
.shortcut-label {
font-size: 0.8rem;
font-weight: 600;
line-height: 1.25;
overflow-wrap: anywhere; // sidebar étroite : passe à la ligne plutôt que de tronquer
}
.shortcut-sub {
font-size: 0.72rem;
color: #6ee7b7;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.shortcut-icon { flex: 0 0 auto; color: #6ee7b7; }
.shortcut-list {
list-style: none;
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
gap: 0.2rem;
}
.shortcut-item {
display: flex;
flex-direction: column;
gap: 0.1rem;
width: 100%;
min-height: 44px;
justify-content: center;
padding: 0.4rem 0.7rem;
background: #161628;
border: 1px solid #2a2a45;
border-radius: 6px;
color: #e5e7eb;
cursor: pointer;
text-align: left;
&:hover { border-color: #10b981; }
&:focus-visible { outline: 2px solid #10b981; outline-offset: 2px; }
&--current { border-color: #10b981; background: rgba(16, 185, 129, 0.12); }
}
.shortcut-item-name,
.shortcut-item-ctx {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 100%;
}
.shortcut-item-name { font-size: 0.8rem; font-weight: 500; }
.shortcut-item-ctx { font-size: 0.7rem; color: #9ca3af; }