-
-
Notifications
You must be signed in to change notification settings - Fork 160
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
chore: update winit to 0.30 #150
Conversation
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.
Is it a known issue that it crashes when closing a window on macOS?
[2024-08-14T09:11:43Z ERROR winit::platform_impl::macos::event_handler] tried to run event handler, but no handler was set
This is caused by surfman issue I think which is merged this week. I'll update the dep in follow up PR. |
Code Review Agent Run #90ad3f
High-level FeedbackEnsure that all dependencies are specified with exact versions to avoid compatibility issues. Replace 'expect' with proper error handling to prevent ungraceful crashes. Introduce error handling for operations within 'handle_winit_window_event' to manage potential errors gracefully. Ensure consistency between Cargo.toml and Cargo.lock to avoid dependency management issues.Actionable Issues
📄 src/window.rs
Issues: Total - 1, High importance - 1
📄 Cargo.lock
Issues: Total - 2, High importance - 2
📄 src/verso.rs
Issues: Total - 1, High importance - 1
|
Heya @wusyong & @pewsheen , I’m Rohan, the Developer Community Manager at Bito. I’d like to run our AI Code Review Agent on your PRs. Think of it as letting AI take the “first pass” on your code reviews—covering security, performance, scalability, and optimization. You don’t need to do anything for this initial setup. I’ll handle running the Agent and will share any potential fixes and suggestions it comes up with. Later on, if you’re up for it, you can try it on your other PRs as well. I see that you have many PRs getting merged recently and having another set of eyes for the review would be very beneficial! Looking forward to seeing what the Agent can uncover and hoping it helps make your code even better. |
compositor: &mut IOCompositor, | ||
) -> Self { | ||
let window = WindowBuilder::new() | ||
pub fn new_with_compositor(evl: &ActiveEventLoop, compositor: &mut IOCompositor) -> Self { |
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.
Bito Code Review Agent Run #90ad3f - 08/14/2024, 10:29 am
Code suggestion
@@ -105,7 +105,13 @@
.expect("Failed to create window.");
let rwh = window.window_handle().expect("Failed to get window handle");
+ if rwh.is_err() {
+ log::error!("Failed to get window handle: {:?}", rwh.err());
+ return Err("Failed to get window handle");
+ }
+ let rwh = rwh.unwrap();
Is this a valid issue, or was it incorrectly flagged by the Agent?
- it was incorrectly flagged
[[package]] | ||
name = "dpi" | ||
version = "0.1.1" | ||
source = "registry+https://github.com/rust-lang/crates.io-index" | ||
checksum = "f25c0e292a7ca6d6498557ff1df68f32c99850012b6ea401cf8daf771f22ff53" | ||
|
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.
Bito Code Review Agent Run #90ad3f - 08/14/2024, 10:29 am
Code suggestion
@@ -20,6 +20,7 @@
[dependencies]
dom_struct = "0.0.1"
domobject_derive = "0.0.1"
downcast-rs = "1.2.1"
+dpi = "0.1.1"
dtoa = "1.0.9"
dtoa-short = "0.3.5"
dwrote = "0.11.0"
Is this a valid issue, or was it incorrectly flagged by the Agent?
- it was incorrectly flagged
@@ -3784,17 +3782,23 @@ version = "0.2.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
checksum = "55260963a527c99f1819c4f8e3b47fe04f9650694ef348ffd2227e8196d34c80" | |||
dependencies = [ | |||
"block2 0.5.1", | |||
"objc2 0.5.2", | |||
"block2", |
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.
Bito Code Review Agent Run #90ad3f - 08/14/2024, 10:29 am
Code suggestion
@@ -3785,2 +3785,2 @@ dependencies = [
- "block2",
- "objc2",
+ "block2 0.5.1",
+ "objc2 0.5.2",
Is this a valid issue, or was it incorrectly flagged by the Agent?
- it was incorrectly flagged
/// Handle Winit events | ||
fn handle_winit_event(&mut self, event: Event<()>) { | ||
/// Handle Winit window events | ||
pub fn handle_winit_window_event(&mut self, window_id: WindowId, event: WindowEvent) { |
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.
Bito Code Review Agent Run #90ad3f - 08/14/2024, 10:29 am
Code suggestion
@@ -396,22 +396,22 @@
if let WindowEvent::CloseRequested = event {
// self.windows remove(&window_id);
if let Err(e) = compositor.maybe_start_shutting_down() {
log::error!("Failed to start shutting down: {:?}", e);
}
} else {
let mut need_repaint = false;
for (id, window) in &mut self.windows {
if window_id == *id {
match window.handle_winit_window_event(
&self.constellation_sender,
compositor,
&event,
) {
Ok(repaint) => need_repaint = repaint,
Err(e) => log::error!("Failed to handle window event: {:?}", e),
}
}
}
if need_repaint {
if let Err(e) = compositor.repaint_synchronously(&mut self.windows) {
log::error!("Failed to repaint synchronously: {:?}", e);
}
}
}
Is this a valid issue, or was it incorrectly flagged by the Agent?
- it was incorrectly flagged
Based on the above Code Suggestions, I can't wait to hear what you think?! |
Hey there @rohankokkulabito - while your HUMAN interest is gratifying, AI tooling such as the one you represent is not appropriate for this organization or repo at its current stage of very early development, and it is very unlikely that we would ever adopt such a distraction. As someone who has been involved in many open source projects, a better approach would have been to file an issue and gauge the response from the team before letting loose your LLM that tries to AI-SPLAIN us how to modify Cargo.lock |
Is this thing going to eventually suggest that we start using the chromium engine instead of servo? I get that feeling... Say Hi to Devan for us... |
I appreciate the thoughtful feedback @denjell-crabnebula! 😅 You share a good idea about filing an issue first vs. plowing into an open PR. I'm new to open source and so is Bito's AI code reviewer, so I'm experimenting in (hopefully) non-invasive "human" ways to contribute, while letting our robot pal's work try to speak for itself. Have you seen a tool like Bito's insert itself in a healthy, helpful way to an open source community before? Maybe I could learn from it. THANK YOU! 🙏 |
No description provided.