Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8264e7ffae | ||
|
|
80852374a8 |
@@ -44,9 +44,13 @@ node tests/frontend/unit.test.mjs
|
||||
# Tests JSDOM : node_modules dans tests/frontend/ (npm install là-bas si absent), ex :
|
||||
node tests/frontend/pane-manager.test.mjs
|
||||
|
||||
# E2E (si UI touchée, ~5 min) : reproduit le job CI e2e (port 2029, auth désactivée)
|
||||
# E2E (si UI touchée, ~10 min) : reproduit le job CI e2e (port 2029, auth désactivée)
|
||||
npm run test:e2e # prérequis : uv, Node >= 20, npx playwright install chromium
|
||||
bash scripts/run-e2e-local.sh -g "nom du test" # filtre / --headed
|
||||
|
||||
# Windows sans bash exploitable (WSL HS, git-bash bloqué par App Control) :
|
||||
npm run test:e2e:ps # équivalent PowerShell, mêmes conditions que le CI
|
||||
pwsh -File scripts/run-e2e-local.ps1 -PlaywrightArgs @('-g','nom du test')
|
||||
```
|
||||
|
||||
- Un seul test backend : `.\.venv\Scripts\python.exe -m pytest tests/test_search.py -q`.
|
||||
|
||||
+40
-1
@@ -6,7 +6,7 @@ Format basé sur [Keep a Changelog](https://keepachangelog.com/fr/1.1.0/),
|
||||
et [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
> **En cours de développement** : les changements à venir sont listés dans la section
|
||||
> [Unreleased](#unreleased). La dernière version livrée est **2.19.0**.
|
||||
> [Unreleased](#unreleased). La dernière version livrée est **2.19.2**.
|
||||
|
||||
---
|
||||
|
||||
@@ -14,6 +14,45 @@ et [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
---
|
||||
|
||||
## [2.19.2] — 2026-09-23
|
||||
|
||||
### Ajouté
|
||||
|
||||
- **Lanceur E2E Windows/PowerShell** : `scripts/run-e2e-local.ps1` (+ script npm
|
||||
`test:e2e:ps`) reproduit localement le job CI `e2e` (uvicorn natif, auth
|
||||
désactivée, fixtures TestVault/TestDir, port 2029, projet `chromium-desktop`)
|
||||
sans dépendre de `bash` — indispensable sur les postes Windows où WSL ne
|
||||
démarre pas et où git-bash est bloqué par une politique de contrôle
|
||||
d'application. Le script `bash` reste la référence pour la CI/Linux.
|
||||
|
||||
### Corrigé
|
||||
|
||||
- **BUG-072 — visionneuse d'images** : le plein écran (lightbox) et le panneau
|
||||
« Métadonnées » sont désormais **conservés lors de la navigation** entre images
|
||||
(flèches ←/→ et clic sur la pellicule) ; auparavant chaque changement d'image
|
||||
recréait la visionneuse et perdait ces états. Le panneau de métadonnées s'affiche
|
||||
maintenant en **barre latérale à droite de l'image** (au lieu d'une bande sous la
|
||||
pellicule) et reste visible en plein écran.
|
||||
|
||||
---
|
||||
|
||||
## [2.19.1] — 2026-09-23
|
||||
|
||||
### Corrigé
|
||||
|
||||
- **#110 — lisibilité et positionnement du lecteur média** : en mode mobile, la
|
||||
barre audio passe en grille (barre de progression pleine largeur sur sa propre
|
||||
ligne) et les actions secondaires (précédent/suivant/agrandir/volume) sont
|
||||
masquées pour éviter tout chevauchement ; le volume est aussi masqué sur les
|
||||
écrans intermédiaires en desktop, et `overflow: hidden` empêche le débordement
|
||||
hors de la pilule. La mini-fenêtre vidéo n'est plus ré-aimantée sur les bords :
|
||||
elle se déplace et se redimensionne **librement** (position absolue mémorisée,
|
||||
centre autorisé), le glisser fonctionnant désormais depuis n'importe quel point
|
||||
de la fenêtre (boutons/curseurs/poignée exclus, seuil de 4 px pour préserver
|
||||
les contrôles natifs de la vidéo).
|
||||
|
||||
---
|
||||
|
||||
## [2.19.0] — 2026-09-23
|
||||
|
||||
### Ajouté
|
||||
|
||||
+13
-4
@@ -4,7 +4,7 @@
|
||||
|
||||
**Porte d'entrée web ultra-léger pour vos vaults Obsidian** — Accédez, naviguez et recherchez dans toutes vos notes Obsidian depuis n'importe quel appareil via une interface web moderne et responsive.
|
||||
|
||||
[]()
|
||||
[]()
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
[](https://www.docker.com/)
|
||||
[](https://www.python.org/)
|
||||
@@ -872,7 +872,7 @@ Configurables via l'interface (Settings) ou l'API `/api/config`.
|
||||
| Validation des imports frontend | `node tests/frontend/validate-imports.mjs` | `lint` |
|
||||
| Tests unitaires frontend | `node tests/frontend/unit.test.mjs` | `lint` |
|
||||
| Tests backend | `pytest tests/ -q` | `test` |
|
||||
| **E2E Playwright** | `npm run test:e2e` (~5 min) | `e2e` |
|
||||
| **E2E Playwright** | `npm run test:e2e` (~10 min) | `e2e` |
|
||||
|
||||
#### Tests E2E locaux (`npm run test:e2e`)
|
||||
|
||||
@@ -895,6 +895,15 @@ bash scripts/run-e2e-local.sh --headed # navigateur visible
|
||||
bash scripts/run-e2e-local.sh -g "reset panes" # filtre sur un test
|
||||
```
|
||||
|
||||
Sous Windows, si `bash` n'est pas exploitable (WSL indisponible, git-bash
|
||||
bloqué par une politique de contrôle d'application), utiliser le lanceur
|
||||
PowerShell équivalent :
|
||||
|
||||
```powershell
|
||||
npm run test:e2e:ps
|
||||
pwsh -File scripts/run-e2e-local.ps1 -PlaywrightArgs @('-g','reset panes')
|
||||
```
|
||||
|
||||
La suite doit se terminer sur **tous les tests passant** (60 actuellement),
|
||||
sans échec ni dépendance aux retries. En cas d'échec : corriger et relancer
|
||||
localement jusqu'à 100 %, puis seulement commiter.
|
||||
@@ -966,8 +975,8 @@ Ce projet est sous licence **MIT** — voir le fichier [LICENSE](LICENSE) pour l
|
||||
|
||||
## 📝 Changelog
|
||||
|
||||
Consultez le [CHANGELOG.md](./CHANGELOG.md) pour l'historique complet de toutes les versions (v1.0.0 → v2.19.0).
|
||||
Consultez le [CHANGELOG.md](./CHANGELOG.md) pour l'historique complet de toutes les versions (v1.0.0 → v2.19.2).
|
||||
|
||||
---
|
||||
|
||||
*Projet : ObsiGate | Version : 2.19.0 | Dernière mise à jour : Septembre 2026*
|
||||
*Projet : ObsiGate | Version : 2.19.2 | Dernière mise à jour : Septembre 2026*
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
**Ultra-light web gateway for your Obsidian vaults** — Access, browse, and search all your Obsidian notes from any device via a modern, responsive web interface.
|
||||
|
||||
[]()
|
||||
[]()
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
[](https://www.docker.com/)
|
||||
[](https://www.python.org/)
|
||||
@@ -1042,7 +1042,7 @@ These parameters are configurable via the interface (Settings) or the `/api/conf
|
||||
| Frontend import validation | `node tests/frontend/validate-imports.mjs` | `lint` |
|
||||
| Frontend unit tests | `node tests/frontend/unit.test.mjs` | `lint` |
|
||||
| Backend tests | `pytest tests/ -q` | `test` |
|
||||
| **E2E Playwright** | `npm run test:e2e` (~5 min) | `e2e` |
|
||||
| **E2E Playwright** | `npm run test:e2e` (~10 min) | `e2e` |
|
||||
|
||||
#### Local E2E Tests (`npm run test:e2e`)
|
||||
|
||||
@@ -1065,6 +1065,14 @@ bash scripts/run-e2e-local.sh --headed # visible browser
|
||||
bash scripts/run-e2e-local.sh -g "reset panes" # filter on a test
|
||||
```
|
||||
|
||||
On Windows, when `bash` is unusable (WSL unavailable, git-bash blocked by an
|
||||
Application Control policy), use the equivalent PowerShell launcher:
|
||||
|
||||
```powershell
|
||||
npm run test:e2e:ps
|
||||
pwsh -File scripts/run-e2e-local.ps1 -PlaywrightArgs @('-g','reset panes')
|
||||
```
|
||||
|
||||
The suite must end with **all tests passing** (60 currently), with no failure
|
||||
or reliance on retries. In case of failure: fix and re-run locally until 100 %,
|
||||
then only commit.
|
||||
@@ -1142,8 +1150,8 @@ This project is licensed under the **MIT License** - see the [LICENSE](LICENSE)
|
||||
|
||||
## 📝 Changelog
|
||||
|
||||
See [CHANGELOG.md](./CHANGELOG.md) for the complete version history (v1.0.0 → v2.19.0).
|
||||
See [CHANGELOG.md](./CHANGELOG.md) for the complete version history (v1.0.0 → v2.19.2).
|
||||
|
||||
---
|
||||
|
||||
*Project: ObsiGate | Version: 2.19.0 | Last updated: September 2026*
|
||||
*Project: ObsiGate | Version: 2.19.2 | Last updated: September 2026*
|
||||
|
||||
Generated
+1
-1
@@ -2626,7 +2626,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "obsigate-desktop"
|
||||
version = "2.19.0"
|
||||
version = "2.19.2"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"env_logger",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "obsigate-desktop"
|
||||
version = "2.19.0"
|
||||
version = "2.19.2"
|
||||
description = "ObsiGate Desktop — Porte d'entrée native pour vos vaults Obsidian"
|
||||
authors = ["Bruno Charest"]
|
||||
edition = "2021"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/nicedoc/obsigate/main/desktop/tauri.conf.schema.json",
|
||||
"productName": "ObsiGate",
|
||||
"version": "2.19.0",
|
||||
"version": "2.19.2",
|
||||
"identifier": "com.obsigate.desktop",
|
||||
"build": {
|
||||
"frontendDist": "../frontend",
|
||||
|
||||
@@ -180,6 +180,7 @@ Avant de corriger quoi que ce soit, un agent IA doit :
|
||||
| *BUG-069* | Login 2FA bloqué sans erreur : après user+pwd corrects, la page de login reste affichée et le challenge MFA n'apparaît jamais | 🟢 corrigé | P0 | 📱 frontend | IA | `frontend/js/auth.js`, `frontend/index.html` | Activer 2FA → logout → login (bon user+pwd) | `frontend/js/auth.js` (`showMfaChallenge` → `.login-card` + erreur `mfa.challenge_unavailable` si montage impossible), locales FR/EN ; tests `tests/frontend/mfa-settings.test.mjs` (+2) | Reproduit au navigateur avant correctif (challenge jamais affiché), vérifié après : challenge affiché, code erroné → erreur, code valide (200) → app ; frontend mfa-settings 11/11, unit + validate-imports verts |
|
||||
| *BUG-070* | Activation clé physique WebAuthn impossible : « Validation du credential WebAuthn échouée » à chaque tentative | 🟢 corrigé | P0 | ⚙️ backend | IA | `backend/auth/webauthn_mfa.py`, `backend/auth/router.py` | Config → Sécurité → Ajouter une clé → cérémonie navigateur → 400 | `resolve_relying_party()` (rp_id/origines dérivés de la requête, config explicite prioritaire, forwarded si TRUST_PROXY) sur les 4 endpoints ; challenges multiples (5 derniers) acceptés ; `.env.example` ; tests `tests/test_webauthn.py` (+8) | Logs : origin `http://localhost:2020` rejetée + challenge mismatch au retry. Vérifié navigateur (authentificateur virtuel CDP) : register 200 + clé listée, clé de test retirée (admin de nouveau TOTP seul) ; pytest 1249 passed, ruff/mypy 0 |
|
||||
| *BUG-071* | Configuration « Configurations » inutilisable en mode mobile : sommaire masqué sans bouton d'accès, navigation par ancre sans JS, grilles 2 colonnes et rangées d'ajout qui débordent (≤768px) | 🟢 corrigé | P1 | 📱 frontend | IA | `frontend/index.html`, `frontend/js/config.js`, `frontend/js/i18n.js`, `frontend/style.css`, `frontend/locales/{fr,en}.json` | Mobile (≤768px) : ouvrir Configurations → aucun sommaire ni moyen d'atteindre une section ; champs « Clés IA » / jetons / webhooks débordent | `index.html` (+`#config-hamburger` `.help-hamburger`, `config.toc_toggle` FR/EN) ; `config.js` (toggle, scroll doux + actif + repli auto mobile, reset à l'ouverture) ; `i18n.js` (`data-i18n-attr` multi-paires `;`) ; `style.css` (bloc mobile `#config-modal` : sommaire haut 46vh, grilles 1fr, add-rows wrap + `!important`, items wrap, 44px) ; tests `tests/frontend/config-mobile.test.mjs` (nouveau, 11) + CI ; E2E `tests/e2e/config-mobile.spec.js` (nouveau, 3/3 projet chromium-mobile, ignoré en desktop) | pytest 1249 passed / 6 skipped, ruff 0, mypy 0, validate-imports 39 modules, unit 10/10, JSDOM ai 93/93 + sidebar 6/6 + mobile 35/35 + ai-keys 7/7 |
|
||||
| *BUG-072* | Visionneuse d'images : le plein écran et le panneau « Métadonnées » ne sont pas conservés lors de la navigation ←/→, et le panneau s'affiche sous la pellicule au lieu d'une barre latérale | 🟢 corrigé | P2 | 📱 frontend | IA | `frontend/js/viewer.js`, `frontend/style.css` | Ouvrir une image, activer le plein écran (ou Métadonnées), puis naviguer avec les flèches précédent/suivant | État persistant `_imageViewerState { lightbox, meta }` + drapeau `_imageViewerNavPending` posé par `go()`/pellicule : `renderFile` ne réinitialise que hors navigation image→image. Panneau reconstruit dans `.image-viewer-body` (sidebar droite, `border-left`, `width:280px; max-width:40%`) ; la règle lightbox ne masque plus que la pellicule. Boutons `image-btn-lightbox`/`image-btn-metadata` (+ `aria-pressed`), `Escape` resynchronisé. Tests : `tests/frontend/image-viewer.test.mjs` (+2), E2E `tests/e2e/image-viewer.spec.js` (+1). | Navigation → `openFile` → `renderImageViewer` recréait le conteneur : les états `lightbox`/`metaPanel` étaient perdus. Le panneau était rendu en bas (colonne) au lieu d'une sidebar droite |
|
||||
| | | | | | | | | | | |
|
||||
|
||||
### TODOs techniques (améliorations / nouvelles tâches)
|
||||
@@ -258,6 +259,7 @@ Avant de corriger quoi que ce soit, un agent IA doit :
|
||||
| 2026-09-23 | BUG-070 | Correction | `backend/auth/webauthn_mfa.py`, `backend/auth/router.py`, `.env.example`, `tests/test_webauthn.py`, `CHANGELOG.md`, `docs/ISSUES_TODOLIST.md` | **BUG-070** : activation WebAuthn rejetée en 400. (1) Défauts `localhost` sans port → `resolve_relying_party()` dérive rp_id/origines de la requête (config explicite prioritaire, forwarded sous TRUST_PROXY), appliqué aux endpoints register + login. (2) Challenge single-use → 5 derniers conservés, vérification contre le challenge de la cérémonie en cours. **Vérifié au navigateur** (authentificateur virtuel CDP, instance Docker) : register 200, clé listée, clé de test retirée. Tests : `test_webauthn.py` 19/19 (+8), suite complète 1249 passed / 6 skipped, ruff/mypy 0. | 🟢 corrigé (en attente vérif utilisateur) |
|
||||
| 2026-09-23 | BUG-071 | Correction | `frontend/index.html`, `frontend/js/config.js`, `frontend/js/i18n.js`, `frontend/style.css`, `frontend/locales/{fr,en}.json`, `tests/frontend/config-mobile.test.mjs` (nouveau), `.gitea/workflows/ci.yml`, `CHANGELOG.md`, `docs/ISSUES_TODOLIST.md` | **BUG-071** : page « Configurations » inutilisable en mobile. (1) `#config-nav` masquée sous 768px sans toggle → hamburger `#config-hamburger` ajouté à l'en-tête (`.help-hamburger`, libellé `config.toc_toggle` FR/EN). (2) Ancres brutes sans JS → interception en `config.js` (scroll doux, lien actif, repli auto mobile, reset à l'ouverture). (3) Débordements 360px → bloc CSS mobile `#config-modal` (sommaire haut 46vh, grilles 1fr, add-rows wrap + largeurs inline neutralisées, items wrap, cibles 44px). `data-i18n-attr` multi-paires (`;`). Vérifié : `config-mobile.test.mjs` 11/11 (nouveau, au CI), pytest 1249 passed / 6 skipped, ruff/mypy 0, validate-imports 39 modules, unit 10/10, JSDOM ai 93/93 + ai-sidebar 6/6 + sidebar-filters 8/8 + mobile-editor 35/35 + config-ai-keys 7/7. | 🟢 corrigé (en attente vérif utilisateur) |
|
||||
| 2026-09-23 | BUG-071 (complément E2E) | Test | `tests/e2e/config-mobile.spec.js` (nouveau), `CHANGELOG.md`, `docs/ISSUES_TODOLIST.md` | **BUG-071 (complément E2E)** : spec Playwright mobile (convention `mobile-editor.spec.js` : `test.skip` hors viewport ≤768px, donc inactive sur le projet `chromium-desktop` du CI). Vérifié en local sur l'instance de test (port 2029, auth désactivée) : hamburger → sommaire, sélection → scroll + actif + repli, 0 débordement horizontal à 393px (3/3 `chromium-mobile`, 3 ignorés en desktop) ; suite `mobile-editor.spec.js` intacte (3/3). | 🟢 corrigé (en attente vérif utilisateur) |
|
||||
| 2026-09-23 | BUG-072 | Correction | `frontend/js/viewer.js`, `frontend/style.css`, `tests/frontend/image-viewer.test.mjs`, `tests/e2e/image-viewer.spec.js`, `scripts/run-e2e-local.ps1` (nouveau), `package.json`, `AGENTS.md`, `README.md`, `README.fr.md`, `CHANGELOG.md`, `docs/ISSUES_TODOLIST.md` | **BUG-072** : dans la visionneuse d'images (#108-D), le plein écran (lightbox) et le panneau « Métadonnées » étaient perdus dès qu'on changeait d'image avec ←/→ (ou la pellicule), car `openFile` → `renderFile` recrée entièrement `renderImageViewer`. (1) **Persistance** : état module `_imageViewerState { lightbox, meta }` restauré à chaque rendu ; un drapeau `_imageViewerNavPending` posé par `go()` et le clic de vignette indique à `renderFile` que le rendu suivant est une navigation image→image (pas de réinitialisation) — toute autre ouverture repart à zéro. (2) **Panneau latéral** : `.image-meta-panel` déplacé dans un nouveau `.image-viewer-body` en flex row, à droite de `.image-stage` (`border-left`, `width:280px; max-width:40%`, défilement vertical) au lieu d'une bande sous la pellicule ; la règle lightbox ne masque plus que la pellicule. Boutons stables `image-btn-lightbox`/`image-btn-metadata` + `aria-pressed`, `Escape` resynchronise l'état. Tests statiques `image-viewer.test.mjs` (+2) et E2E Playwright (+1). **Diagnostic E2E** : `npm run test:e2e` bloquait car `bash` résout vers WSL (HS, Ubuntu `Stopped`, `HCS_E_CONNECTION_TIMEOUT`) et git-bash est bloqué par App Control → lanceur PowerShell ajouté. Vérifié : `image-viewer.spec.js` 4/4, **suite `chromium-desktop` complète 103 passed / 6 skipped (10,3 min)** via `scripts/run-e2e-local.ps1`, `image-viewer.test.mjs` 12/12, unit 10/10, validate-imports 40 modules. | 🟢 corrigé (en attente vérif utilisateur) |
|
||||
|
||||
---
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
# ObsiGate — Roadmap
|
||||
|
||||
> **Version :** 2.19.0 | **Dernière mise à jour :** 2026-09-23
|
||||
> **Version :** 2.19.2 | **Dernière mise à jour :** 2026-09-23
|
||||
> **Ce fichier ne contient que le travail à venir** (🔵 En cours + ⚪ Backlog) et un index compact
|
||||
> vers les fonctionnalités livrées.
|
||||
> - **Méthode de livraison à appliquer pour toute tâche : [DELIVERY_WORKFLOW.md](./DELIVERY_WORKFLOW.md)**
|
||||
|
||||
@@ -134,12 +134,15 @@ global `window.NowPlaying`.
|
||||
- **Panneau étendu** : carte centrale (bottom-sheet sur mobile) avec artwork,
|
||||
scrub large, volume, vitesse 0,5–2×, précédent/suivant et actions
|
||||
ouvrir/télécharger/fermer.
|
||||
- **Mini-vidéo flottante** (`.np-dock--video`) : déplaçable (aimantation au coin
|
||||
le plus proche) et redimensionnable, géométrie persistée ; sur mobile elle se
|
||||
fixe au-dessus de la barre d'outils.
|
||||
- **Mini-vidéo flottante** (`.np-dock--video`) : déplaçable **librement** depuis
|
||||
n'importe quel point de la fenêtre (position absolue mémorisée, centre autorisé
|
||||
— aucune aimantation aux bords) et redimensionnable, géométrie persistée ; sur
|
||||
mobile elle se fixe au-dessus de la barre d'outils.
|
||||
- **Mobile** : mini-player au-dessus de la barre 64 px
|
||||
(`bottom: calc(64px + env(safe-area-inset-bottom))`), `viewport-fit=cover`
|
||||
ajouté, et `body.np-active` ajoute le décalage du contenu.
|
||||
ajouté, et `body.np-active` ajoute le décalage du contenu. La barre audio passe
|
||||
en grille (progression sur sa propre ligne) et masque les actions secondaires
|
||||
pour éviter tout chevauchement.
|
||||
|
||||
### Comportements
|
||||
|
||||
|
||||
+67
-47
@@ -365,9 +365,13 @@ function buildAudioDock() {
|
||||
art.addEventListener('click', (e) => { stopEvent(e); toggleExpanded(); });
|
||||
dock.appendChild(art);
|
||||
|
||||
const info = npEl('div', { class: 'np-dock-info' });
|
||||
const info = npEl('div', { class: 'np-dock-info', title: t('player.expand'), role: 'button', tabindex: '0' });
|
||||
info.appendChild(npEl('span', { class: 'np-dock-title' }));
|
||||
info.appendChild(npEl('span', { class: 'np-dock-sub' }));
|
||||
info.addEventListener('click', (e) => { stopEvent(e); toggleExpanded(); });
|
||||
info.addEventListener('keydown', (e) => {
|
||||
if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); toggleExpanded(); }
|
||||
});
|
||||
dock.appendChild(info);
|
||||
|
||||
const controls = npEl('div', { class: 'np-dock-controls' });
|
||||
@@ -425,7 +429,7 @@ function buildVideoDock() {
|
||||
dock.appendChild(frame);
|
||||
const resize = npEl('div', { class: 'np-video-resize', title: t('player.resize'), 'aria-hidden': 'true' });
|
||||
dock.appendChild(resize);
|
||||
bindVideoDrag(dock, grip);
|
||||
bindVideoDrag(dock);
|
||||
bindVideoResize(dock, resize);
|
||||
return dock;
|
||||
}
|
||||
@@ -833,75 +837,91 @@ function restore() {
|
||||
notify(t('player.resume'), 'info');
|
||||
}
|
||||
|
||||
// ── Video dock drag & resize ──────────────────────────────────────────────────
|
||||
// ── Video dock drag & resize (free positioning anywhere in the viewport) ──────
|
||||
const VIDEO_MIN = { w: 240, h: 150 };
|
||||
const VIDEO_DEFAULT = { w: 360, h: 220 };
|
||||
|
||||
function clampToViewport(left, top, w, h) {
|
||||
const margin = 8;
|
||||
const maxLeft = Math.max(margin, window.innerWidth - w - margin);
|
||||
const maxTop = Math.max(margin, window.innerHeight - h - margin);
|
||||
return {
|
||||
left: Math.min(Math.max(margin, left), maxLeft),
|
||||
top: Math.min(Math.max(margin, top), maxTop),
|
||||
};
|
||||
}
|
||||
|
||||
function applyVideoGeometry() {
|
||||
if (!S.dock || S.dockKind !== 'video') return;
|
||||
const pos = readPosition();
|
||||
const mobile = isMobile();
|
||||
if (mobile) {
|
||||
if (isMobile()) {
|
||||
S.dock.style.removeProperty('left');
|
||||
S.dock.style.removeProperty('top');
|
||||
S.dock.style.removeProperty('width');
|
||||
S.dock.style.removeProperty('height');
|
||||
return;
|
||||
}
|
||||
const w = pos && pos.w ? pos.w : 360;
|
||||
const h = pos && pos.h ? pos.h : 220;
|
||||
const pos = readPosition() || {};
|
||||
const w = pos.w || VIDEO_DEFAULT.w;
|
||||
const h = pos.h || VIDEO_DEFAULT.h;
|
||||
S.dock.style.width = w + 'px';
|
||||
S.dock.style.height = h + 'px';
|
||||
const vw = window.innerWidth, vh = window.innerHeight;
|
||||
const margin = 16;
|
||||
const corner = (pos && pos.corner) || 'br';
|
||||
let left, top;
|
||||
if (corner.includes('l')) left = margin; else left = vw - w - margin;
|
||||
if (corner.includes('t')) top = margin + 56; else top = vh - h - 24;
|
||||
S.dock.style.left = Math.max(margin, left) + 'px';
|
||||
S.dock.style.top = Math.max(margin, top) + 'px';
|
||||
const left = typeof pos.left === 'number' ? pos.left : window.innerWidth - w - margin;
|
||||
const top = typeof pos.top === 'number' ? pos.top : window.innerHeight - h - 24;
|
||||
const c = clampToViewport(left, top, w, h);
|
||||
S.dock.style.left = c.left + 'px';
|
||||
S.dock.style.top = c.top + 'px';
|
||||
}
|
||||
|
||||
function nearestCorner(left, top, w, h) {
|
||||
const midX = left + w / 2, midY = top + h / 2;
|
||||
const vw = window.innerWidth, vh = window.innerHeight;
|
||||
return `${midY < vh / 2 ? 't' : 'b'}${midX < vw / 2 ? 'l' : 'r'}`;
|
||||
}
|
||||
|
||||
function bindVideoDrag(dock, grip) {
|
||||
if (!grip) return;
|
||||
grip.style.cursor = 'grab';
|
||||
grip.addEventListener('pointerdown', (e) => {
|
||||
if (isMobile()) return;
|
||||
e.preventDefault();
|
||||
// Drag from anywhere on the mini-window (buttons, sliders and the resize handle
|
||||
// excluded). A small movement threshold keeps clicks on the native video
|
||||
// controls working; no pointer capture is used so those controls keep working.
|
||||
function bindVideoDrag(dock) {
|
||||
dock.addEventListener('pointerdown', (e) => {
|
||||
if (isMobile() || e.button !== 0) return;
|
||||
if (e.target.closest('button, input, select, textarea, a, .np-video-resize')) return;
|
||||
const rect = dock.getBoundingClientRect();
|
||||
S._drag = { dx: e.clientX - rect.left, dy: e.clientY - rect.top, w: rect.width, h: rect.height };
|
||||
grip.setPointerCapture?.(e.pointerId);
|
||||
grip.style.cursor = 'grabbing';
|
||||
S._drag = {
|
||||
dx: e.clientX - rect.left,
|
||||
dy: e.clientY - rect.top,
|
||||
startX: e.clientX,
|
||||
startY: e.clientY,
|
||||
moved: false,
|
||||
};
|
||||
document.addEventListener('pointermove', onDragMove);
|
||||
document.addEventListener('pointerup', onDragEnd);
|
||||
});
|
||||
}
|
||||
|
||||
function onDragMove(e) {
|
||||
if (!S._drag || !S.dock) return;
|
||||
const margin = 8;
|
||||
if (!S._drag || S._drag.resize || !S.dock) return;
|
||||
if (!S._drag.moved) {
|
||||
if (Math.abs(e.clientX - S._drag.startX) < 4 && Math.abs(e.clientY - S._drag.startY) < 4) return;
|
||||
S._drag.moved = true;
|
||||
S.dock.classList.add('np-dragging');
|
||||
}
|
||||
const w = S.dock.offsetWidth, h = S.dock.offsetHeight;
|
||||
let left = e.clientX - S._drag.dx;
|
||||
let top = e.clientY - S._drag.dy;
|
||||
left = Math.max(margin, Math.min(window.innerWidth - w - margin, left));
|
||||
top = Math.max(margin, Math.min(window.innerHeight - h - margin, top));
|
||||
S.dock.style.left = left + 'px';
|
||||
S.dock.style.top = top + 'px';
|
||||
const c = clampToViewport(e.clientX - S._drag.dx, e.clientY - S._drag.dy, w, h);
|
||||
S.dock.style.left = c.left + 'px';
|
||||
S.dock.style.top = c.top + 'px';
|
||||
}
|
||||
|
||||
function onDragEnd(e) {
|
||||
function onDragEnd() {
|
||||
document.removeEventListener('pointermove', onDragMove);
|
||||
document.removeEventListener('pointerup', onDragEnd);
|
||||
if (!S.dock) return;
|
||||
const r = S.dock.getBoundingClientRect();
|
||||
const corner = nearestCorner(r.left, r.top, r.width, r.height);
|
||||
writePosition({ corner, w: Math.round(r.width), h: Math.round(r.height) });
|
||||
applyVideoGeometry();
|
||||
void e;
|
||||
if (!S.dock) { S._drag = null; return; }
|
||||
S.dock.classList.remove('np-dragging');
|
||||
if (S._drag && S._drag.moved) {
|
||||
const r = S.dock.getBoundingClientRect();
|
||||
const pos = readPosition() || {};
|
||||
writePosition({
|
||||
...pos,
|
||||
left: Math.round(r.left),
|
||||
top: Math.round(r.top),
|
||||
w: Math.round(r.width),
|
||||
h: Math.round(r.height),
|
||||
});
|
||||
}
|
||||
S._drag = null;
|
||||
}
|
||||
|
||||
@@ -932,8 +952,8 @@ function onResizeEnd() {
|
||||
document.removeEventListener('pointerup', onResizeEnd);
|
||||
if (S.dock) {
|
||||
const r = S.dock.getBoundingClientRect();
|
||||
const pos = readPosition() || {};
|
||||
writePosition({ ...pos, w: Math.round(r.width), h: Math.round(r.height) });
|
||||
const c = clampToViewport(r.left, r.top, r.width, r.height);
|
||||
writePosition({ left: Math.round(c.left), top: Math.round(c.top), w: Math.round(r.width), h: Math.round(r.height) });
|
||||
applyVideoGeometry();
|
||||
}
|
||||
S._drag = null;
|
||||
|
||||
+48
-15
@@ -548,6 +548,13 @@ const IMAGE_EXTS = new Set([".png", ".jpg", ".jpeg", ".gif", ".svg", ".webp", ".
|
||||
const IMAGE_ZOOM_MIN = 0.1;
|
||||
const IMAGE_ZOOM_MAX = 8;
|
||||
let _imageViewerCleanup = null;
|
||||
// BUG-072 — the lightbox and metadata panel states must survive the re-render
|
||||
// triggered by ←/→ navigation (openFile → renderFile → renderImageViewer).
|
||||
// Reset as soon as a non-image file is rendered.
|
||||
const _imageViewerState = { lightbox: false, meta: false };
|
||||
// Set right before an image→image navigation (←/→ / filmstrip click) so
|
||||
// renderFile knows the state above must be carried over instead of reset.
|
||||
let _imageViewerNavPending = false;
|
||||
|
||||
/** Clamp a zoom factor into the supported [0.1, 8] range. */
|
||||
export function clampImageZoom(value) {
|
||||
@@ -614,27 +621,29 @@ export function renderImageViewer(area, data) {
|
||||
const nextBtn = mkBtn("chevron-right", t("viewer.image_next"));
|
||||
const originalBtn = mkBtn("external-link", t("viewer.image_open_original"));
|
||||
const downloadBtn = mkBtn("download", t("viewer.download"));
|
||||
const metaBtn = mkBtn("info", t("viewer.image_metadata"));
|
||||
const lightboxBtn = mkBtn("maximize", t("viewer.image_fullscreen"));
|
||||
const metaBtn = mkBtn("info", t("viewer.image_metadata"), "image-btn-metadata");
|
||||
const lightboxBtn = mkBtn("maximize", t("viewer.image_fullscreen"), "image-btn-lightbox");
|
||||
[prevBtn, nextBtn, zoomOutBtn, zoomInBtn, zoomResetBtn, metaBtn, originalBtn, downloadBtn, lightboxBtn]
|
||||
.forEach((b) => toolbar.appendChild(b));
|
||||
container.appendChild(toolbar);
|
||||
|
||||
// ── Stage (image + pan/zoom) ───────────────────────────────────────────
|
||||
// ── Body: image stage + metadata sidebar (right) ───────────────────────
|
||||
const body = el("div", { class: "image-viewer-body" });
|
||||
const stage = el("div", { class: "image-stage" });
|
||||
const img = el("img", { class: "image-main", src: imgUrl, alt: data.title || fileName, draggable: "false" });
|
||||
stage.appendChild(img);
|
||||
container.appendChild(stage);
|
||||
body.appendChild(stage);
|
||||
|
||||
// ── Metadata sidebar (kept open across ←/→ navigation) ─────────────────
|
||||
const metaPanel = el("div", { class: "image-meta-panel" });
|
||||
metaPanel.hidden = !_imageViewerState.meta;
|
||||
body.appendChild(metaPanel);
|
||||
container.appendChild(body);
|
||||
|
||||
// ── Thumbnail filmstrip (navigation) ───────────────────────────────────
|
||||
const strip = el("div", { class: "image-nav-strip", hidden: true });
|
||||
container.appendChild(strip);
|
||||
|
||||
// ── Metadata panel ─────────────────────────────────────────────────────
|
||||
const metaPanel = el("div", { class: "image-meta-panel" });
|
||||
metaPanel.hidden = true;
|
||||
container.appendChild(metaPanel);
|
||||
|
||||
let scale = 1;
|
||||
let tx = 0;
|
||||
let ty = 0;
|
||||
@@ -674,6 +683,7 @@ export function renderImageViewer(area, data) {
|
||||
const go = (delta) => {
|
||||
if (siblings.length < 2 || currentIndex < 0) return;
|
||||
const next = (currentIndex + delta + siblings.length) % siblings.length;
|
||||
_imageViewerNavPending = true;
|
||||
openFile(vault, siblings[next].path);
|
||||
};
|
||||
|
||||
@@ -689,7 +699,11 @@ export function renderImageViewer(area, data) {
|
||||
title: s.name,
|
||||
loading: "lazy",
|
||||
});
|
||||
thumb.addEventListener("click", () => { if (s.path !== path) openFile(vault, s.path); });
|
||||
thumb.addEventListener("click", () => {
|
||||
if (s.path === path) return;
|
||||
_imageViewerNavPending = true;
|
||||
openFile(vault, s.path);
|
||||
});
|
||||
strip.appendChild(thumb);
|
||||
});
|
||||
};
|
||||
@@ -751,13 +765,21 @@ export function renderImageViewer(area, data) {
|
||||
const dlUrl = `/api/file/${encodeURIComponent(vault)}/download?path=${encodeURIComponent(path)}`;
|
||||
window.open(dlUrl, "_blank");
|
||||
});
|
||||
metaBtn.setAttribute("aria-pressed", _imageViewerState.meta ? "true" : "false");
|
||||
metaBtn.addEventListener("click", () => {
|
||||
metaPanel.hidden = !metaPanel.hidden;
|
||||
if (!metaPanel.hidden) renderMeta();
|
||||
_imageViewerState.meta = !_imageViewerState.meta;
|
||||
metaPanel.hidden = !_imageViewerState.meta;
|
||||
metaBtn.setAttribute("aria-pressed", _imageViewerState.meta ? "true" : "false");
|
||||
if (_imageViewerState.meta) renderMeta();
|
||||
});
|
||||
const syncLightbox = () => {
|
||||
container.classList.toggle("lightbox", _imageViewerState.lightbox);
|
||||
lightboxBtn.setAttribute("aria-pressed", _imageViewerState.lightbox ? "true" : "false");
|
||||
};
|
||||
syncLightbox();
|
||||
lightboxBtn.addEventListener("click", () => {
|
||||
container.classList.toggle("lightbox");
|
||||
lightboxBtn.setAttribute("aria-pressed", container.classList.contains("lightbox") ? "true" : "false");
|
||||
_imageViewerState.lightbox = !_imageViewerState.lightbox;
|
||||
syncLightbox();
|
||||
});
|
||||
|
||||
img.addEventListener("load", () => { if (!metaPanel.hidden) renderMeta(); });
|
||||
@@ -772,7 +794,10 @@ export function renderImageViewer(area, data) {
|
||||
else if (e.key === "+" || e.key === "=") { e.preventDefault(); setZoom(scale * 1.25); }
|
||||
else if (e.key === "-") { e.preventDefault(); setZoom(scale / 1.25); }
|
||||
else if (e.key === "0") { e.preventDefault(); resetView(); }
|
||||
else if (e.key === "Escape") { container.classList.remove("lightbox"); }
|
||||
else if (e.key === "Escape") {
|
||||
_imageViewerState.lightbox = false;
|
||||
syncLightbox();
|
||||
}
|
||||
};
|
||||
document.addEventListener("keydown", onKey);
|
||||
_imageViewerCleanup = () => document.removeEventListener("keydown", onKey);
|
||||
@@ -780,6 +805,7 @@ export function renderImageViewer(area, data) {
|
||||
area.appendChild(container);
|
||||
safeCreateIcons();
|
||||
applyTransform();
|
||||
if (_imageViewerState.meta) renderMeta();
|
||||
try { container.focus({ preventScroll: true }); } catch (_) { /* non-fatal */ }
|
||||
}
|
||||
|
||||
@@ -810,6 +836,13 @@ export function renderFile(data) {
|
||||
// #108 — release the image viewer's document-level shortcuts before swapping
|
||||
// the content area (otherwise they leak on every re-render).
|
||||
if (_imageViewerCleanup) { _imageViewerCleanup(); _imageViewerCleanup = null; }
|
||||
// BUG-072 — carry the lightbox / metadata-panel state over an image→image
|
||||
// navigation; any other render starts from a clean viewer.
|
||||
if (!data.is_image || !_imageViewerNavPending) {
|
||||
_imageViewerState.lightbox = false;
|
||||
_imageViewerState.meta = false;
|
||||
}
|
||||
_imageViewerNavPending = false;
|
||||
const area = getContentArea();
|
||||
// #110 — if this render is about to replace the surface that currently hosts
|
||||
// the shared media element, hand it back to the persistent dock first.
|
||||
|
||||
+54
-10
@@ -9673,6 +9673,11 @@ body.desktop-mode .editor-container {
|
||||
min-width: 46px;
|
||||
text-align: center;
|
||||
}
|
||||
.image-viewer-body {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
min-height: 0;
|
||||
}
|
||||
.image-stage {
|
||||
flex: 1;
|
||||
position: relative;
|
||||
@@ -9680,7 +9685,7 @@ body.desktop-mode .editor-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 60vh;
|
||||
min-width: 0;
|
||||
background: var(--surface2);
|
||||
cursor: grab;
|
||||
touch-action: none;
|
||||
@@ -9731,9 +9736,12 @@ body.desktop-mode .editor-container {
|
||||
opacity: 1;
|
||||
}
|
||||
.image-meta-panel {
|
||||
width: 280px;
|
||||
max-width: 40%;
|
||||
overflow-y: auto;
|
||||
padding: 10px 16px;
|
||||
background: var(--surface);
|
||||
border-top: 1px solid var(--border);
|
||||
border-left: 1px solid var(--border);
|
||||
font-size: 0.8rem;
|
||||
color: var(--text-secondary);
|
||||
flex-shrink: 0;
|
||||
@@ -9761,8 +9769,7 @@ body.desktop-mode .editor-container {
|
||||
z-index: 2000;
|
||||
background: rgba(0, 0, 0, 0.9);
|
||||
}
|
||||
.image-viewer-container.lightbox .image-nav-strip,
|
||||
.image-viewer-container.lightbox .image-meta-panel {
|
||||
.image-viewer-container.lightbox .image-nav-strip {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@@ -9913,6 +9920,7 @@ body.desktop-mode .editor-container {
|
||||
border-radius: 14px;
|
||||
box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
|
||||
backdrop-filter: blur(12px);
|
||||
overflow: hidden;
|
||||
}
|
||||
.np-dock--audio .np-media {
|
||||
display: none;
|
||||
@@ -9931,11 +9939,12 @@ body.desktop-mode .editor-container {
|
||||
cursor: pointer;
|
||||
}
|
||||
.np-dock-info {
|
||||
flex: 1 1 auto;
|
||||
flex: 1 1 120px;
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.np-dock-title {
|
||||
color: var(--text);
|
||||
@@ -9958,8 +9967,8 @@ body.desktop-mode .editor-container {
|
||||
gap: 2px;
|
||||
}
|
||||
.np-dock-progress {
|
||||
flex: 1 1 180px;
|
||||
min-width: 120px;
|
||||
flex: 1 1 160px;
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
@@ -10209,6 +10218,13 @@ body.desktop-mode .editor-container {
|
||||
font-size: 0.75rem;
|
||||
}
|
||||
|
||||
/* Mid-size screens: drop the volume slider before the row gets cramped. */
|
||||
@media (max-width: 1100px) {
|
||||
.np-dock--audio .np-volume {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.np-dock--audio {
|
||||
left: 8px;
|
||||
@@ -10216,11 +10232,39 @@ body.desktop-mode .editor-container {
|
||||
bottom: calc(64px + env(safe-area-inset-bottom, 0px) + 8px);
|
||||
transform: none;
|
||||
width: auto;
|
||||
display: grid;
|
||||
grid-template-columns: auto minmax(0, 1fr) auto auto;
|
||||
grid-template-areas:
|
||||
"progress progress progress progress"
|
||||
"art info controls actions";
|
||||
align-items: center;
|
||||
gap: 6px 8px;
|
||||
padding: 8px 10px;
|
||||
border-radius: 12px;
|
||||
}
|
||||
.np-dock-progress {
|
||||
flex-basis: 90px;
|
||||
.np-dock--audio .np-dock-art {
|
||||
grid-area: art;
|
||||
width: 38px;
|
||||
height: 38px;
|
||||
}
|
||||
.np-volume {
|
||||
.np-dock--audio .np-dock-info {
|
||||
grid-area: info;
|
||||
}
|
||||
.np-dock--audio .np-dock-controls {
|
||||
grid-area: controls;
|
||||
}
|
||||
.np-dock--audio .np-dock-progress {
|
||||
grid-area: progress;
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
}
|
||||
.np-dock--audio .np-dock-actions {
|
||||
grid-area: actions;
|
||||
}
|
||||
/* Compact mobile: keep play / return / close; expand via the artwork. */
|
||||
.np-dock--audio [data-np="prev"],
|
||||
.np-dock--audio [data-np="next"],
|
||||
.np-dock--audio [data-np="expand"] {
|
||||
display: none;
|
||||
}
|
||||
.np-dock--video {
|
||||
|
||||
+3
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "obsigate",
|
||||
"version": "2.19.0",
|
||||
"version": "2.19.2",
|
||||
"description": "**Porte d'entrée web ultra-léger pour vos vaults Obsidian** — Accédez, naviguez et recherchez dans toutes vos notes Obsidian depuis n'importe quel appareil via une interface web moderne et responsive.",
|
||||
"main": "patch.js",
|
||||
"directories": {
|
||||
@@ -9,7 +9,8 @@
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"test:e2e": "bash scripts/run-e2e-local.sh"
|
||||
"test:e2e": "bash scripts/run-e2e-local.sh",
|
||||
"test:e2e:ps": "pwsh -NoProfile -File scripts/run-e2e-local.ps1"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
ObsiGate — E2E locaux (Playwright) sous Windows/PowerShell.
|
||||
|
||||
.DESCRIPTION
|
||||
Équivalent PowerShell de `scripts/run-e2e-local.sh`, pour les postes Windows
|
||||
où `bash` n'est pas utilisable (WSL indisponible, git-bash bloqué par une
|
||||
politique de contrôle d'application). Démarre le backend nativement via
|
||||
uvicorn (auth désactivée, fixtures TestVault/TestDir, port 2029 — mêmes
|
||||
conditions que le job CI `e2e`), lance la suite Playwright puis nettoie.
|
||||
|
||||
.PARAMETER PlaywrightArgs
|
||||
Arguments transmis à `npx playwright test`, ex. `-g "image viewer"`,
|
||||
`--headed`.
|
||||
|
||||
.EXAMPLE
|
||||
./scripts/run-e2e-local.ps1
|
||||
./scripts/run-e2e-local.ps1 -g "BUG-072"
|
||||
./scripts/run-e2e-local.ps1 --headed
|
||||
#>
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[Parameter(ValueFromRemainingArguments = $true)]
|
||||
[string[]]$PlaywrightArgs
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$Root = Split-Path -Parent $PSScriptRoot
|
||||
Set-Location -LiteralPath $Root
|
||||
|
||||
$Port = if ($env:E2E_PORT) { $env:E2E_PORT } else { "2029" }
|
||||
$BaseUrl = "http://127.0.0.1:$Port"
|
||||
$ServerLog = "data/e2e-server.log"
|
||||
$ServerErrLog = "data/e2e-server.err.log"
|
||||
|
||||
function Assert-Command([string]$Name, [string]$Hint) {
|
||||
if (-not (Get-Command $Name -ErrorAction SilentlyContinue)) {
|
||||
throw "[ERR] $Name introuvable. $Hint"
|
||||
}
|
||||
}
|
||||
|
||||
Assert-Command "uv" "Installez-le : https://docs.astral.sh/uv/"
|
||||
Assert-Command "npx" "Installez Node.js (>= 20)."
|
||||
|
||||
# ----- Venv Python 3.11 (créé une seule fois) -----
|
||||
$Python = ".venv-e2e/Scripts/python.exe"
|
||||
if (-not (Test-Path -LiteralPath $Python)) {
|
||||
Write-Host "[INFO] Création du venv .venv-e2e (Python 3.11)..."
|
||||
uv venv .venv-e2e --python 3.11
|
||||
uv pip install --python $Python -r backend/requirements.txt
|
||||
}
|
||||
|
||||
# ----- Port déjà occupé ? -----
|
||||
try {
|
||||
Invoke-WebRequest -Uri "$BaseUrl/api/health" -TimeoutSec 2 -UseBasicParsing | Out-Null
|
||||
Write-Host "[ERR] Quelque chose répond déjà sur $BaseUrl."
|
||||
Write-Host " Arrêtez-le ou choisissez un autre port : `$env:E2E_PORT=2030; ./scripts/run-e2e-local.ps1"
|
||||
exit 1
|
||||
} catch {
|
||||
# port libre
|
||||
}
|
||||
|
||||
# ----- Démarrage du serveur (mêmes conditions que le CI e2e) -----
|
||||
Write-Host "[INFO] Démarrage d'ObsiGate sur $BaseUrl (auth désactivée)..."
|
||||
New-Item -ItemType Directory -Force -Path "data" | Out-Null
|
||||
|
||||
$env:OBSIGATE_AUTH_ENABLED = "false"
|
||||
$env:VAULT_1_NAME = "TestVault"
|
||||
$env:VAULT_1_PATH = (Resolve-Path -LiteralPath "test_vault").Path
|
||||
$env:DIR_1_NAME = "TestDir"
|
||||
$env:DIR_1_PATH = (Resolve-Path -LiteralPath "test_dir").Path
|
||||
|
||||
$server = Start-Process -FilePath $Python `
|
||||
-ArgumentList "-m", "uvicorn", "backend.main:app", "--host", "127.0.0.1", "--port", $Port `
|
||||
-RedirectStandardOutput $ServerLog -RedirectStandardError $ServerErrLog `
|
||||
-PassThru -WindowStyle Hidden
|
||||
|
||||
$exitCode = 1
|
||||
try {
|
||||
# ----- Attente du health check (30 s max, comme le CI) -----
|
||||
$ready = $false
|
||||
for ($i = 0; $i -lt 30; $i++) {
|
||||
try {
|
||||
Invoke-WebRequest -Uri "$BaseUrl/api/health" -TimeoutSec 2 -UseBasicParsing | Out-Null
|
||||
$ready = $true
|
||||
break
|
||||
} catch {
|
||||
if ($server.HasExited) {
|
||||
Write-Host "[ERR] Le serveur a quitté prématurément. Log :"
|
||||
Get-Content -LiteralPath $ServerErrLog -Tail 30 -ErrorAction SilentlyContinue
|
||||
exit 1
|
||||
}
|
||||
Start-Sleep -Seconds 1
|
||||
}
|
||||
}
|
||||
if (-not $ready) {
|
||||
Write-Host "[ERR] Serveur injoignable sur $BaseUrl. Log :"
|
||||
Get-Content -LiteralPath $ServerErrLog -Tail 30 -ErrorAction SilentlyContinue
|
||||
exit 1
|
||||
}
|
||||
Write-Host "[OK] Serveur prêt."
|
||||
|
||||
# ----- Browsers Playwright (no-op s'ils sont déjà installés) -----
|
||||
npx playwright install chromium
|
||||
|
||||
# ----- Exécution de la suite (projet CI : chromium-desktop) -----
|
||||
Write-Host "[INFO] BASE_URL=$BaseUrl npx playwright test --project=chromium-desktop $($PlaywrightArgs -join ' ')"
|
||||
$env:BASE_URL = $BaseUrl
|
||||
& npx playwright test --project=chromium-desktop @PlaywrightArgs
|
||||
$exitCode = $LASTEXITCODE
|
||||
} finally {
|
||||
Write-Host "[INFO] Arrêt du serveur (PID $($server.Id))..."
|
||||
if (-not $server.HasExited) { Stop-Process -Id $server.Id -Force -ErrorAction SilentlyContinue }
|
||||
# uvicorn (via uv) peut lancer un interpréteur enfant : tuer le groupe resté sur le port.
|
||||
Get-NetTCPConnection -LocalPort $Port -State Listen -ErrorAction SilentlyContinue |
|
||||
ForEach-Object { Stop-Process -Id $_.OwningProcess -Force -ErrorAction SilentlyContinue }
|
||||
}
|
||||
|
||||
exit $exitCode
|
||||
@@ -95,4 +95,32 @@ test.describe('Image viewer — zoom / pan / navigation (#108)', () => {
|
||||
await page.locator('#content-area .image-nav-strip img.image-thumb').first().click();
|
||||
await expect(page.locator('#content-area .image-title')).toBeVisible();
|
||||
});
|
||||
|
||||
test('conserve le plein écran et le panneau métadonnées à la navigation (#BUG-072)', async ({ page }) => {
|
||||
await login(page);
|
||||
await openFile(page, 'TestVault', 'sample-image.png');
|
||||
|
||||
const container = page.locator('#content-area .image-viewer-container');
|
||||
const metaPanel = page.locator('#content-area .image-meta-panel');
|
||||
const title = page.locator('#content-area .image-title');
|
||||
await expect(container).toBeVisible({ timeout: 10000 });
|
||||
|
||||
// Métadonnées : barre latérale à droite de l'image (pas sous la pellicule).
|
||||
await page.locator('#content-area .image-btn-metadata').click();
|
||||
await expect(metaPanel).toBeVisible();
|
||||
const stageBox = await page.locator('#content-area .image-stage').boundingBox();
|
||||
const metaBox = await metaPanel.boundingBox();
|
||||
expect(metaBox.x).toBeGreaterThanOrEqual(stageBox.x + stageBox.width - 1);
|
||||
|
||||
// Plein écran activé.
|
||||
await page.locator('#content-area .image-btn-lightbox').click();
|
||||
await expect(container).toHaveClass(/lightbox/);
|
||||
|
||||
// Naviguer (flèche droite) : les deux états doivent survivre au re-render.
|
||||
const titleBefore = await title.innerText();
|
||||
await page.keyboard.press('ArrowRight');
|
||||
await expect(container).toHaveClass(/lightbox/);
|
||||
await expect(metaPanel).toBeVisible();
|
||||
await expect(title).not.toHaveText(titleBefore);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -134,4 +134,30 @@ test.describe('Now Playing — lecture persistante (#110)', () => {
|
||||
await expect(mini).toBeVisible({ timeout: 10000 });
|
||||
await expect(mini.locator('video.np-media--video')).toBeVisible();
|
||||
});
|
||||
|
||||
test('la mini-fenêtre vidéo peut être déplacée librement (centre)', async ({ page }) => {
|
||||
await login(page);
|
||||
await openFile(page, 'TestVault', 'sample-video.webm');
|
||||
await expect(page.locator('#content-area video.np-media--video')).toBeVisible({ timeout: 10000 });
|
||||
await openFile(page, 'TestVault', 'note1.md');
|
||||
|
||||
const mini = page.locator('#now-playing-host .np-dock--video');
|
||||
await expect(mini).toBeVisible({ timeout: 10000 });
|
||||
const before = await mini.evaluate((el) => ({ left: parseFloat(el.style.left), top: parseFloat(el.style.top) }));
|
||||
|
||||
const box = await mini.boundingBox();
|
||||
await page.mouse.move(box.x + box.width / 2, box.y + 12);
|
||||
await page.mouse.down();
|
||||
await page.mouse.move(640, 360, { steps: 12 });
|
||||
await page.mouse.up();
|
||||
|
||||
const after = await mini.evaluate((el) => ({ left: parseFloat(el.style.left), top: parseFloat(el.style.top) }));
|
||||
expect(after.left).not.toBe(before.left);
|
||||
expect(after.top).not.toBe(before.top);
|
||||
// Doit pouvoir rester au centre (pas de re-aimantation sur les bords).
|
||||
expect(after.left).toBeGreaterThan(50);
|
||||
expect(after.left).toBeLessThan(900);
|
||||
expect(after.top).toBeGreaterThan(20);
|
||||
expect(after.top).toBeLessThan(600);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -93,6 +93,20 @@ test("image viewer exposes thumbnail navigation via /api/media thumb", () => {
|
||||
assert.match(viewer, /siblings = \(res\.items \|\| \[\]\)/);
|
||||
});
|
||||
|
||||
// BUG-072 — lightbox + metadata panel must survive ←/→ (and filmstrip) navigation.
|
||||
test("image viewer persists lightbox + metadata state across navigation", () => {
|
||||
assert.match(viewer, /const _imageViewerState = \{ lightbox: false, meta: false \}/);
|
||||
assert.match(viewer, /let _imageViewerNavPending = false/);
|
||||
// Both navigation paths flag the next render as an image→image navigation.
|
||||
assert.match(viewer, /_imageViewerNavPending = true;\s*\n\s*openFile\(vault, siblings\[next\]\.path\)/);
|
||||
assert.match(viewer, /_imageViewerNavPending = true;\s*\n\s*openFile\(vault, s\.path\)/);
|
||||
// renderFile resets the state only when the next render is not a carried-over image.
|
||||
assert.match(viewer, /if \(!data\.is_image \|\| !_imageViewerNavPending\)/);
|
||||
// The persisted state drives the container class and the panel visibility.
|
||||
assert.match(viewer, /classList\.toggle\("lightbox", _imageViewerState\.lightbox\)/);
|
||||
assert.match(viewer, /metaPanel\.hidden = !_imageViewerState\.meta/);
|
||||
});
|
||||
|
||||
// ── Static checks: CSS ─────────────────────────────────────────────────────
|
||||
test("style.css defines the image viewer layout + lightbox", () => {
|
||||
assert.match(css, /\.image-stage\s*\{/);
|
||||
@@ -101,6 +115,19 @@ test("style.css defines the image viewer layout + lightbox", () => {
|
||||
assert.match(css, /\.image-viewer-container\.lightbox\s*\{/);
|
||||
});
|
||||
|
||||
// BUG-072 — metadata is a right-hand sidebar, not a strip under the filmstrip,
|
||||
// and it stays visible in lightbox mode.
|
||||
test("style.css lays the metadata panel out as a right sidebar", () => {
|
||||
assert.match(css, /\.image-viewer-body\s*\{[\s\S]*?display:\s*flex/);
|
||||
const meta = /\.image-meta-panel\s*\{([^}]*)\}/.exec(css);
|
||||
assert.ok(meta, ".image-meta-panel rule not found");
|
||||
assert.match(meta[1], /border-left:/);
|
||||
assert.doesNotMatch(meta[1], /border-top:/);
|
||||
// The lightbox hide rule targets the filmstrip only — not the metadata sidebar.
|
||||
assert.match(css, /\.image-viewer-container\.lightbox \.image-nav-strip\s*\{/);
|
||||
assert.doesNotMatch(css, /\.image-viewer-container\.lightbox[^{]*\.image-meta-panel/);
|
||||
});
|
||||
|
||||
// ── Static checks: icon mapping + backend ──────────────────────────────────
|
||||
test("utils.js maps image extensions to the Lucide 'image' icon", () => {
|
||||
assert.match(utils, /"\.png": "image"/);
|
||||
|
||||
@@ -121,6 +121,13 @@ test("now-playing exposes the public controller API and is initialised at boot",
|
||||
assert.match(app, /initNowPlaying\(\)/);
|
||||
});
|
||||
|
||||
test("video mini-window is freely positioned (no corner snapping)", () => {
|
||||
assert.doesNotMatch(np, /nearestCorner/);
|
||||
assert.match(np, /function clampToViewport/);
|
||||
assert.match(np, /left: Math\.round\(r\.left\),\s*\n\s*top: Math\.round\(r\.top\)/);
|
||||
assert.match(np, /bindVideoDrag\(dock\);/);
|
||||
});
|
||||
|
||||
// ── Static checks: CSS ─────────────────────────────────────────────────────
|
||||
test("style.css defines the media viewers and the Now Playing dock", () => {
|
||||
assert.match(css, /\.audio-viewer-container/);
|
||||
@@ -131,6 +138,11 @@ test("style.css defines the media viewers and the Now Playing dock", () => {
|
||||
assert.match(css, /body\.np-active \.content-area/);
|
||||
});
|
||||
|
||||
test("mobile dock uses a grid so actions never overlap the progress bar", () => {
|
||||
assert.match(css, /grid-template-areas:\s*\n\s*"progress progress progress progress"/);
|
||||
assert.match(css, /\.np-dock--audio \[data-np="expand"\]/);
|
||||
});
|
||||
|
||||
test("style.css no longer references undefined --surface1 / --text-dim vars", () => {
|
||||
assert.doesNotMatch(css, /var\(--surface1\)/);
|
||||
assert.doesNotMatch(css, /var\(--text-dim\)/);
|
||||
|
||||
Reference in New Issue
Block a user