From cbba4ddeecf8836628264c5857d70e7266b1cd98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Mon, 28 Sep 2026 05:07:35 -0400 Subject: [PATCH] =?UTF-8?q?T42f=20Misc=20=C2=B7=20Web=20passes=20review?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit in_view names its types in place and the non-macOS branch reads its fields, so builds off macOS stay free of warnings. --- TASKS.md | 4 +++- src/misc/web.rs | 11 +++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/TASKS.md b/TASKS.md index f5a36d2..a9b2048 100644 --- a/TASKS.md +++ b/TASKS.md @@ -145,7 +145,7 @@ Per-component lines live in `tasks/`. Tags there: - [x] T42c Misc · Codes and checks — `tasks/ch31-43.md` - [x] T42d Misc · Asking and learning — `tasks/ch31-43.md` - [x] T42e Misc · Terms and notices — `tasks/ch31-43.md` -- [ ] T42f Misc · Web — `tasks/ch31-43.md` +- [x] T42f Misc · Web — `tasks/ch31-43.md` - [ ] T42g Misc · Export and import — `tasks/ch31-43.md` - [ ] T43 Library Tooling - [ ] T44 Capture: every component, light and dark, plus motion clips; roots still on `w_full` drop it, checked at 280px and in padded cards @@ -458,3 +458,5 @@ Per-component lines live in `tasks/`. Tags there: | T42d | 2 | PASS | the poll's mark and its selector now share one binding | | T42e | 1 | FAIL | the code held, but seven claims had no test: Decline, the scrim, focus back after Accept, necessary cookies on and resting, the list's mark and its rows' lines | | T42e | 2 | PASS | a Tab-path check for the resting Necessary switch added in the pass commit | +| T42f | 1 | FAIL | a press on the web view gave WebKit the keyboard for good, since gpui's view never takes the first responder back; in_view warned off macOS; a straddling box untested | +| T42f | 2 | PASS | off-macOS imports and fields tidied in the pass commit | diff --git a/src/misc/web.rs b/src/misc/web.rs index caf6627..8286d91 100644 --- a/src/misc/web.rs +++ b/src/misc/web.rs @@ -1,6 +1,6 @@ use gpui::{ - AnyElement, App, Bounds, ElementId, IntoElement, ParentElement, Pixels, RenderOnce, - SharedString, Styled, Window, div, + AnyElement, App, ElementId, IntoElement, ParentElement, RenderOnce, SharedString, Styled, + Window, div, }; use crate::{ @@ -19,7 +19,10 @@ pub enum WebSource { /// Whether a box lies, at least in part, inside what the window shows of its region. #[cfg(any(target_os = "macos", test))] -pub(crate) fn in_view(bounds: Bounds, shown: Bounds) -> bool { +pub(crate) fn in_view( + bounds: gpui::Bounds, + shown: gpui::Bounds, +) -> bool { bounds.intersects(&shown) } @@ -45,7 +48,7 @@ impl RenderOnce for WebView { return mac::page(self.id, self.source, window, cx); #[cfg(not(target_os = "macos"))] { - let _ = window; + let _ = (window, self.id, self.source); let theme = cx.theme(); div() .size_full()