Conversation
|
/gemini review |
|
Size Change: -1.56 kB (-0.01%) Total Size: 26.5 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Code Review
This pull request refactors the console message management by moving the state from a component-local useReducer to a global store using useSyncExternalStore. This change ensures that console history is preserved even when UI components are unmounted. The event listeners for coreEvents are now registered at the module level. Corresponding updates were made to the DetailedMessagesDisplay component and the test suites to accommodate the change in the hook's return type and the global nature of the store. I have no feedback to provide.
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a regression where console logs were lost when the 'Detailed Error View' (F12) component was unmounted. By shifting the state management to a global module-level store, logs are now persisted continuously, ensuring they are available immediately upon opening the debug view. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request refactors the console message management by moving the state from a component-level useReducer to a global store. This change ensures that console logs and error counts are preserved even when the UI components are unmounted. The implementation now utilizes useSyncExternalStore for state subscriptions. Feedback is provided regarding the lack of explicit unit tests for the refactored useErrorCount hook and the requirement to call unmount in tests to prevent resource leaks.
|
/patch preview |
|
🚀 [Step 1/4] Patch workflow(s) waiting for approval! 📋 Details:
⏳ Status: The patch creation workflow has been triggered and is waiting for deployment approval. Please visit the specific workflow links below and approve the runs. 🔗 Track Progress: |
|
🚀 [Step 2/4] Patch PR Created! 📋 Patch Details:
📝 Next Steps:
🔗 Track Progress: |

Summary
Fixes the "Detailed Error View" (F12) being empty when first opened.
Details
This PR resolves a regression introduced in PR #23080 where console message state was moved into the
DetailedMessagesDisplaycomponent. Because that component unmounts when the debug view is hidden, all logs emitted while the view was closed were lost.Changes:
useConsoleMessages.ts. This ensures logs are captured from the moment the file is imported, regardless of component lifecycle.useConsoleMessagesanduseErrorCountto use React 18'suseSyncExternalStorefor optimized, decoupled updates that bypass unnecessary root-level re-renders.clearConsoleMessagesproduction function and updated the hook to return the message array directly.Related Issues
Fixes #23815
How to Validate
Modify the workspace
settings.jsonto set"devtools": false.Open the CLI, perform actions that generate logs, then hit F12. The logs generated while the view was closed should now be visible immediately.
Pre-Merge Checklist