fix(ui): ensure model changes update the UI immediately#12412
Conversation
Summary of ChangesHello @abhipatel12, 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 resolves a user interface bug where changes to the application's model, specifically when using the 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. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request effectively addresses the UI reactivity bug by introducing a CoreEvent.ModelChanged event. The implementation is clean, adding the event in the core package and subscribing to it in the UI container. The added unit tests are valuable. However, the new integration test in AppContainer.test.tsx contains a redundant rerender call that could mask potential bugs and should be removed to improve the test's reliability.
|
Size Change: +611 B (0%) Total Size: 20.3 MB ℹ️ View Unchanged
|
2275360 to
3f15d47
Compare
3f15d47 to
130d5cc
Compare
|
/patch preview |
|
✅ Patch workflow(s) dispatched successfully! 📋 Details:
🔗 Track Progress: |
# Conflicts: # packages/core/src/config/config.test.ts
|
🚀 Patch PR Created! 📋 Patch Details:
📝 Next Steps:
🔗 Track Progress: |

Summary
This PR fixes a bug where changing the model via the
/modelslash command did not immediately update the UI (specifically the footer status bar).Details
The
Configobject is a plain TypeScript class and its state changes are not automatically reactive in the React UI. Previously, the UI only updated when other actions triggered a re-render.Changes included in this PR:
CoreEvent.ModelChangedevent inCoreEventEmitter.Config.setModel()to emit this event whenever the model actually changes.AppContainerto subscribe to this event and sync thecurrentModelReact state, ensuring immediate UI updates.AppContainersubscription.How to Validate
npm run start/modelcommand and select a different model.Pre-Merge Checklist