T42f Misc · Web passes review

in_view names its types in place and the non-macOS branch reads its fields, so builds off macOS stay free of warnings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-09-28 05:07:35 -04:00
1 parent 1b04dc07a4
commit b7c8629ea7
2 files changed
+10 -5

No files matched your search

+3 -1
View File
@@ -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 |
+7 -4
View File
@@ -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<Pixels>, shown: Bounds<Pixels>) -> bool {
pub(crate) fn in_view(
bounds: gpui::Bounds<gpui::Pixels>,
shown: gpui::Bounds<gpui::Pixels>,
) -> 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()