@roomi-fields/grillhouse 0.28.0 → 0.28.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,5 +5,5 @@
5
5
  "author": {
6
6
  "name": "Romain Peyrichou"
7
7
  },
8
- "version": "0.28.0"
8
+ "version": "0.28.2"
9
9
  }
@@ -142,11 +142,15 @@ circuit ne lit pas, tombé à la relecture après 25 min de passes finales).
142
142
  engendré se réécrit par sa commande, puis le circuit rejoue seulement ce qui en dépend. Une passe
143
143
  finale dont un rouge est celui d'une référence, mêlé ou non à d'autres, régénère les références
144
144
  qu'il nomme (4.2), puis rejoue la passe finale restreinte à ce que la régénération change ; les
145
- autres rouges restent, chacun à son propriétaire. Des contrôles du plan verts hors des rouges de
146
- références les régénèrent aussitôt, comme make refait un fichier engendré avant ce qui le lit :
147
- la passe finale due joue alors une fois, sur l'arbre régénéré, sans régénérer de nouveau une
148
- référence régénérée sur ce même arbre (BP 320.3.9 : le plafond des mots, rouge aux contrôles,
149
- laissé à une passe finale qui rejouait les mêmes tests sur le même arbre, 6,1 min). Les références sont celles que le projet déclare
145
+ autres rouges restent, chacun à son propriétaire. Des contrôles du plan où rougit une référence,
146
+ mêlée ou non à d'autres rouges, la régénèrent avant qu'aucun rouge n'aille au développeur, comme
147
+ Bazel construit une genrule avant les tests qui la lisent : mêlés à d'autres rouges, les contrôles
148
+ du plan rejouent sur l'arbre régénéré, qui juge un test lisant la référence (BP 320.6.5 : un test
149
+ qui lit le hachage que déclarent les `turbo.json`, rouge à côté de leur garde, envoyé à un
150
+ développeur qui n'avait rien à livrer, puis ne pouvait pas les écrire) ; seuls, la passe finale
151
+ due joue une fois, sur l'arbre régénéré. Aucune ne régénère de nouveau une référence régénérée
152
+ sur ce même arbre (BP 320.3.9 : le plafond des mots, rouge aux contrôles, laissé à une passe
153
+ finale qui rejouait les mêmes tests sur le même arbre, 6,1 min). Les références sont celles que le projet déclare
150
154
  (`grillhouse.references`) et celles du cadre, dans chaque projet (`referencesDuCadre` de
151
155
  `circuit.mjs`, les fichiers que le module du langage engendre, `fichiersEngendres`) : l'index des
152
156
  interfaces, les `turbo.json` des paquets et les rapports d'API, chacun
@@ -285,6 +289,18 @@ commande, vaut `comportement` : le circuit entier. Ainsi un geste sans comportem
285
289
  ni testwriter ni développeur (BP 320.16 : 38 outils déplacés par mv, 117 commentaires ; 320.40.1 :
286
290
  une variable inutilisée, 4 séances ; si61.8 : un seuil 77 → 95, 2 séances « aucun code à livrer »).
287
291
 
