Compare commits

...
5 Commits
Author SHA1 Message Date
williamandClaude Sonnet 5 037faa72f0 docs: update stale paths and fixed-issue notes after monorepo move
CI / quality (pull_request) Successful in 11m52s
- Checklist_Mise_En_Production.md: note that npm commands run from
  Max Avatar/; refreshed the coverage and npm audit notes, which still
  described the pre-fix state (24% coverage, unresolved image-size
  vulnerability) even though both were resolved earlier this session.
- Reste_A_Faire_CICD.md: same working-directory note.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-31 12:23:40 +01:00
williamandClaude Sonnet 5 1c2f002eb3 refactor: move app code into Max Avatar/ subfolder (monorepo prep for backend)
Step 1 of adding a backend proxy server (API keys held server-side instead
of shipped in the installer). Moves everything app-specific into
"Max Avatar/" via git mv (preserves history): src/, tests/, scripts/,
assets/, build/, resources/, package.json/-lock.json, electron-builder.yml,
electron.vite.config.ts, eslint.config.mjs, playwright.config.ts,
vitest.config.mts, sonar-project.properties, tsconfig*.json, Dockerfile,
.editorconfig/.env*/.gitignore/.prettier*.

CLAUDE.md, README.md, docs/, .claude/, .gitea/, .husky/, .vscode/, and the
docker-compose files stay at the repo root, since they'll apply to both the
app and the future backend.

