ui-react: twelve browser fixtures restore an absent theme as the literal "undefined"
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
- 88/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- testing
Direzione di ricerca
Leggi i dodici callback di pulizia elencati nell’issue per i file indicati in packages/ui-react/tests/browser/. Controlla come i test vicini proteggono il ripristino quando il tema salvato è undefined, quindi aggiorna solo il codice di pulizia elencato. Conferma che i temi assenti restino assenti e che i valori presenti vengano ripristinati esattamente, quindi esegui ogni file modificato nel progetto browser assegnato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Context
Found during the #3855 test-health push (batch e3855-ui-react-04). Assigning a saved document.documentElement.dataset.theme back with dataset.theme = saved when the saved value was undefined writes the literal string "undefined" instead of removing the attribute. #2021 records the same fault for connection-replay.layout.tsx with a native Chromium observation ({before:null,after:"undefined"}). The ui-react-04 batch fixed seven instances in its own shard (review-dialogs, renderer-dispatch, tool-permission, search-results, supporting-files, sent-attachments, saved-transcription).
A grep at d19aec478 on that batch branch (dataset.theme = <saved value> with no undefined guard) finds these instances outside that shard:
afterEach,packages/ui-react/tests/browser/diagrams-renderer.layout.tsx:16afterEachcallback list,packages/ui-react/tests/browser/diagrams-callouts.layout.tsx:40afterEach,packages/ui-react/tests/browser/diagrams-node-link.layout.tsx:12afterEach,packages/ui-react/tests/browser/diagrams-frame.layout.tsx:22afterEach,packages/ui-react/tests/browser/mermaid-content-renderer.layout.tsx:32finally,packages/ui-react/tests/browser/error-boundaries.layout.tsx:225ctx.onTestFinished,packages/ui-react/tests/browser/dictation-notice.pointer.tsx:133ctx.onTestFinished,packages/ui-react/tests/browser/overlay-stacking.pointer.tsx:479
The guarded form already used across the suite is if (saved === undefined) delete document.documentElement.dataset.theme; else document.documentElement.dataset.theme = saved;.
Related: #2021 (the same fault in connection-replay.layout.tsx, kept there).
Scope
Restore an absent theme attribute as absent in the eight cleanups listed above, and in these four that triage found at 91e54be37 with the same unguarded restore of a saved dataset.theme (outside ui-react-04's seven, and not fixed on epic/3855-test-health when triaged):
afterEach,packages/ui-react/tests/browser/code-fences.layout.tsx:16afterEach,packages/ui-react/tests/browser/code-fences-plain.layout.tsx:15afterEach,packages/ui-react/tests/browser/inline-graph.layout.tsx:17afterEach,packages/ui-react/tests/browser/draft-indicator.offline.tsx:65
If another #3855 batch fixes one of these first, leave it. Test code only.
Out of scope
connection-replay.layout.tsx. #2021 owns it.diagrams-renderer.layout.tsx:110, which assigns a literal theme on purpose.- Any change to what these tests assert, to their theme matrices, or to product theme behaviour.
Acceptance criteria
- Each listed cleanup leaves
document.documentElement.hasAttribute("data-theme")false when the attribute was absent before the case, and restores the exact value when one was present. - A grep for unguarded
dataset.theme = <saved value>assignments underpackages/ui-react/testsandpackages/ui-kit/testsreturns only #2021's file (if it is still open) and the seven ui-react-04 sites, until #3919 reachesmainthrough #3855. - Every touched file passes in its pinned browser project.
Verification
bun scripts/test-health.ts measure <file> --runs 2 for each touched file, or the file's bun run test:layout / bun run test:browser project. One native check that the attribute is absent after a case that started without it.
Contract impact
None. Test isolation only.
Triage 2026-11-10 (main 91e54be37): verified the eight cited sites against main (the dictation-notice restore moved to :133); added four more unguarded restores found by the same grep, so the grep criterion can actually pass; state-room.layout.tsx:49 restores previousTheme ?? "dark" on purpose and is not in scope.
- Lingua principale
- TypeScript
- Stelle
- 4
- Fork
- 0
- Merge medio
- 6h 8m
- PR unite (30g)
- 864
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di schlessera/brain-kit
-
agent-ready area: ci priority: p2 type: fix
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
schlessera/brain-kit#3951 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
agent-ready area: ui-react priority: p2 type: test
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
schlessera/brain-kit#3938 ·
I maintainer di solito rispondono entro 1 giorno
-
area: render priority: p1 type: test
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
schlessera/brain-kit#3927 ·
I maintainer di solito rispondono entro 1 giorno
-
ui-react: artifact-recovery late-completion runtime cases assert before the late response is handledApertaagent-ready area: ui-react priority: p2 type: test
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
schlessera/brain-kit#3909 ·
I maintainer di solito rispondono entro 1 giorno
-
agent-ready area: ci area: docs area: ui-sdk priority: p2 type: test
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
schlessera/brain-kit#3889 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di schlessera/brain-kit
Issue simili
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 86/100
g1331/phantom-circuit#93 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
compiler
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
HerringtonDarkholme/hd-lang#1699 ·
I maintainer di solito rispondono entro 1 giorno
-
account bug communication lecture
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno