ui-react: the recordings tray and the associate dialog import each other for two label helpers

Aperta Adatta ai principianti
#4,819 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Refactoring
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
bun, typescript

Direzione di ricerca

Leggi packages/ui-react/src/components/voice/recordings-tray.tsx, associate-recordings.tsx e la allowlist in scripts/check-import-cycles.ts. Sposta i due helper per le etichette in recording-labels.ts, aggiorna entrambi gli import e rimuovi dalla allowlist la voce recordings. Esegui i test runtime indicati e bun run lint; il lavoro è completo quando gli helper sono invariati, il controllo dei cicli passa senza quella voce e il report API resta identico byte per byte.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

agent-ready area: ui-react blocked priority: p3 type: refactor

Context

Blocked by #4816

packages/ui-react/src/components/voice/recordings-tray.tsx:2 imports AssociateRecordings, and components/voice/associate-recordings.tsx:5 imports recordingClock and recordingDuration back from the tray. The two helpers are pure label functions of a Recording (recordings-tray.tsx:18-26) that happen to be declared in the tray; nothing about them belongs to either component. The pair is one of the runtime import cycles #4816 reports and allowlists.

Two other cycles outside ui-server and ui-sdk are deliberately not cut: components/chat/brain-markdown.tsx ↔ share-block.tsx (a share block renders Markdown, which can contain a share block) and module-diagrams/src/geometry.ts ↔ axis-layout.ts (a nested flowchart is laid out by the main builder). Both are mutual recursion by design, each partner is read only inside a function body, and cutting them would mean a render prop or an injected builder whose only purpose is to satisfy the gate. #4816 keeps them as permanent allowlist entries.

Scope

  • Move recordingClock and recordingDuration to a leaf components/voice/recording-labels.ts; both components import it.
  • Remove the recordings entry from the allowlist in scripts/check-import-cycles.ts.

Out of scope

  • The share-block and diagrams cycles (kept by design, see Context).
  • Any change to what the tray or the dialog renders, including label wording.
  • The ui-server and ui-sdk cycles (#4818, #2530).

Acceptance criteria

  • git grep -n 'from "./recordings-tray.js"' -- packages/ui-react/src/components/voice/associate-recordings.tsx returns nothing.
  • bun run lint passes with no recordings entry in the import-cycle allowlist.
  • Mutation recorded in the PR: re-add the import of recordingClock from ./recordings-tray.js in associate-recordings.tsx, watch the import-cycle gate fail naming both files, restore.
  • The two moved functions are byte-identical apart from their file (git diff --color-moved).
  • packages/ui-react/tests/association-signout-runtime.test.ts and dictation-selection-runtime.test.ts pass with no edit, and packages/ui-react/tests/browser/recordings-tray.offline.tsx passes in the pinned browser.
  • api-report/ui-react.txt is byte-identical.

Verification

bun run test packages/ui-react/tests/association-signout-runtime.test.ts packages/ui-react/tests/dictation-selection-runtime.test.ts
bun run test:browser
bun run lint
NODE_OPTIONS=--max-old-space-size=6144 bun run typecheck
bun run api-report
bun run check:pr --base origin/main

Contract impact

  • This touches the integration contract, so it needs the contract label, a CONTRACT: commit prefix, and the doc updated in the same commit.
  • This changes a published package's behaviour, so it needs a changeset.

Two internal helpers move between files inside @schlessera/brain-ui-react; no exported name or rendered output changes.

Found by a repository audit on 2026-11-26 (main 87b96b10c); independently reviewed before filing.

Lingua principale
TypeScript
Stelle
5
Fork
0
Merge medio
8h 3m
PR unite (30g)
606

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di schlessera/brain-kit

Tutte le issue di schlessera/brain-kit

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.