Commit Graph
13827 Commits
Author SHA1 Message Date
Nathan Sobo d1cb2d3e11 Enforce Send bound on next frame callback functions, because they're invoked on arbitrary threads (#3215)
This enforces the send bound, then uses an async task looping on a
channel to run callbacks on the main thread.
2023-11-02 12:36:38 -06:00
Nathan Sobo 29d8390743 Fix formatting 2023-11-02 12:28:58 -06:00
Nathan Sobo 1dd20d4c0a Merge remote-tracking branch 'origin/main' into gpui2-image-reborrow 2023-11-02 12:25:06 -06:00
Nathan SoboandJulia Risley 04a8ee222b Enforce a Send bound on next frame callbacks
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>
2023-11-02 12:01:22 -06:00
Marshall Bowers 1e7a216d55 WIP 2023-11-02 13:21:28 -04:00
Marshall Bowers 0e1d2fdf21 Checkpoint: Narrow down error 2023-11-02 12:47:06 -04:00
Marshall Bowers 66e4d75e6f Checkpoint: Reproduction with Avatar story 2023-11-02 12:34:40 -04:00
Nate Butler a3565225ad Document format_distance (#3214)
Adds docs for `ui2::util::format_distance`:
- distance_in_seconds
- distance_string
- naive_format_distance
- naive_format_distance_from_now

These are ports of
[`date-fns`](https://date-fns.org/v2.30.0/docs/formatDistance)'s format
distance utilities

[[PR Description]]

Release Notes:

- N/A
2023-11-02 11:58:45 -04:00
Julia 17ff881e7a Uncomment lsp2 tests (#3213)
Release Notes:

- N/A
2023-11-02 11:54:06 -04:00
Nate Butler 6f41a77a25 Document format_distance
Adds docs for:
- distance_in_seconds
- distance_string
- naive_format_distance
- naive_format_distance_from_now
2023-11-02 11:53:20 -04:00
Antonio Scandurra fd81d838fe Introduce ViewContext::observe_window_{activation,bounds} (#3212)
Release Notes:

- N/A
2023-11-02 16:44:26 +01:00
Julia b7efab8a55 Uncomment lsp2 tests 2023-11-02 11:42:48 -04:00
Marshall Bowers ec0cff0e1a Add map method to Components (#3210)
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
2023-11-02 11:39:40 -04:00
Antonio ScandurraandConrad Irwin ec4f0d7bca Implement ViewContext::observe_window_activation
Co-Authored-By: Conrad Irwin <conrad@zed.dev>
2023-11-02 16:37:57 +01:00
Antonio ScandurraandConrad Irwin 3a824e468f Subsume observe_fullscreen into observe_window_bounds
Co-Authored-By: Conrad Irwin <conrad@zed.dev>
2023-11-02 16:31:27 +01:00
Nate Butler 5e12b48ae0 Work on default theme, Notifications, Add ListHeader meta (#3203)
Work on default theme, Notifications, Add ListHeader `meta`

Also adds `naive_format_distance` & `naive_format_distance_from_now`

Release Notes:

- N/A
2023-11-02 11:19:48 -04:00
Antonio ScandurraandConrad Irwin de80974a1d Add ViewContext::observe_fullscreen
Co-Authored-By: Conrad Irwin <conrad@zed.dev>
2023-11-02 16:11:52 +01:00
Julia 57fcc22f1c Uncomment db2 tests (#3211)
Release Notes:

- N/A
2023-11-02 11:10:08 -04:00
Nate Butler d4db7a14b3 Remove unused import 2023-11-02 11:04:04 -04:00
Nate Butler 3b91a76159 Merge branch 'main' into n/t2 2023-11-02 11:02:55 -04:00
Nate Butler d48ec7d58e Remove unused import 2023-11-02 11:02:46 -04:00
Nate Butler 6d562aaa6f Use naive_format_distance_from_now in Notifications 2023-11-02 11:02:17 -04:00
Julia 46e81da4e1 Uncomment db2 tests 2023-11-02 11:01:38 -04:00
Nate Butler b76c117979 Update naive_format_distance and tests 2023-11-02 10:37:33 -04:00
Kyle Caverly 5ee2b01102 authenticate with completion provider on new inline assists (#3209)
authenticate with completion provider on new inline assists

Release Notes:

- Fixed bug which lead the inline assist functionality to never
authenticate
2023-11-02 10:14:52 -04:00
Nate Butler cde7b244bc Checkpoint - impl format_distance 2023-11-02 10:11:25 -04:00
KCaverly d5b6300fd7 moved from Boxes to Arcs for shared access of completion providers across the assistant panel and inline assistant 2023-11-02 10:08:47 -04:00
KCaverly b5fe0d72ee authenticate with completion provider on new inline assists 2023-11-02 09:34:18 -04:00
Joseph T. Lyons 5412f20e35 Fix missing commit (collab version bump) 2023-11-02 09:22:12 -04:00
Joseph T. Lyons 971563fd48 Format YAML 2023-11-02 09:05:29 -04:00
Joseph T. Lyons f724b6d032 Cleanly truncate Discord release notes 2023-11-02 09:05:16 -04:00
Antonio Scandurra 6d2e1a8e76 Introduce more GPUI2 APIs needed for transitioning the workspace (#3208)
Release Notes:

- N/A
2023-11-02 11:03:24 +01:00
Antonio Scandurra 76c675a63b 💄 2023-11-02 10:57:29 +01:00
Antonio Scandurra 32db64a049 Introduce more GPUI2 APIs needed for transitioning the workspace 2023-11-02 10:54:33 +01:00
Antonio Scandurra 8793300444 Remove more Send bounds and simplify view rendering (#3207)
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
2023-11-02 10:04:28 +01:00
Antonio Scandurra 9c7b45f38b Add back Send and Sync to AssetSource 2023-11-02 09:58:53 +01:00
Antonio Scandurra d5f0e91faa Remove stray todo 2023-11-02 09:56:45 +01:00
Antonio Scandurra 5e50430299 Fix compile errors 2023-11-02 09:47:21 +01:00
Antonio Scandurra 64ad8943ba Remove more Send bounds and simplify view rendering 2023-11-02 09:44:16 +01:00
Nathan Sobo 6cab5c2885 Restore foreground/background distinction and confine application state to the main thread (#3206)
The potential for deadlock and other complexity ended up convincing us
that the benefits of making the app state accessible from any thread
were not worth their cost. We probably could have gone back to the old
executors, but we decided to fix forward and continue to get the
benefits of the new dispatcher.
2023-11-01 21:29:28 -06:00
Nathan Sobo 64ee1bb7a5 Fix prod compile error 2023-11-01 21:19:06 -06:00
Nathan Sobo 2079cd641e Fix post-merge compile errors 2023-11-01 21:16:41 -06:00
Nathan Sobo db9ccd7f34 Merge remote-tracking branch 'origin/main' into gpui2-no-send 2023-11-01 21:10:31 -06:00
Nathan Sobo 57dfc50687 Get language2 tests passing by not blocking on a foreground task 2023-11-01 21:04:17 -06:00
Nathan Sobo 53066df522 Get project2 tests green 2023-11-01 20:14:40 -06:00
Marshall Bowers aa14552fee Remove unneeded .intos 2023-11-01 22:01:59 -04:00
Marshall Bowers b9ac1e43cd Update scale accessors 2023-11-01 22:00:16 -04:00
Marshall Bowers bd4bff47a0 Merge branch 'main' into n/t2 2023-11-01 21:54:10 -04:00
Marshall Bowers 72d060108d Make indexing into ColorScales safe (#3205)
This PR makes indexing into `ColorScale`s safe by constraining the
`ColorScaleStep`s to a set of known values.

Release Notes:

- N/A
2023-11-01 21:52:42 -04:00
Marshall Bowers 220228c183 Fix underflow when indexing into ColorScales 2023-11-01 21:15:06 -04:00