Skip to content

fix(floating-mascot) : la grappe reste hors du Dock et de la barre des tâches - #448

Merged
jencryzthers merged 4 commits into
mainfrom
fix/floating-mascot-dock
Oct 14, 2026
Merged

jencryzthers merged 4 commits into
mainfrom
fix/floating-mascot-dock

Conversation

@jencryzthers

@jencryzthers jencryzthers commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Corps réécrit (le champ Description de la PR n’est pas remplaçable ici). Le sommeil est dans #454.

Résumé

La mascotte flottante, et la pastille qui pend à ses pieds (saisie rapide ou appel), restent dans la zone de travail de l’écran : jamais sous le Dock macOS (bas, gauche, droite, masquage automatique), jamais sous la barre des tâches Windows, jamais sous un panneau Linux qu’Electron reporte dans workArea.

Le sommeil de la mascotte n’est plus dans cette PR. Il est dans #454

Comportement

  • La page rapporte la pastille avec la boîte du personnage (keep). Le processus principal garde leur union dans workArea, pas dans bounds, à chaque pas du glisser, à la fin du glisser, à l’ouverture de la pastille, au branchement ou au redimensionnement d’un écran, et à l’affichage.
  • Quand le Dock (ou la barre) est juste sous les pieds, la pastille passe au-dessus de la tête (pillSide).
  • Si la mascotte et sa pastille dépassent la zone de travail (union trop haute ou trop large), le personnage reste dedans ; la pastille peut déborder.

Compatibilité ascendante

Les places par configuration d’écrans restent dans floating-bot-positions.json, 32 clés, le même {x, y, v: 2} qu’une ancienne version lit avec slice(0, 32).

Les places par écran vont dans un autre fichier, floating-bot-display-spots.json, 64 clés. On ne mélange pas de display:… dans la table des configurations, et on ne monte pas le plafond de 32 à 64 : une ancienne version qui lit slice(0, 32) verrait autrement les display:… à la place des vraies configurations.

Au chargement, une clé display:… laissée dans l’ancien fichier mixte est extraite, recopiée dans la table d’écrans, puis purgée.

La clé d’écran est id@origine (DIP), sans largeur, sans hauteur, sans facteur d’échelle. Un changement de résolution ou d’échelle sur le même écran retrouve la place ; le coin est ensuite recalé dans la nouvelle zone de travail.

Linux

Même pince sur workArea. Le clic traverse reste éteint (un compositeur Linux ne transmet pas les mouvements du pointeur à travers une fenêtre ignorée).

Si le gestionnaire de fenêtres reporte workArea === bounds (aucun retrait pour le panneau), on pince au cadre entier : le panneau n’est alors pas évité, parce qu’Electron ne le nomme pas. C’est le même contrat que pour un Dock en masquage automatique dont la zone de travail remplit presque le cadre.

Preuve

Les tests de cette PR, posés sur origin/main (e36f6f6f5, sans clampClusterToDisplays / pillSide / purge display:) :

Bloc Rouge 1 — grappe

pnpm exec vitest run electron/floating-bot-cluster.test.mjs --reporter=verbose
 RUN  v5.0.3 /tmp/sagax-main-red

 × electron/floating-bot-cluster.test.mjs > the floating cluster stays in the work area > grows the kept box by the pill, above or below the character 12ms
   → clusterBox is not a function
 × … never lets the pill go under a Dock at the bottom: the cluster rises above it
   → clampClusterToDisplays is not a function
 × … keeps the cluster off a Dock on the left or on the right
   → clampClusterToDisplays is not a function
 × … with the Dock hidden automatically, uses the whole frame under the menu bar
   → clampClusterToDisplays is not a function
 × … keeps it above a Windows taskbar the same way
   → clampClusterToDisplays is not a function
 × … on several displays, keeps it on the one it stands on, else the nearest
   → clampClusterToDisplays is not a function
 × … when the mascot and its pill do not fit the work area, keeps the character inside
   → clampClusterToDisplays is not a function
 × … brings the cluster back above the Dock when the pill opens past it, and keeps it there on drag end
   → clusterBox is not a function
 × … a pill over the head near the Dock moves nothing; one that closes stops counting
   → clusterBox is not a function
 × … puts the cluster back in when the Dock grows or a display goes (display-metrics-changed, display-removed)
   → clusterBox is not a function
 × … on show, a spot saved under the Dock comes back inside the work area
   → clusterBox is not a function
 × … when the mascot and its pill overflow the work area, the character stays inside
   → clusterBox is not a function
 × … names the display a point is on by its id and origin, not its size
   → displayKeyAt is not a function
 × … keeps the identity across a scale or resolution change
   → displayIdentity is not a function
 × … saves the spot for the setup and for the display in two tables, and an older file still reads
   → Cannot read properties of undefined (reading '2@1440,0')
 × … brings a bot back to its spot on a display that is still there when the setup changed
   → expected { x: 1064, y: 90, width: 352, …(1) } to match object { x: 300, y: 100 }
 × … after a scale or resolution change, restores the display spot and clamps it to the new work area
   → clusterBox is not a function
 × … prefers the exact setup, then the latest display spot
   → savedSpotFor is not a function
 × … une ancienne version relit une table pleine
   → expected [ '0,0,1440x900|1440,0,1920x1080' ] to have a length of undefined but got 1
 × … mixing display: keys into the setups table would starve an older slice(0, 32) reader
   → expected false to be true // Object.is equality
 × … purges mixed display: keys on load and maps a leaked frame onto today's identity
   → displayIdentityFromLegacyKey is not a function
 × Linux > stays clickable (no click-through) and keeps the cluster above a panel in workArea
   → clusterBox is not a function
 × Linux > when the compositor reports workArea equal to bounds, clamps to that full frame
   → clampClusterToDisplays is not a function

 FAIL  … une ancienne version relit une table pleine
