Skip to content

Devtools disable log dimming strict mode setting#206

Closed
everettbu wants to merge 14 commits into
mainfrom
devtools-disable-log-dimming-strict-mode-setting
Closed

Devtools disable log dimming strict mode setting#206
everettbu wants to merge 14 commits into
mainfrom
devtools-disable-log-dimming-strict-mode-setting

Conversation

@everettbu

@everettbu everettbu commented Dec 12, 2025

Copy link
Copy Markdown

Mirror of facebook/react#35207
Original author: emily8rown


Summary

Currently, every second console log is dimmed, receiving a special style that indicates to user that it was raising because of React Strict Mode second rendering. This introduces a setting to disable this.

How did you test this change?

Test in console-test.js

Screen.Recording.2025-11-25.at.11.21.05.mov

Browser extension react devtools

Screen.Recording.2025-11-25.at.12.25.23.mov

React native dev tools:

Screen.Recording.2025-12-11.at.11.21.11.mov

emily8rown and others added 14 commits November 20, 2025 13:17
Co-authored-by: Ruslan Lesiutin <28902667+hoxyq@users.noreply.github.com>
@greptile-apps

greptile-apps Bot commented Dec 12, 2025

Copy link
Copy Markdown

Greptile Overview

Greptile Summary

This PR adds a user-configurable setting to disable console log dimming for the second render in React Strict Mode. The implementation is thorough and well-integrated across the DevTools codebase.

Key Changes:

  • Added disableSecondConsoleLogDimmingInStrictMode setting that prevents ANSI dimming codes from being applied to duplicate console logs in Strict Mode
  • Setting is disabled by default, preserving existing behavior
  • UI includes proper mutual exclusivity: when "Hide logs" is enabled, the dimming toggle is automatically disabled and grayed out
  • Implementation covers both console patching paths: patchConsoleForStrictMode (log, info, group, groupCollapsed) and patchConsoleForErrorsAndWarnings (error, warn)
  • Comprehensive test coverage validates both enabled and disabled states
  • Documentation updated with new setting and default value

Confidence Score: 5/5

  • This PR is safe to merge with no significant risks
  • The implementation is clean, well-tested, and follows existing patterns throughout the codebase. All code paths are covered with comprehensive tests, the feature is opt-in with sensible defaults, and the UI properly handles state interactions between related settings. No logical errors, edge cases, or security concerns identified.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
packages/react-devtools-shared/src/hook.js 5/5 Added disableSecondConsoleLogDimmingInStrictMode setting that conditionally skips dimming logic in both patchConsoleForStrictMode and patchConsoleForErrorsAndWarnings functions
packages/react-devtools-shared/src/devtools/views/Settings/DebuggingSettings.js 5/5 Added UI checkbox for the new setting with proper state management and mutual exclusivity with hideConsoleLogsInStrictMode
packages/react-devtools-shared/src/tests/console-test.js 5/5 Added comprehensive tests verifying dimming is disabled when setting is enabled and remains active when disabled

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

9 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@everettbu

Copy link
Copy Markdown
Author

Upstream PR was closed or merged. Code is synced via branch mirror.

@everettbu everettbu closed this Dec 15, 2025
@everettbu
everettbu deleted the devtools-disable-log-dimming-strict-mode-setting branch December 15, 2025 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants