Commit graph

851 commits

Author SHA1 Message Date
Antonio Scandurra
6317e885c7 Don't allow strong view handles to be read/updated with an AsyncAppContext
This avoids an invitation to hold strong view handles across async await
points, which is a common source of leaks.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2023-04-26 13:36:13 +02:00
Antonio Scandurra
689e878bd8 Use a WeakViewHandle in Client for view message handlers 2023-04-26 12:21:02 +02:00
Antonio Scandurra
57beec6071 Allow direct read/update of WeakViewHandle only in AsyncAppContext 2023-04-26 12:20:57 +02:00
Antonio Scandurra
2b6830c798 Remove unnecessary calls to WeakViewHandle::upgrade 2023-04-26 11:13:46 +02:00
Antonio Scandurra
94c2eaad23 Replace ViewContext::spawn with ViewContext::spawn_weak 2023-04-26 10:23:27 +02:00
Antonio Scandurra
7ca412ade3 Merge remote-tracking branch 'origin/main' into fewer-context-traits 2023-04-26 09:54:58 +02:00
Max Brunsfeld
ebbe52e6b0 🎨 Specify more dependencies at the workspace level 2023-04-24 17:41:55 -07:00
Max Brunsfeld
abdccf7393 Use a workspace dependency for the futures crate 2023-04-24 09:43:31 -07:00
Antonio Scandurra
c165fb9be5 Remove ReadView and UpdateView traits
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2023-04-24 17:36:14 +02:00
Antonio Scandurra
a6115d9330 Remove UpdateModel trait
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2023-04-24 16:52:09 +02:00
Antonio Scandurra
a9417f3d2e Remove ReadModelWith trait
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2023-04-24 16:44:54 +02:00
Antonio Scandurra
5f500d34b2 Remove UpgradeModelHandle trait
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2023-04-24 16:40:30 +02:00
Antonio Scandurra
b8fab6fde9 Remove UpgradeViewHandle trait
Co-authored-by: Nathan Sobo <nathan@zed.dev>
2023-04-24 16:33:27 +02:00
Nathan Sobo
e6604d1641 Fix missing actions in the command palette
Previously, the workspace view was on the stack when we were computing the
available actions, which excluded it. This is a stopgap. We should find a
better solution ASAP.
2023-04-21 15:59:29 -06:00
Nathan Sobo
83bf3d071d WIP 2023-04-21 15:36:52 -06:00
Nathan Sobo
55db28e074 Eliminate ReadModel trait 2023-04-21 15:05:19 -06:00
Nathan Sobo
5dac95c47c Eliminate ReadView trait 2023-04-21 15:03:57 -06:00
Nathan Sobo
993dbf86cb Merge remote-tracking branch 'origin/main' into into-element 2023-04-21 14:27:25 -06:00
Nathan Sobo
c1810e8ec9 Fix formatting 2023-04-21 13:09:36 -06:00
Nathan Sobo
fe492eacbf Refine naming of element-related types and traits
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2023-04-21 13:06:37 -06:00
Antonio Scandurra
03619dfa55 Rename Drawable::boxed to into_element and make containers generic
Multi-element are now generic over any drawable child, which can be converted
into an element.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2023-04-21 12:43:19 -06:00
Antonio Scandurra
4ac894ffbe Remove unnecessary lifetime parameter from WindowContext
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2023-04-21 18:06:53 +02:00
Antonio Scandurra
a860a6cd62 Make App::notify_view private
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2023-04-21 16:50:57 +02:00
Antonio Scandurra
8c7f821d14 Introduce a new WindowContext::remove_window API
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2023-04-21 16:39:53 +02:00
Antonio Scandurra
31e906d068 Avoid double borrow of views on up and up_out in DragAndDrop
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2023-04-21 16:19:51 +02:00
Antonio Scandurra
c76b9794e4 Merge branch 'main' into window_context_2 2023-04-21 10:58:08 +02:00
Max Brunsfeld
32c57bcd22 Store buffer's diagnostic sets in a smallvec 2023-04-20 08:58:41 -07:00
Antonio Scandurra
0d5eea8169 Track active window id in test platform
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2023-04-20 17:22:11 +02:00
Antonio Scandurra
d9bb37c649 Add WindowContext::update_default_global
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2023-04-20 17:13:13 +02:00
Antonio Scandurra
c52b6328b7 Merge branch 'main' into window_context_2 2023-04-20 16:01:47 +02:00
Nathan Sobo
5514349b6b Add Component elements 2023-04-18 22:49:06 -06:00
Joseph T. Lyons
614a9c8977
Merge pull request #2377 from zed-industries/add-tab-tooltips
Add tab tooltips
2023-04-18 14:37:38 -04:00
Antonio Scandurra
136e599051 Merge branch 'main' into window_context_2 2023-04-18 17:29:37 +02:00
Antonio Scandurra
31e6bb4fc1 Return Result from AsyncAppContext::update_view 2023-04-18 12:03:53 +02:00
Antonio Scandurra
493a418c91 WIP 2023-04-17 18:52:48 +02:00
Antonio Scandurra
38ab6b123f Make production code compile again 2023-04-17 12:33:33 +02:00
Antonio Scandurra
bed94455b9 Avoid calling focus_in when creating window
This is redundant because when creating a window we will receive
an activation event if the window was effectively focused. And if
it wasn't, we shouldn't call `focus_in`.
2023-04-17 11:57:51 +02:00
Joseph Lyons
ebe57254e0 Add tab tooltips 2023-04-15 06:46:14 -04:00
Max Brunsfeld
c329546570 Extract randomized test CI process into a script 2023-04-14 14:25:55 -07:00
Antonio Scandurra
f09e21aa93 WIP: force using (at least) a window context to update views 2023-04-14 17:08:13 +02:00
Antonio Scandurra
a820862165 Take WindowContext in workspace::ItemHandle methods 2023-04-14 16:36:23 +02:00
Antonio Scandurra
2652f65bee Fix handle_window_activation_effect updating the wrong view 2023-04-14 12:33:13 +02:00
Antonio Scandurra
98dce89379 Pass WindowContext to ViewHandle::is_focused 2023-04-14 12:12:08 +02:00
Antonio Scandurra
74ca223114 Fix formatting for the entire workspace 2023-04-14 12:08:33 +02:00
Antonio Scandurra
33bc47dbe2 Merge branch 'main' into window_context_2 2023-04-14 12:07:09 +02:00
Antonio Scandurra
183b9ef809 Make full-screen and window bounds callbacks take a WindowContext 2023-04-14 11:56:31 +02:00
Antonio Scandurra
7394bf1cdc Fix most of the warnings 2023-04-14 10:51:53 +02:00
Antonio Scandurra
5666e8301e Log an error when a scene fails to build 2023-04-14 10:32:56 +02:00
Antonio Scandurra
9ef79735dc Move more window-specific methods from AppContext to WindowContext 2023-04-14 10:29:35 +02:00
Antonio Scandurra
c62357db02 Fix window activation 2023-04-14 08:24:01 +02:00