AssertionError: expected [ '0,0,1440x900|1440,0,1920x1080' ] to have a length of undefined but got 1
 ❯ electron/floating-bot-cluster.test.mjs:394:42
    expect(Object.keys(saved.positions)).toHaveLength(SETUP_POSITIONS_…

 FAIL  … mixing display: keys into the setups table would starve an older slice(0, 32) reader
AssertionError: expected false to be true // Object.is equality
 ❯ electron/floating-bot-cluster.test.mjs:407:81

 FAIL  … brings a bot back to its spot on a display that is still there when the setup changed
AssertionError: expected { x: 1064, y: 90, … } to match object { x: 300, y: 100 }
-   "x": 300, "y": 100
+   "x": 1064, "y": 90

 Test Files  1 failed (1)
      Tests  23 failed (23)
   Duration  1.46s

Bloc Rouge 2 — pastille + table des positions

pnpm exec vitest run src/components/floating-bots/placement.test.ts electron/floating-bot-window.test.mjs --reporter=verbose
 RUN  v5.0.3 /tmp/sagax-main-red

 FAIL  electron/floating-bot-window.test.mjs > floating bots: positions and screens > drops malformed saved positions
AssertionError: expected { 'display:1@0,0': { …(1) }, …(1) } to deeply equal { Object (sig) }

- Expected
+ Received
@@ -1,6 +1,13 @@
  {
+   "display:1@0,0": {
+     "bot_a": { "v": 2, "x": 1, "y": 2 },
+   },
    "sig": {
      "bot_a": { "v": 2, "x": 3, "y": 4 },
 ❯ electron/floating-bot-window.test.mjs:577:135
    expect(sanitizePositions({ "display:1@0,0": { bot_a: { x: 1, y: 2,…

 FAIL  src/components/floating-bots/placement.test.ts > the input pill around the Dock and the taskbar > sits under the feet when there is room, over the head when the work area ends there
TypeError: pillSide is not a function
 ❯ src/components/floating-bots/placement.test.ts:138:12
    expect(pillSide({ body: body(800, 600), workArea: AREA })).toBe("b…

 FAIL  src/components/floating-bots/placement.test.ts > the input pill around the Dock and the taskbar > reaches layoutFor: over the head in the bottom-right corner
AssertionError: expected undefined to be 'below' // Object.is equality
- Expected: "below"
+ Received: undefined
 ❯ src/components/floating-bots/placement.test.ts:154:71
    expect(layoutFor({ workArea: AREA, body: body(800, 600) })!.pill).…

 Test Files  2 failed (2)
      Tests  3 failed | 81 passed (84)
   Duration  4.55s

Vert

Commande, ici, après les correctifs :

pnpm exec vitest run electron/floating-bot-cluster.test.mjs electron/floating-bot-window.test.mjs src/components/floating-bots/placement.test.ts --reporter=verbose

Résultat :

 Test Files  3 passed (3)
      Tests  107 passed (107)
   Duration  2.78s

Tests ajoutés ou resserrés (tous verts dans la même passe) :

  • when the mascot and its pill do not fit the work area, keeps the character inside
  • when the mascot and its pill overflow the work area, the character stays inside
  • keeps the identity across a scale or resolution change
  • after a scale or resolution change, restores the display spot and clamps it to the new work area
  • une ancienne version relit une table pleine
  • mixing display: keys into the setups table would starve an older slice(0, 32) reader
  • purges mixed display: keys on load and maps a leaked frame onto today's identity
  • Linux > stays clickable (no click-through) and keeps the cluster above a panel in workArea
  • Linux > when the compositor reports workArea equal to bounds, clamps to that full frame
  • the input pill around the Dock and the taskbar (placement)

pnpm lint, pnpm typecheck et pnpm i18n:check ont passé au git push (crochet pre-push).

Pas de captures macOS/Windows d’un Electron réel dans cet environnement : le banc ci-dessus pince workArea (Dock, barre, panneau) sans lancer l’appli.

Checklist

  • pnpm typecheck passe (crochet pre-push)
  • Tests du placement flottant passent (107)
  • pnpm test complet (suite ~45 min, volontairement hors du crochet)
  • Pas d’édition de dist-server/
  • Linux traité (comportement + tests)
  • Pas de secret

Jean-Christophe Proulx and others added 4 commits October 13, 2026 13:10
Sleep (every character, crab first):
- sleep.ts mascotAsleep: the nap or the brain's sleep pose while resting
  (never dragged, walking or flying); the stage carries data-asleep.
- Shared layer: dimmed character, bold outlined floating "z Z" beside the
  head; reduced motion shows a static "z Z" and keeps the closed eyes.
- Crab: new "asleep" face (closed eyes as a 4x1 dash, never blinked away),
  sleep move breathes one whole cell over 4.2 s; CSS avatars match.

Floating cluster:
- The page reports the pill (quick input or call) with the character's
  box (setBody(rect, keep)); main keeps their union inside the display
  workArea on drag steps, drag end, pill open, display-added/removed/
  metrics-changed and on show (Dock bottom/left/right, auto-hide, taskbar).
- pillSide: the pill goes over the head when the Dock is right under the
  feet, the reply bubble stacked above it.
- Positions also kept per display (display:<frame>, with t) beside the
  per-setup entry (unchanged shape, older builds still read it).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keep the floating-mascot dock work current with main before splitting sleep out.

Co-authored-by: Jean-Christophe Proulx <j.christophe@devjc.net>
PR #448 keeps the cluster off the Dock and the taskbar. Unmistakable sleep
moves to cursor/floating-mascot-sleep-ff5b.

Co-authored-by: Jean-Christophe Proulx <j.christophe@devjc.net>
Per-display spots go in floating-bot-display-spots.json, keyed by
id@origin so a scale or resolution change still finds them. The setups
file stays at 32 keys, the shape an older slice(0, 32) still reads.
A mixed display: key is purged on load. When the cluster does not fit
the work area, the character stays inside. Linux uses workArea and
stays clickable.
@cursor cursor Bot changed the title fix(floating-mascot) : sommeil évident, grappe gardée hors du Dock fix(floating-mascot) : la grappe reste hors du Dock et de la barre des tâches Oct 14, 2026
@pulsatrixtechnologies pulsatrixtechnologies deleted a comment from cursor Bot Oct 14, 2026
@jencryzthers
jencryzthers marked this pull request as ready for review October 14, 2026 12:23
@jencryzthers
jencryzthers merged commit c0333db into main Oct 14, 2026
10 of 16 checks passed
@jencryzthers
jencryzthers deleted the fix/floating-mascot-dock branch October 14, 2026 12:23
cursor Bot pushed a commit that referenced this pull request Oct 14, 2026
Keep both the dock cluster placement from #448 and the sleep glyphs.
jencryzthers added a commit that referenced this pull request Oct 14, 2026
Sleep (every character, crab first):
- sleep.ts mascotAsleep: the nap or the brain's sleep pose while resting
  (never dragged, walking or flying); the stage carries data-asleep.
- Shared layer: dimmed character, bold outlined floating "z Z" beside the
  head; reduced motion shows a static "z Z" and keeps the closed eyes.
- Crab: new "asleep" face (closed eyes as a 4x1 dash, never blinked away),
  sleep move breathes one whole cell over 4.2 s; CSS avatars match.

Placement off the Dock lives on fix/floating-mascot-dock (PR #448).

Co-authored-by: Cursor Agent <cursoragent@users.noreply.github.com>
jencryzthers added a commit that referenced this pull request Oct 14, 2026
## Quoi

Bump de version, comme #421 pour 0.5.1 :

- `package.json` : `forkVersion` 0.5.2
- `ios/project.yml` : `MARKETING_VERSION` 0.5.2 (même version que le
desktop), `CURRENT_PROJECT_VERSION` 30, sur les quatre cibles
- `docs/releases/0.5.2.md` : notes complètes FR et EN (affichées dans
l'app avant et après la mise à jour), qui complètent celles de #458 avec
tout ce qui est entré depuis 0.5.1 : voix (#427, #435, #422/#424, #450,
#451, #458), démarrage serveur (#433, #460), approbations (#455),
modèles (#462, #466), sandboxes Kubernetes (#463, #465), image Docker
(#436, #444, #456), sécurité (#445), interface (#423, #425, #448, #454,
#461)
- `src/lib/bundled-release-notes.test.ts` : vérifie les nouvelles
entrées

NE PAS fusionner sans le GO de JC : la fusion sur main (changement de
`package.json`) lance `release.yml`.

## Prérequis avant la release

- Créer le secret de dépôt `TRIVYIGNORE_PRIVATE` (#456) : absent ou
vide, `docker.yml` échoue fermé sur le tag.

## Tests locaux (candidat, Node 26.11, macOS)

- `pnpm test:unit` : 8 shards, 1474 fichiers, exit 0
- `pnpm exec vitest run src/lib/bundled-release-notes.test.ts` : exit 0
- `pnpm test:shards` (tous les groupes) lancé avant #466 : exit 1. Les
échecs déterministes sont corrigés par #466 ; restent des e2e qui
passent seuls (charge des 8 shards) et
`server/codex-review.e2e.test.ts`, qui échoue sur ce Mac aussi au tag
`pulsa-v0.5.1` (Node 24 et 26).
- Tests Swift non lancés.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Jean-Christophe Proulx <jencryzthers@Jean-Christophes-Macbook-Pro.local>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants