fix(qr): stabilize terminal colors#90258
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 30, 2026, 8:43 AM ET / 12:43 UTC. Summary PR surface: Source +9, Tests +10. Total +19 across 4 files. Reproducibility: yes. Source shows current main uses qrcode's ANSI palette terminal renderer for default full-size output, and the inspected before/after screenshots show the dark-theme failure and the truecolor improvement. Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Resolve the conflict, rerun checks, and either accept truecolor matrix output as the new SDK-visible terminal QR contract or add an explicit compatibility path before merge. Do we have a high-confidence way to reproduce the issue? Yes. Source shows current main uses qrcode's ANSI palette terminal renderer for default full-size output, and the inspected before/after screenshots show the dark-theme failure and the truecolor improvement. Is this the best way to solve the issue? Yes, with a compatibility caveat. A shared matrix renderer is the clean fix for full-size terminal QR theme stability; a legacy path is only better if maintainers decide exact ANSI-palette output or non-truecolor terminals remain supported. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 6cb82eaab865. Label changesLabel justifications:
Evidence reviewedPR surface: Source +9, Tests +10. Total +19 across 4 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
Summary
or remapped ANSI themes.
controlled rendering approach already used by compact QR output.
requiring users to change terminal themes.
for all callers.
Linked context
Closes #
Related #
Requested during maintainer testing of Feishu scan-to-create/login QR display, where the large terminal QR appeared dark because
terminal theme colors affected ANSI white/black rendering.
Real behavior proof (required for external PRs)
Feishu scan QR codes difficult to scan.
node scripts/run-vitest.mjs src/media/qr-terminal.test.ts src/media/qr-terminal.render.test.ts --reporter=verbose
.agents/skills/autoreview/scripts/autoreview --mode local --parallel-tests "node scripts/run-vitest.mjs src/media/qr-
terminal.test.ts src/media/qr-terminal.render.test.ts --reporter=verbose"
truecolor white background and black foreground.
keep a controlled background until the end-of-line reset.
rendering can still vary in terminals that do not support ANSI truecolor.
Tests and validation
Commands run:
node scripts/run-vitest.mjs src/media/qr-terminal.test.ts src/media/qr-terminal.render.test.ts --reporter=verbose
.agents/skills/autoreview/scripts/autoreview --mode local --parallel-tests "node scripts/run-vitest.mjs src/media/qr-
terminal.test.ts src/media/qr-terminal.render.test.ts --reporter=verbose"
Regression coverage added or updated:
only at row end.
What failed before this fix:
regions appear dark in some themes.
If no test was added, why not?
Risk checklist
Did user-visible behavior change? (Yes)
Did config, environment, or migration behavior change? (No)
Did security, auth, secrets, network, or tool execution behavior change? (No)
What is the highest-risk area?
Shared terminal QR rendering affects all callers of renderQrTerminal() that use default full-size output.
How is that risk mitigated?
The renderer still uses the same qrcode.create(text).modules matrix source, and focused tests verify both full-size row color
control and compact QR matrix fidelity.
Current review state
What is the next action?
Open PR and request maintainer review.
What is still waiting on author, maintainer, CI, or external proof?
CI and maintainer review.
Which bot or reviewer comments were addressed?
Local autoreview completed cleanly with no accepted/actionable findings.
Before:
Now: