04a8ee2
Enforce a Send bound on next frame callbacks
Click to expand commit body
This required using mpsc channels to invoke frame callbacks on the
main thread and send the receiver to the platform display link.
Co-Authored-By: Julia Risley <julia@zed.dev>
This PR adds a `map` method to the `Component` trait.
`map` is a fully-generalized form of `when`, as `when` can be expressed
in terms of `map`:
```rs
div().map(|this| if condition { then(this) } else { this })
```
This allows us to take advantage of Rust's pattern matching when
building up conditions:
```rs
// Before
div()
.when(self.current_side == PanelSide::Left, |this| this.border_r())
.when(self.current_side == PanelSide::Right, |this| {
this.border_l()
})
.when(self.current_side == PanelSide::Bottom, |this| {
this.border_b().w_full().h(current_size)
})
// After
div()
.map(|this| match self.current_side {
PanelSide::Left => this.border_r(),
PanelSide::Right => this.border_l(),
PanelSide::Bottom => this.border_b().w_full().h(current_size),
})
```
Release Notes:
- N/A
5ee2b01
authenticate with completion provider on new inline assists (#3209)
Click to expand commit body
authenticate with completion provider on new inline assists
Release Notes:
- Fixed bug which lead the inline assist functionality to never
authenticate
bda43ca
Merge remote-tracking branch 'origin/main' into zed2-workspace
Antonio Scandurra
created
8793300
Remove more `Send` bounds and simplify view rendering (#3207)
Click to expand commit body
This pull request removes more `Send` bounds from GPUI2 after #3206 and
simplifies some internals. Specifically:
- The `Reference` enum was removed, as we always capture mutable
references anyway.
- A few GATs from `Context` and `VisualContext` were removed, as they're
unnecessary now that `MainThread` isn't a thing.
- View rendering was greatly simplified (we were able to remove
`EraseViewState` and `ViewObject`)
Release Notes:
- N/A