No application code needed changes (all its internal paths are relative to
its own tree). Adjusted what referenced the old root from outside:
- .husky/pre-commit: cd into "Max Avatar" before lint-staged
- .gitea/workflows/*.yml: working-directory + cache-dependency-path +
  artifact paths + SonarQube projectBaseDir
- docker-compose.yml: build context -> ./Max Avatar
- Max Avatar/Dockerfile: node:20-alpine -> node:24-alpine (same node:sqlite
  issue already fixed elsewhere, never applied here before)
- .vscode/launch.json, README.md: updated paths/instructions

Verified from Max Avatar/ after the move: npm ci, typecheck, lint,
test:coverage (473/473, same coverage numbers), build, and dev all work
unchanged.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-31 12:15:30 +01:00
williamandClaude Sonnet 5 60e2fb26af fix: avatar texture/TTS audio broken in packaged build, allow multiple instances
Found by testing the first real Windows installer build end-to-end:

- electron-builder.yml: `publisherName` under `win` is invalid in
  electron-builder 26.x (moved under `win.signtoolOptions`), which made
  `npm run build:win` fail validation entirely. Removed (no code signing
  configured, so it wasn't doing anything anyway).
- index.ts: the production-only CSP header (added on top of index.html's own
  meta CSP, only active when !is.dev) was missing `blob:` in img-src and had
  no media-src directive at all. The GLB avatar's embedded textures and
  ElevenLabs TTS playback both go through
  `URL.createObjectURL(new Blob(...))`, so both silently failed in the
  packaged app while working fine in dev (dev skips this header entirely).
  Avatar rendered untextured, no audio played.
- index.ts: added `app.requestSingleInstanceLock()` + a `second-instance`
  handler. Without it, every click on the desktop shortcut launched another
  full instance (own window, own SQLite connections, own review scheduler),
  which the installed app visibly allowed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-31 11:55:40 +01:00
williamandClaude Sonnet 5 9a66ff7f17 fix(ci): trigger only on pull_request, the only point that can still block a merge
A push to develop/main runs after the fact for direct pushes, and a push to
main specifically only happens once Gitea has already created the merge
commit — too late to gate anything. The only trigger that runs before the
"Merge" button becomes clickable is pull_request. Simplifies the previous
push-only setup (which technically also worked via SHA-based status checks,
but was confusing to reason about) down to the one trigger that matches
intent directly.

Note: the required status check name on main's branch protection will need
updating in the Gitea UI to match the new context (something like
"CI / quality (pull_request)" instead of "CI / quality (push)").

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-31 11:03:24 +01:00
williamandClaude Sonnet 5 478ffa59ce fix(ci): remove redundant pull_request trigger
Every push to develop (with the develop->main PR open) fired two identical
CI runs: one from push, one from pull_request synchronize. Branch protection
on main checks the exact commit SHA's status regardless of which event
produced it, and the required check is literally named "CI / quality (push)"
— so the push-triggered run alone already gates the merge. Dropping the
pull_request trigger removes the duplicate without changing what's enforced.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-31 10:59:20 +01:00
225 changed files with 160 additions and 27 deletions
+10 -3
View File
@@ -1,14 +1,20 @@
name: CI
on:
push:
branches: [develop, main]
# Tourne uniquement sur la Pull Request, avant le clic sur "Merge" (seul moment ou un check peut
# encore bloquer la fusion). Un "push" sur main declenche par le merge lui-meme arriverait trop
# tard pour bloquer quoi que ce soit.
pull_request:
branches: [develop, main]
branches: [main]
jobs:
quality:
runs-on: ubuntu-latest
# Le code de l'app vit dans le sous-dossier "Max Avatar" (la racine du depot garde CLAUDE.md,
# README.md, docs/, .gitea/, .husky/, .vscode/, .claude/, docker-compose*.yml).
defaults:
run:
working-directory: Max Avatar
steps:
- uses: actions/checkout@v4
@@ -21,6 +27,7 @@ jobs:
# la transformation plante avec "Cannot bundle Node.js built-in node:sqlite".
node-version: '24'
cache: 'npm'
cache-dependency-path: 'Max Avatar/package-lock.json'
- name: Install dependencies
run: npm ci --ignore-scripts
+12 -3
View File
@@ -8,6 +8,9 @@ on:
jobs:
build-windows:
runs-on: windows-latest
defaults:
run:
working-directory: Max Avatar
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
@@ -19,10 +22,13 @@ jobs:
- uses: actions/upload-artifact@v4
with:
name: max-windows
path: dist/*.exe
path: Max Avatar/dist/*.exe
build-mac:
runs-on: macos-latest
defaults:
run:
working-directory: Max Avatar
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
@@ -34,10 +40,13 @@ jobs:
- uses: actions/upload-artifact@v4
with:
name: max-mac
path: dist/*.dmg
path: Max Avatar/dist/*.dmg
build-linux:
runs-on: ubuntu-latest
defaults:
run:
working-directory: Max Avatar
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
@@ -49,4 +58,4 @@ jobs:
- uses: actions/upload-artifact@v4
with:
name: max-linux
path: dist/*.AppImage
path: Max Avatar/dist/*.AppImage
+6
View File
@@ -11,6 +11,9 @@ jobs:
sonarqube:
runs-on: ubuntu-latest
if: ${{ secrets.SONAR_TOKEN != '' }}
defaults:
run:
working-directory: Max Avatar
steps:
- uses: actions/checkout@v4
with:
@@ -21,6 +24,7 @@ jobs:
with:
node-version: '24'
cache: 'npm'
cache-dependency-path: 'Max Avatar/package-lock.json'
- name: Install dependencies
run: npm ci --ignore-scripts
@@ -30,6 +34,8 @@ jobs:
- name: SonarQube analysis
uses: sonarsource/sonarqube-scan-action@master
with:
projectBaseDir: Max Avatar
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
+1 -1
View File
@@ -1 +1 @@
npx lint-staged
cd "Max Avatar" && npx lint-staged
+4 -4
View File
@@ -5,10 +5,10 @@
"name": "Debug Main Process",
"type": "node",
"request": "launch",
"cwd": "${workspaceRoot}",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron-vite",
"cwd": "${workspaceRoot}/Max Avatar",
"runtimeExecutable": "${workspaceRoot}/Max Avatar/node_modules/.bin/electron-vite",
"windows": {
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron-vite.cmd"
"runtimeExecutable": "${workspaceRoot}/Max Avatar/node_modules/.bin/electron-vite.cmd"
},
"runtimeArgs": ["--sourcemap"],
"env": {
@@ -20,7 +20,7 @@
"port": 9222,
"request": "attach",
"type": "chrome",
"webRoot": "${workspaceFolder}/src/renderer",
"webRoot": "${workspaceFolder}/Max Avatar/src/renderer",
"timeout": 60000,
"presentation": {
"hidden": true
+3 -1
View File
@@ -1,4 +1,6 @@
FROM node:20-alpine AS base
# node:sqlite (coachStore.ts, memory/store.ts, meetingStore.ts) exige Node >= 22.5, mais
# Vite/Rolldown ne le reconnaissent comme built-in qu'a partir de Node 24.
FROM node:24-alpine AS base
WORKDIR /app
COPY package*.json ./
RUN npm ci --ignore-scripts

Before

Width:  |  Height:  |  Size: 121 KiB

After

Width:  |  Height:  |  Size: 121 KiB

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

@@ -17,7 +17,6 @@ win:
target:
- target: nsis
arch: [x64]
publisherName: Vandal William
nsis:
artifactName: ${productName}-Setup-${version}.${ext}
shortcutName: ${productName}
View File

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

@@ -32,6 +32,21 @@ import { startAutoUpdater } from './updater'
let mainWindow: BrowserWindow | null = null
// Empeche de lancer plusieurs instances de Max en parallele (chaque instance ouvrirait sa propre
// fenetre avatar, son propre acces concurrent a la base SQLite et son propre planificateur de
// revisions) : le second lancement se ferme immediatement et reactive la fenetre existante.
if (!app.requestSingleInstanceLock()) {
app.quit()
process.exit(0)
}
app.on('second-instance', () => {
if (!mainWindow) return
if (mainWindow.isMinimized()) mainWindow.restore()
mainWindow.show()
mainWindow.focus()
})
function switchMode(next: Mode): void {
setMode(next)
if (next === 'coach') startVisionCapture()
@@ -146,9 +161,12 @@ app
responseHeaders: {
...details.responseHeaders,
'Content-Security-Policy': [
// img-src/media-src incluent blob: : le GLB de l'avatar (textures) et les reponses
// audio ElevenLabs (TTS) sont tous deux lus via URL.createObjectURL(new Blob(...)),
// sans ca le modele reste sans texture et l'audio ne joue pas en production.
"default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; " +
"img-src 'self' data:; font-src 'self' data:; worker-src 'self' blob:; " +
"connect-src 'self' https://api.elevenlabs.io https://openrouter.ai"
"img-src 'self' data: blob:; media-src 'self' blob:; font-src 'self' data:; " +
"worker-src 'self' blob:; connect-src 'self' https://api.elevenlabs.io https://openrouter.ai"
]
}
})

Some files were not shown because too many files have changed in this diff Show More