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

Open Beginner friendly
#4,819 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Active
Tech stack
bun, typescript

Research direction

Read packages/ui-react/src/components/voice/recordings-tray.tsx, associate-recordings.tsx, and the allowlist in scripts/check-import-cycles.ts. Move the two label helpers into recording-labels.ts, update both imports, and remove the recordings allowlist entry. Run the listed runtime tests and bun run lint; done when the helpers are unchanged, the cycle gate passes without that entry, and the API report remains byte-identical.

Written by the indexing model from the issue text.

Description

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.

Dominant language
TypeScript
Stars
5
Forks
0
Avg merge
8h 3m
Merged PRs (30d)
606

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from schlessera/brain-kit

All issues in schlessera/brain-kit

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.