292
+ **Le plan fixe les noms publiés** : comme l'approbation d'un propriétaire de code (CODEOWNERS)
293
+ porte sur ce qu'il a relu, la fiche du plan porte les noms qu'un composant publie à un autre et
294
+ que le lot ajoute aux lignes « Consommateurs » de l'INTERFACE du fournisseur (`noms_publies` de
295
+ `resultats.mjs` : le fournisseur, chaque consommateur, ses noms). Le circuit les écrit dans la
296
+ description (« ## Noms publiés », après la sorte), réécrite à chaque plan depuis la dernière fiche
297
+ (une liste vide l'efface ; une fiche sans le champ garde la section que la description porte,
298
+ celle qu'un superviseur a écrite à la main comprise), et la garde des consommateurs (`consommateurs-arbitres.mjs`), qui lit cette section, laisse entrer
299
+ ces lignes sans arbitrage ; un nom que le plan ne publie pas reste refusé. Ainsi le développeur
300
+ écrit les lignes que le plan fixe sans arrêt ni geste du superviseur (BP 320.14.2.10, 320.28,
301
+ 320.6.5 : un critère seul nommait les noms, la garde refusait le lot, et le superviseur écrivait
302
+ la section à la main avant une nouvelle séance).
303
+
288
304
  **Un circuit par ticket** : comme une demande de fusion (un auteur, une série de tests et de
289
305
  code, une CI sur l'ensemble, une revue), le circuit lance un seul testwriter et un seul
290
306
  développeur pour tout le ticket, chacun dans l'enveloppe de tous les paquets du plan, puis la
@@ -13,7 +13,11 @@ import type { Etat, Fiche, Ligne, Tableau } from '../types'
13
13
  // the SDK without a display): the board comes with the terminal's prompt, or with a surface that
14
14
  // attaches, as the desktop app's Code tab does (`activer`). In a Grillhouse project, every
15
15
  // session, an agent's copy included, has a Bash command that starts with cd refused, with the
16
- // form to take (`env -C`, `git -C`).
16
+ // form to take (`env -C`, `git -C`). A session that coordinates several projects adds them to its
17
+ // pane (`/grillhouse ajouter <chemin>`, `/grillhouse retirer <chemin>`), as a multi-root workspace
18
+ // of VS Code lists its folders: the list is kept for the session's folder in the mod's store, and
19
+ // the frame's command measures their board as one (`grillhouse tableau <dossier>…`), which the
20
+ // pane draws as it draws one project's.
17
21
  const PANE = 'grillhouse'
18
22
  // The frame's command, which the project's `npm install` links, and its package.
19
23
  const GRILLHOUSE = 'node_modules/.bin/grillhouse'
@@ -56,12 +60,14 @@ const etat = atom({ plugin: 'grillhouse', key: 'etat' } as const, {
56
60
  tableau: null,
57
61
  erreur: null,
58
62
  lu: 0,
63
+ revision: 0,
59
64
  choisi: null,
60
65
  element: null,
61
66
  grand: false,
62
67
  vue: 'tableau',
63
68
  groupe: null,
64
69
  texte: null,
70
+ projets: [],
65
71
  } as Etat)
66
72
 
67
73
  export const k = (n: number) =>
@@ -130,10 +136,38 @@ export const defiler = (avant: number, by: number, n: number, rangs: number) =>
130
136
  // A line the pane lists, the key of its Button and `i`, its index in the lines shown.
131
137
  export type Visible = { l: Ligne; cle: string | null; i: number }
132
138
 
133
- // The lines the pane lists, each with the key of its Button: `<ticket>:<i>` for a ticket's line,
134
- // `>:<i>` for a folded group's title, none for a plain line.
139
+ // The lines the pane lists, each with the key of its Button: `<ticket>:<n>` for the n-th line of a
140
+ // ticket (from 0), `>:<groupe>` for a folded group's title, none for a plain line. A key names its
141
+ // line by what it shows, never by its place, as React's keys do: a new measure that adds lines
142
+ // above keeps the key the ring holds.
135
143
  export function visibles(lignes: Ligne[]): Visible[] {
136
- return lignes.map((l, i) => ({ l, cle: l.ticket ? `${l.ticket}:${i}` : l.groupe ? `>:${i}` : null, i }))
144
+ const vus = new Map<string, number>()
145
+ return lignes.map((l, i) => {
146
+ if (l.ticket) {
147
+ const n = vus.get(l.ticket) ?? 0
148
+ vus.set(l.ticket, n + 1)
149
+ return { l, cle: `${l.ticket}:${n}`, i }
150
+ }
151
+ return { l, cle: l.groupe ? `>:${l.groupe}` : null, i }
152
+ })
153
+ }
154
+
155
+ // A computation kept from its last inputs, as React's useMemo keeps it from its dependencies:
156
+ // called with the same dependencies (each the same value; by default every argument), it gives
157
+ // the last result again without computing it.
158
+ export function memoire<A extends unknown[], R>(
159
+ calcul: (...a: A) => R,
160
+ dependances: (...a: A) => unknown[] = (...a) => a,
161
+ ): (...a: A) => R {
162
+ let dernier: { d: unknown[]; r: R } | null = null
163
+ return (...a: A) => {
164
+ const d = dependances(...a)
165
+ const avant = dernier
166
+ if (avant && avant.d.length === d.length && d.every((x, j) => Object.is(x, avant.d[j]))) return avant.r
167
+ const r = calcul(...a)
168
+ dernier = { d, r }
169
+ return r
170
+ }
137
171
  }
138
172
 
139
173
  // The first of `n` lines to show in `rangs` rows: the window stays where it was (`avant`) while the
@@ -195,37 +229,81 @@ export const aMesurer = (s: Etat, maintenant: number) =>
195
229
  export const couleur = (ton: Ligne['ton']) =>
196
230
  ton === 'alerte' ? 'red' : ton === 'attention' ? 'yellow' : ton === 'actif' ? 'cyan' : undefined
197
231
 
232
+ // The key of the mod's store that keeps the projects a session in <dossier> shows beside its own.
233
+ export const cleProjets = (dossier: string) => `projets:${dossier}`
234
+
235
+ // The folder <chemin> names from the session's folder <dossier>: absolute, `~/` under the home
236
+ // <maison>, or relative; its `.` and `..` resolved, no slash at its end.
237
+ export function dossierDe(chemin: string, dossier: string, maison = ''): string {
238
+ const brut = chemin.startsWith('/')
239
+ ? chemin
240
+ : chemin === '~' || chemin.startsWith('~/')
241
+ ? `${maison}${chemin.slice(1)}`
242
+ : `${dossier}/${chemin}`
243
+ const parts: string[] = []
244
+ for (const p of brut.split('/')) {
245
+ if (!p || p === '.') continue
246
+ if (p === '..') parts.pop()
247
+ else parts.push(p)
248
+ }
249
+ return `/${parts.join('/')}`
250
+ }
251
+
198
252
  // The session's project, whether it is a Grillhouse project, whether the board applies to it, and
199
253
  // whether the board is on.
200
254
  let cwd = ''
201
255
  let projet = false
202
256
  let eligible = false
203
257
  let actif = false
204
- // The pane's window: its first line, the element it last followed, and the rows and focus it was
205
- // last drawn with. The wheel moves it; the ring moving to another line makes it follow.
258
+ // The pane's window: its first line, the element it last followed and that element's line, and
259
+ // the wheel's notches not drawn yet. The wheel moves it; the ring moving to another line makes it
260
+ // follow.
206
261
  let fenetre = 0
207
262
  let suivi: string | null = null
208
- let cadre = { rangs: 1, focus: false }
263
+ let ligneSuivie = -1
264
+ let crans: number[] = []
209
265
  // The whole card's window: the first row of its text shown, and, while it is drawn, the text's
210
266
  // rows and the rows it shows them in.
211
267
  let ligneTexte = 0
212
268
  let texteDessine: { n: number; rangs: number } | null = null
213
-
214
- // The lines the window runs over, every line of the board, the window placed on them: when the
215
- // ring has moved to another line since the window last followed it, the window follows it
216
- // (`debut`); it stays within the lines.
217
- function placer(s: Etat, rangs: number, focus: boolean): Visible[] {
218
- const liste = visibles(lignesDe(s))
219
- const ici = liste.findIndex(x => x.cle === s.element)
220
- if (focus && ici >= 0 && s.element !== suivi) {
269
+ // The lines the pane lists, kept until the board or the view changes.
270
+ const listeDe = memoire(
271
+ (s: Etat) => visibles(lignesDe(s)),
272
+ s => [s.revision, s.vue, s.groupe],
273
+ )
274
+ // The cards the pane has drawn, by their key, kept until the board, the width or the surface's
275
+ // elements change.
276
+ const cartesGardees = memoire(
277
+ (_revision: number, _colonnes: number, _elements: unknown) => new Map<string, JSX.Element>(),
278
+ )
279
+
280
+ // The lines the window runs over, every line of the board, the window placed on them. A board
281
+ // measured again keeps the followed line on its row, as a browser's scroll anchoring keeps the
282
+ // line in view where it was. When the ring has moved to another line since the window last
283
+ // followed it, the window follows it (`debut`). Then the wheel's notches move it, one by one,
284
+ // each within the lines.
285
+ function placer(liste: Visible[], element: string | null, rangs: number, focus: boolean): void {
286
+ const ici = liste.findIndex(x => x.cle === element)
287
+ if (focus && ici >= 0 && element === suivi && ligneSuivie >= 0) fenetre += ici - ligneSuivie
288
+ if (focus && ici >= 0 && element !== suivi) {
221
289
  // The ring's next stops: the nearest lines with a button, above and below.
222
290
  const avant = liste.slice(0, ici).findLastIndex(x => x.cle)
223
291
  const apres = liste.findIndex((x, j) => j > ici && x.cle)
224
292
  fenetre = debut(liste.length, ici, rangs, fenetre, avant < 0 ? ici - 1 : avant, apres < 0 ? ici + 1 : apres)
225
- suivi = s.element
293
+ suivi = element
226
294
  }
295
+ ligneSuivie = ici
227
296
  fenetre = Math.max(0, Math.min(fenetre, liste.length - rangs))
228
- return liste
297
+ for (const by of crans) fenetre = Math.max(0, Math.min(fenetre + by, liste.length - rangs))
298
+ crans = []
299
+ }
300
+
301
+ // Another view starts its window over: at its first line, following nothing, no notch kept.
302
+ function recommencer(): void {
303
+ fenetre = 0
304
+ suivi = null
305
+ ligneSuivie = -1
306
+ crans = []
229
307
  }
230
308
 
231
309
  // Measures the board again and redraws the pane.
@@ -265,14 +343,17 @@ async function bientot($: EngineInterface) {
265
343
  await rafraichir($)
266
344
  }
267
345
 
346
+ // The board, the session's project with the projects the pane shows beside it; a fault keeps the
347
+ // last board read. A board past what a process returns (4 MiB) or that does not parse is said,
348
+ // never thrown.
268
349
  async function mesurer($: EngineInterface) {
269
350
  if (!actif) return
270
- const r = await $.process.run([GRILLHOUSE, 'tableau'], { cwd, timeoutMs: 20_000 })
351
+ const { projets } = await read($, etat)
352
+ const r = await $.process.run([GRILLHOUSE, 'tableau', ...projets], { cwd, timeoutMs: 20_000 })
271
353
  if (r.exitCode !== 0) {
272
354
  await update($, etat, s => ({ ...s, erreur: r.stderr.slice(0, 300) }))
273
355
  return
274
356
  }
275
- // A board past what a process returns (4 MiB) or that does not parse is said, never thrown.
276
357
  let tableau: Tableau
277
358
  try {
278
359
  if (r.isStdoutTruncated) throw new Error('la sortie de grillhouse tableau dépasse 4 Mio')
@@ -281,13 +362,17 @@ async function mesurer($: EngineInterface) {
281
362
  await update($, etat, s => ({ ...s, erreur: `Tableau illisible : ${(err as Error).message}`.slice(0, 300) }))
282
363
  return
283
364
  }
284
- await update($, etat, s => ({ ...s, tableau, erreur: null, lu: Date.now() }))
365
+ await update($, etat, s => ({ ...s, tableau, erreur: null, lu: Date.now(), revision: (s.revision || 0) + 1 }))
285
366
  }
286
367
 
287
- // The whole text of a ticket, read from Beads when the card fills the pane: the board carries
288
- // only each card's start.
289
- async function lireTexte($: EngineInterface, id: string) {
290
- const r = await $.process.run(['bd', 'show', id, '--json'], { cwd, timeoutMs: 20_000 })
368
+ // The folder of the project the ticket <id> belongs to, which the board names beside the
369
+ // session's (`dossiers`); the session's otherwise.
370
+ const dossierDu = (t: Tableau | null, id: string) => t?.dossiers?.[id] ?? cwd
371
+
372
+ // The whole text of a ticket, read from Beads in its project when the card fills the pane: the
373
+ // board carries only each card's start.
374
+ async function lireTexte($: EngineInterface, id: string, dossier: string) {
375
+ const r = await $.process.run(['bd', 'show', id, '--json'], { cwd: dossier, timeoutMs: 20_000 })
291
376
  let contenu = ''
292
377
  try {
293
378
  const lu = JSON.parse(r.stdout) as { description?: string }[] | { description?: string }
@@ -301,13 +386,52 @@ async function lireTexte($: EngineInterface, id: string) {
301
386
  // The status a chantier's switch gives it: in progress → open, anything else → in progress.
302
387
  export const bascule = (statut: string | undefined) => (statut === 'in_progress' ? 'open' : 'in_progress')
303
388
 
304
- // Switches a chantier on or off in Beads, then measures the board again.
305
- async function basculer($: EngineInterface, id: string, statut: string | undefined) {
306
- const r = await $.process.run(['bd', 'update', id, '--status', bascule(statut)], { cwd, timeoutMs: 20_000 })
389
+ // Switches a chantier on or off in Beads, in its project, then measures the board again.
390
+ async function basculer($: EngineInterface, id: string, statut: string | undefined, dossier: string) {
391
+ const r = await $.process.run(['bd', 'update', id, '--status', bascule(statut)], {
392
+ cwd: dossier,
393
+ timeoutMs: 20_000,
394
+ })
307
395
  if (r.exitCode !== 0) await $.ui.toast(`Le chantier n'a pas basculé : ${r.stderr.slice(0, 200)}`)
308
396
  await rafraichir($)
309
397
  }
310
398
 
399
+ // The projects the store keeps for the session's folder; none when it holds nothing readable.
400
+ async function lireLaListe($: EngineInterface): Promise<string[]> {
401
+ try {
402
+ const v = await $.store.get(cleProjets(cwd))
403
+ return Array.isArray(v) ? v.filter((x): x is string => typeof x === 'string') : []
404
+ } catch {
405
+ return []
406
+ }
407
+ }
408
+
409
+ // Adds a project to the pane or removes it, by its path; a path that is not a Grillhouse project
410
+ // is refused by its name. The list is kept for the session's folder, and the board measured again.
411
+ async function changerLaListe($: EngineInterface, geste: 'ajouter' | 'retirer', chemin: string): Promise<string> {
412
+ if (!chemin) return `Usage : /grillhouse ${geste} <chemin>.`
413
+ const maison = chemin.startsWith('~') ? ((await $.env.get('HOME')) ?? '') : ''
414
+ const dossier = dossierDe(chemin, cwd, maison)
415
+ const { projets } = await read($, etat)
416
+ let liste: string[]
417
+ if (geste === 'ajouter') {
418
+ if (dossier === cwd || projets.includes(dossier)) return `${dossier} est déjà au tableau.`
419
+ const pkg = `${dossier}/package.json`
420
+ const texte = (await $.fs.exists(pkg)) ? String(await $.fs.read(pkg)) : null
421
+ if (!declareLePaquet(texte)) {
422
+ return `Refusé : ${dossier} n'est pas un projet Grillhouse (son package.json ne déclare pas ${PAQUET}).`
423
+ }
424
+ liste = [...projets, dossier]
425
+ } else {
426
+ if (!projets.includes(dossier)) return `${dossier} n'est pas au tableau.`
427
+ liste = projets.filter(p => p !== dossier)
428
+ }
429
+ await $.store.set(cleProjets(cwd), liste)
430
+ await update($, etat, s => ({ ...s, projets: liste }))
431
+ void rafraichir($)
432
+ return geste === 'ajouter' ? `Projet ajouté au tableau : ${dossier}.` : `Projet retiré du tableau : ${dossier}.`
433
+ }
434
+
311
435
  // The board applies to a Grillhouse project outside an agent's copy (`eligible`), once someone can
312
436
  // see it: a person at the terminal's prompt from the start (`isInteractive`), or a surface that
313
437
  // attaches later — the desktop app's Code tab, whose session starts headless, as the SDK's does,
@@ -320,6 +444,7 @@ async function activer($: EngineInterface) {
320
444
  await $.command.register({
321
445
  name: 'grillhouse',
322
446
  description: 'Ouvre le tableau Grillhouse : le projet, les agents, le chantier en cours',
447
+ argumentHint: '[ajouter|retirer <chemin>]',
323
448
  })
324
449
  void rafraichir($)
325
450
  $.clock.every(PERIODE, () => void rafraichir($))
@@ -340,6 +465,10 @@ export const register: Register = on => {
340
465
  const texte = (await $.fs.exists(pkg)) ? String(await $.fs.read(pkg)) : null
341
466
  projet = declareLePaquet(texte)
342
467
  eligible = projet && !cwd.includes('/.claude/worktrees/')
468
+ if (eligible) {
469
+ const garde = await lireLaListe($)
470
+ if (garde.length) await update($, etat, s => ({ ...s, projets: garde }))
471
+ }
343
472
  if (e.isInteractive) await activer($)
344
473
  return started
345
474
  })
@@ -352,7 +481,11 @@ export const register: Register = on => {
352
481
 
353
482
  // The command answers at once and the board is measured behind it: a measure takes seconds on a
354
483
  // large project, and a hook past its budget (10 s) is skipped, its command answered by the engine.
484
+ // `ajouter <chemin>` and `retirer <chemin>` change the projects the pane shows.
355
485
  on('command.run', { command: 'grillhouse' }, async ($, e) => {
486
+ const [geste = '', ...reste] = (e.args ?? '').trim().split(/\s+/)
487
+ if (geste === 'ajouter' || geste === 'retirer') return { text: await changerLaListe($, geste, reste.join(' ')) }
488
+ if (geste) return { text: 'Usage : /grillhouse, /grillhouse ajouter <chemin>, /grillhouse retirer <chemin>.' }
356
489
  void rafraichir($)
357
490
  // A narrow column docked beside the transcript; a short block when seated above the prompt.
358
491
  await $.ui.open({ id: PANE, title: 'Grillhouse', columns: COLONNES, rows: 12 })
@@ -381,9 +514,10 @@ export const register: Register = on => {
381
514
  return r
382
515
  })
383
516
 
384
- // The pane draws its own rows: the wheel moves its window by `e.by` rows, within its lines, and
385
- // draws it again. On the whole card, the wheel, the arrows and the page keys move its text by
386
- // `e.by` rows, and the engine's window is held on the row under the card's spare top row, so an
517
+ // The pane draws its own rows: each notch of the wheel is kept, and the next render moves the
518
+ // window by every notch kept, one by one within its lines, as a browser folds the scroll events
519
+ // of one frame into one paint: a notch reads nothing and computes nothing. On the whole card,
520
+ // the wheel, the arrows and the page keys move its text by `e.by` rows, and the engine's window is held on the row under the card's spare top row, so an
387
521
  // arrow up scrolls as an arrow down does, wherever the text stands.
388
522
  on('ui.scroll', async ($, e, next) => {
389
523
  if (e.requestId !== PANE) return next(e)
@@ -392,8 +526,7 @@ export const register: Register = on => {
392
526
  $.ui.invalidate('ui.render')
393
527
  return next({ ...e, offset: 1 })
394
528
  }
395
- const liste = placer(await read($, etat), cadre.rangs, cadre.focus)
396
- fenetre = Math.max(0, Math.min(fenetre + e.by, liste.length - cadre.rangs))
529
+ crans.push(e.by)
397
530
  $.ui.invalidate('ui.render')
398
531
  return {}
399
532
  })
@@ -408,8 +541,8 @@ export const register: Register = on => {
408
541
  const montre = e.props.isFocused ? choisi : (t.dernier ?? choisi)
409
542
  const fiche = montre ? t.fiches[montre] : undefined
410
543
  const rangs = Math.max(1, e.props.scroll.bodyRows - FICHE - 1)
411
- cadre = { rangs, focus: e.props.isFocused }
412
- const liste = placer(s, rangs, e.props.isFocused)
544
+ const liste = listeDe(s)
545
+ placer(liste, element, rangs, e.props.isFocused)
413
546
  const ici = liste.findIndex(x => x.cle === element)
414
547
  // The chantier the keyboard is on, which `h` switches on or off.
415
548
  const chantier = ici >= 0 && liste[ici]?.l.chantier ? liste[ici]?.l.ticket : undefined
@@ -426,8 +559,7 @@ export const register: Register = on => {
426
559
  plain
427
560
  hotkey="e"
428
561
  onPress={() => {
429
- fenetre = 0
430
- suivi = null
562
+ recommencer()
431
563
  void update($, etat, basculerVue)
432
564
  }}
433
565
  >
@@ -439,8 +571,7 @@ export const register: Register = on => {
439
571
  plain
440
572
  hotkey="o"
441
573
  onPress={() => {
442
- fenetre = 0
443
- suivi = null
574
+ recommencer()
444
575
  void update($, etat, x => ouvrirGroupe(x, groupe))
445
576
  }}
446
577
  >
@@ -453,7 +584,7 @@ export const register: Register = on => {
453
584
  plain
454
585
  hotkey="g"
455
586
  onPress={() => {
456
- if (!grand && montre) void lireTexte($, montre)
587
+ if (!grand && montre) void lireTexte($, montre, dossierDu(t, montre))
457
588
  ligneTexte = 0
458
589
  void update($, etat, s => ({ ...s, grand: !s.grand }))
459
590
  }}
@@ -462,7 +593,12 @@ export const register: Register = on => {
462
593
  </Button>
463
594
  ) : null}
464
595
  {chantier && fiche ? (
465
- <Button key="h" plain hotkey="h" onPress={() => void basculer($, chantier, t.fiches[chantier]?.statut)}>
596
+ <Button
597
+ key="h"
598
+ plain
599
+ hotkey="h"
600
+ onPress={() => void basculer($, chantier, t.fiches[chantier]?.statut, dossierDu(t, chantier))}
601
+ >
466
602
  <Text dimColor>{`· h : ${fiche.statut === 'in_progress' ? 'désactiver' : 'activer'} `}</Text>
467
603
  </Button>
468
604
  ) : null}
@@ -507,8 +643,18 @@ export const register: Register = on => {
507
643
  )
508
644
  }
509
645
  const premier = fenetre
646
+ const montrees = liste.slice(premier, premier + rangs)
510
647
  // A card fills the pane's last rows: the whole title on as many lines as it takes, then the
511
- // component, state, duration and tokens, then the description in the rows left.
648
+ // component, state, duration and tokens, then the description in the rows left. Each card is
649
+ // drawn once for a board, a width and a surface, and kept.
650
+ const gardees = cartesGardees(s.revision, colonnes, Box)
651
+ const garder = (cle: string, dessin: () => JSX.Element) => {
652
+ const deja = gardees.get(cle)
653
+ if (deja) return deja
654
+ const neuf = dessin()
655
+ gardees.set(cle, neuf)
656
+ return neuf
657
+ }
512
658
  const carte = (f: Fiche | undefined) => {
513
659
  const [titre, etatDuTicket, resume] = ficheLignes(f)
514
660
  return (
@@ -536,7 +682,7 @@ export const register: Register = on => {
536
682
  return (
537
683
  <Box flexDirection="column" height={e.props.scroll.bodyRows}>
538
684
  <Box flexDirection="column" flexGrow={1} overflow="hidden">
539
- {liste.slice(premier, premier + rangs).map(({ l, cle }) => {
685
+ {montrees.map(({ l, cle }) => {
540
686
  const texte = (
541
687
  <Text bold={l.ton === 'titre'} dimColor={l.ton === 'discret'} color={couleur(l.ton)} wrap="truncate-end">
542
688
  {l.texte || ' '}
@@ -567,21 +713,27 @@ export const register: Register = on => {
567
713
  </Box>
568
714
  {regle('tout le texte')}
569
715
  <Box flexDirection="column" height={FICHE} flexShrink={0}>
570
- {carte(fiche)}
571
- {Object.entries(t.fiches).map(([id, f]) => (
716
+ {garder(`carte:${montre ?? ''}`, () => carte(fiche))}
717
+ {[...new Set(montrees.map(x => x.l.ticket))].map(id => {
718
+ const f = id ? t.fiches[id] : undefined
572
719
  // The card of the ticket under the pointer, drawn over the chosen one on a blank of its
573
- // size, so no character of the chosen card shows through.
574
- <Box position="absolute" top={0} left={0} display="none" hover={{ scope: id, display: 'flex' }}>
575
- <Box flexDirection="column">
576
- {Array.from({ length: FICHE }, () => (
577
- <Text>{' '.repeat(colonnes)}</Text>
578
- ))}
579
- </Box>
580
- <Box position="absolute" top={0} left={0}>
581
- {carte(f)}
582
- </Box>
583
- </Box>
584
- ))}
720
+ // size, so no character of the chosen card shows through: one for each ticket of the
721
+ // lines in the window, the only ones the pointer can be over.
722
+ return id && f
723
+ ? garder(`survol:${id}`, () => (
724
+ <Box position="absolute" top={0} left={0} display="none" hover={{ scope: id, display: 'flex' }}>
725
+ <Box flexDirection="column">
726
+ {Array.from({ length: FICHE }, () => (
727
+ <Text>{' '.repeat(colonnes)}</Text>
728
+ ))}
729
+ </Box>
730
+ <Box position="absolute" top={0} left={0}>
731
+ {carte(f)}
732
+ </Box>
733
+ </Box>
734
+ ))
735
+ : null
736
+ })}
585
737
  </Box>
586
738
  </Box>
587
739
  )
package/package.json CHANGED
@@ -1,7 +1,17 @@
1
1
  {
2
2
  "name": "@roomi-fields/grillhouse",
3
- "version": "0.28.0",
3
+ "version": "0.28.2",
4
4
  "description": "Roomi's Grillhouse: the frame's scripts, called by one command, grillhouse <sous-commande>",
5
+ "keywords": [
6
+ "claude-code",
7
+ "elephant-goldfish-model",
8
+ "spec-driven-development",
9
+ "ai-agents",
10
+ "multi-agent",
11
+ "agentic-coding",
12
+ "code-review",
13
+ "tdd"
14
+ ],
5
15
  "license": "MIT",
6
16
  "type": "module",
7
17
  "repository": {