-
Notifications
You must be signed in to change notification settings - Fork 10
feat: Add version detection warnings for hot reload #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Add warnings in all commands that use hot_reload to inform users about the known limitation on Flutter stable <= 3.37.0. This helps users understand why hot reload may fail and provides clear guidance on workarounds (switching to Flutter main channel or manually restarting the app). Changes: - Updated /debug-app command to check Flutter version early and warn users about hot reload limitations - Added inline warnings in /create-app and /modify commands when hot_reload is used - Updated CHANGELOG.md to document this improvement Related to gemini-cli-extensions#15
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request effectively addresses the issue of hot reload failures on older Flutter versions by adding proactive warnings. The changes are clear and well-documented in the CHANGELOG. My review focuses on ensuring the accuracy and consistency of the information provided in the new warnings.
- **IMPORTANT**: Hot reload through the Dart MCP server does not work reliably on Flutter stable ≤ 3.37.0 (see [issue #15](https://github.com/gemini-cli-extensions/flutter/issues/15)) | ||
- If the user is on Flutter stable ≤ 3.37.0, warn them that hot reload may fail during this debugging session | ||
- Suggest they either: | ||
1. Switch to Flutter main/master channel for full hot reload support, OR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use "main".
@sethladd @gspencergoog @johnpryan - Would appreciate your review on this improvement for issue #15. This PR adds proactive warnings to help users understand the hot reload limitation on Flutter stable ≤ 3.37.0, providing clear workarounds until the upstream Dart SDK fix is available. |
- [ ] Run `flutter doctor` to get the Flutter and Dart SDK versions and check for any issues reported. | ||
- [ ] Check the Flutter version output and determine if hot reload is supported: | ||
- **IMPORTANT**: Hot reload through the Dart MCP server does not work reliably on Flutter stable ≤ 3.37.0 (see [issue #15](https://github.com/gemini-cli-extensions/flutter/issues/15)) | ||
- If the user is on Flutter stable ≤ 3.37.0, warn them that hot reload may fail during this debugging session |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd just delete this item in favor of the suggestion I had for line 38.
- **IMPORTANT**: Hot reload through the Dart MCP server does not work reliably on Flutter stable ≤ 3.37.0 (see [issue #15](https://github.com/gemini-cli-extensions/flutter/issues/15)) | ||
- If the user is on Flutter stable ≤ 3.37.0, warn them that hot reload may fail during this debugging session | ||
- Suggest they either: | ||
1. Switch to Flutter main/master channel for full hot reload support, OR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use "main".
- [ ] Run `flutter doctor` to get the Flutter and Dart SDK versions and check for any issues reported. | ||
- [ ] Check the Flutter version output and determine if hot reload is supported: | ||
- **IMPORTANT**: Hot reload through the Dart MCP server does not work reliably on Flutter stable ≤ 3.37.0 (see [issue #15](https://github.com/gemini-cli-extensions/flutter/issues/15)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- **IMPORTANT**: Hot reload through the Dart MCP server does not work reliably on Flutter stable ≤ 3.37.0 (see [issue #15](https://github.com/gemini-cli-extensions/flutter/issues/15)) | |
- Hot reload only works reliably on Flutter at versions at or above 3.37.0. If hot_reload fails, and they are using a version below that, inform the user and suggest either switching to the Flutter main channel or manually reloading the app. |
No need to reference the bug.
- [ ] Check the Flutter version output and determine if hot reload is supported: | ||
- **IMPORTANT**: Hot reload through the Dart MCP server does not work reliably on Flutter stable ≤ 3.37.0 (see [issue #15](https://github.com/gemini-cli-extensions/flutter/issues/15)) | ||
- If the user is on Flutter stable ≤ 3.37.0, warn them that hot reload may fail during this debugging session | ||
- Suggest they either: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove this entire item if you use the suggestion from line 38 above.
- Add strategic logging statements to the code to trace execution flow. Prefer `debugPrint()` over `print()` for cleaner, non-interfering output. | ||
- Use `hot_reload` to apply logging changes quickly while preserving the app's state. If the state needs to be reset, explain that a Hot Restart is needed, and you will need to stop and restart the app. | ||
- Use `hot_reload` to apply logging changes quickly while preserving the app's state. | ||
- **Note**: If the user is on Flutter stable ≤ 3.37.0 and hot_reload fails, suggest they manually restart the app or switch to Flutter main channel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- **Note**: If the user is on Flutter stable ≤ 3.37.0 and hot_reload fails, suggest they manually restart the app or switch to Flutter main channel | |
- Hot reload only works reliably on Flutter at versions at or above 3.37.0. If hot_reload fails, and they are using a version below that, inform the user and suggest either switching to the Flutter main channel or manually reloading the app. |
- [ ] Use `git diff` to verify the changes that have been made, and create a suitable commit message for any changes, following any guidelines you have about commit messages. Be sure to properly escape dollar signs and backticks, and present the change message to the user for approval. | ||
- [ ] Wait for approval. Don't commit the changes or move on to the next phase of implementation until the user approves the commit. | ||
- [ ] After commiting the change, if an app is running, use the hot_reload tool to reload it. | ||
- **Note**: Hot reload does not work reliably on Flutter stable ≤ 3.37.0. If hot_reload fails, inform the user and suggest either switching to Flutter main channel or manually restarting the app. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- **Note**: Hot reload does not work reliably on Flutter stable ≤ 3.37.0. If hot_reload fails, inform the user and suggest either switching to Flutter main channel or manually restarting the app. | |
- Hot reload only works reliably on Flutter at versions at or above 3.37.0. If hot_reload fails, and they are using a version below that, inform the user and suggest either switching to the Flutter main channel or manually reloading the app. |
Hi @meylis1998 , any thoughts on the review? |
Might also address #8 |
Hi @gspencergoog! Thanks for the thorough review. Your suggestions make the messaging much clearer and more user-friendly. |
Summary
This PR addresses issue #15 by adding version detection warnings for hot reload in all commands that use the
hot_reload
tool.Changes
/debug-app
command: Added early Flutter version check in the "Dependency and Environment Checks" section that warns users if they're on Flutter stable ≤ 3.37.0 and provides clear workarounds/create-app
and/modify
commands: Added inline warnings when usinghot_reload
to inform users about the limitationProblem
Hot reload through the Dart MCP server does not work reliably on Flutter stable ≤ 3.37.0. This leaves users confused when hot reload fails without explanation.
Solution
Instead of waiting for the upstream Dart SDK fix, this PR improves the user experience by:
Testing
The warnings are embedded in command prompts and will be displayed by the AI assistant when users run the affected commands on Flutter stable ≤ 3.37.0.
Related Issues
Closes #15
Test Plan
/debug-app
on Flutter stable ≤ 3.37.0 and verify version warning appears