Commit graph

492 commits

Author SHA1 Message Date
Joseph T. Lyons
6e4268a471 Convert telemetry into a model
Co-Authored-By: Julia <30666851+ForLoveOfCats@users.noreply.github.com>
2023-11-22 16:16:10 -05:00
Joseph T. Lyons
a4a1e6ba98 WIP
Co-authored-by: Mikayla <mikayla@zed.dev>
2023-11-21 22:32:07 -05:00
Conrad Irwin
5d16f76518 fmt 2023-11-20 10:05:57 -07:00
Conrad Irwin
f86480ba5d Merge followup mess 2023-11-20 09:58:05 -07:00
Conrad Irwin
0798cfd58c Merge branch 'main' into derive-element-redux 2023-11-20 09:15:38 -07:00
Conrad Irwin
c0d85dc1dd
Fix text wrapping when a child of a v_stack() (#3362)
Previously text that was rendered in a flex-column would reserve the
correct
amount of space during layout, and then paint itself incorrectly.

Release Notes:

- N/A
2023-11-19 11:37:31 -07:00
Conrad Irwin
0711121586 Add some test cases 2023-11-18 22:16:28 -07:00
Nathan Sobo
33cd6f520a Clean compile with redesigned element traits 2023-11-18 21:51:47 -07:00
Conrad Irwin
cf47ed2c5f Fix wrapping when parent has a max_width
(Also avoid re-wrapping text we already wrapped)
2023-11-18 21:31:16 -07:00
Conrad Irwin
242a0b85b5 Update Taffy to latest main 2023-11-18 21:30:33 -07:00
Conrad Irwin
7172ce37b1 Fix text wrapping when a child of a v_stack() 2023-11-18 20:35:22 -07:00
Nathan Sobo
adc355a1e6 Element refinement passing on ui2 2023-11-18 20:05:47 -07:00
Nathan Sobo
be33f000e2 WIP: Lots of errors, starting on resurrecting derive Element 2023-11-18 00:27:40 -07:00
Nathan Sobo
23ffce9fbe WIP: Work toward eliminating Component trait
This refactor enhances the overall design by promoting reusable and composable UI component structures within the Zed project codebase.
2023-11-18 00:03:23 -07:00
Nathan Sobo
2515bbf990 Move self in Element::paint
Remove mutable state borrows in favor of state ownership in render processes to streamline element rendering.
2023-11-17 23:32:55 -07:00
Mikayla Maki
e1285b9780
Add nightly release channel for zed2 (#3355)
Release Notes:

- N/A
2023-11-17 22:12:18 -08:00
Nathan Sobo
0069dd5ce6 WIP 2023-11-17 20:05:37 -07:00
Mikayla
dd283b471a
Add autoupdate2
co-authoredby: max@zed.dev
2023-11-17 15:48:32 -08:00
Julia
189ddf9380 Merge branch 'main' into unborked-git-zed2-diagnostics-view 2023-11-17 16:43:29 -05:00
Julia
3655a96e54 Merge branch 'main' into unborked-git-zed2-diagnostics-view 2023-11-17 16:32:35 -05:00
Julia
c6d22af416 Get diagnostic2 tests building and running 2023-11-17 16:32:35 -05:00
Julia
a464a7da2a Merge branch 'main' into unborked-git-zed2-diagnostics-view 2023-11-17 16:32:35 -05:00
Julia
f4eb219c75 Get diagnostics view almost building in the zed2 world
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2023-11-17 16:32:35 -05:00
Mikayla Maki
7a8da8ce11
Adjust the type arrangement on ManagedViews (#3354)
Made the trait into a blanket-trait impl if you have it's two
constituent pieces (FocusableView and EventEmitter) to remove the
duplicated method. I also changed the struct to an enum for aesthetic
reasons (EventType::EventName feels self documenting to me) and added
some new `cx` APIs utilizing our new powers of dismissal.

Release Notes:

- N/A
2023-11-17 13:04:57 -08:00
Conrad Irwin
a6d6f8a193
shhh (#3358)
- Fix image errors


Release Notes:

- N/A
2023-11-17 14:01:44 -07:00
Nathan Sobo
c866c211b5 Make static str and SharedString implement Element 2023-11-17 13:48:01 -07:00
Conrad Irwin
6bfe6fa0e1 Fix image errors
* Firstly only log one error per image load, not per frame
* Secondly use an Icon not an image for rendering Icons
2023-11-17 13:47:07 -07:00
Mikayla
149b9d1aa6
Merge branch 'main' into managed-view-adjustment 2023-11-17 12:40:44 -08:00
Conrad Irwin
624bd0a05a
Collab ui2 (#3357)
* Clickable context menus & movable panels – what will they think of
next?!

Release Notes:

- N/A
2023-11-17 13:33:18 -07:00
Conrad Irwin
ceb20dea96 Refactorings 2023-11-17 13:23:12 -07:00
Conrad Irwin
9d742b90c3 Allow you to click on a context menu item 2023-11-17 11:57:51 -07:00
Mikayla
17d53d0e38
Rename again, add fun cx APIs using new traits 2023-11-17 10:06:41 -08:00
Mikayla
01d9d53f4a
Adjust the type arrangement on ManagedViews 2023-11-17 09:51:11 -08:00
Mikayla
1693718637
Merge branch 'main' into saving-2 2023-11-16 23:11:38 -08:00
Mikayla
9a3cd073c7
Restore a bunch of random workspace stuff 2023-11-16 23:05:28 -08:00
Nathan Sobo
2fb13cf1ca
Separate WrappedLines from ShapedLines (#3350)
ShapedLines are never wrapped, whereas WrappedLines are optionally
wrapped if they are associated with a wrap width. Originally, when
rewriting GPUI, I tried to combine everything because wrapping is
inherently optional for the Text element, but we have a bunch of APIs
that don't make sense on a line that may wrap, so we need a distinct
type for that case.

This is a precursor to implementing clickable links in markdown. I
noticed multiple places where we were confused about whether or not the
line was wrapped so this felt important.

Release Notes:

- N/A
2023-11-16 23:20:35 -07:00
Nathan Sobo
9558da8681 Separate WrappedLines from ShapedLines
ShapedLines are never wrapped, whereas WrappedLines are optionally wrapped if
they are associated with a wrap width. I tried to combine everything because
wrapping is inherently optional for the Text element, but we have a bunch of
APIs that don't make sense on a line that may wrap, so we need a distinct type
for that case.
2023-11-16 23:10:51 -07:00
Conrad Irwin
2d1d75f482 +ManagedView
And some games with rust traits
2023-11-16 23:02:10 -07:00
Conrad Irwin
6d4276ea5f Merge branch 'main' into collab_ui2 2023-11-16 22:08:42 -07:00
Conrad Irwin
c0ad15756c More attachment configuration for context menus 2023-11-16 21:59:23 -07:00
Max Brunsfeld
e67c44a562
Fix file-reloading race condition (#3348)
### Summary

This PR fixes a bug that @as-cii and @osiewicz saw when the on-disk
contents of files changed due to running `git checkout` at the command
line. It caused a buffer's contents to diverge from the file's on disk
contents, but the buffer to show an *unmodified* status.

I've also introduced new APIs on gpui's deterministic executor, which
make it possible to write a test that reliably triggered the bug.

### Details

The bug is triggered by the following sequence of events:
1. A buffer's file changes on disk while the buffer is *unmodified*
2. Zed reloads the new content of the file
3. Before updating the buffer itself, Zed computes a *diff* between the
buffer's current contents, and the newly-loaded contents
4. While this diff is being computed, one of two things happens:
     1. the buffer changes on-disk *again*.
2. the user edits the buffer, but undoes the edit, so that the buffer
returns to an unmodified state

The bug itself was caused by a few things:
* The buffer diffing algorithm is pretty slow, because we perform a
character-wise diff
* We previously allowed multiple reload tasks to run concurrently
* When discarding an out-of-date diff, we failed to update parts of the
buffer's state (`saved_fingerprint`) which allow us to recognize that
the buffer's content differs from the file.

It was also difficult to reproduce the problem in tests, because under
deterministic execution, because it was extremely unlikely for other
tasks to make progress *after* a file had been reloaded, but *before*
the disk task has resolved. To help with testing, I introduced a pair of
executor APIs:

`spawn_labeled`, - for spawning a background task with a given *label*
`deprioritize_task` - for forcing tasks with a given label to run
*after* all other concurrent tasks.

I also made the `Model::next_event` test helper method more useful, in
that it no longer runs *until* parked in order to wait for the next
event to occur. It just steps the executor one poll at a time until the
model emits an event.

Release Notes:

- Fixed a bug that caused buffers to report incorrect modified/conflict
status when their buffers changed on disk multiple times in rapid
succession.
2023-11-16 20:19:16 -08:00
Max Brunsfeld
32979f3aca Rename deprioritize_task -> deprioritize
It applies to a family of tasks, not a task.
2023-11-16 20:03:18 -08:00
Max Brunsfeld
f3b6719c76 Rename both PlatformDispatcher::poll and Executor::run_step to 'tick'
Co-authored-by: Nathan Sobo <nathan@zed.dev>
2023-11-16 19:58:26 -08:00
Conrad Irwin
9547e88d88 TEMP 2023-11-16 19:50:31 -07:00
Mikayla
432572c592
#RemoveThe2 2023-11-16 18:04:35 -08:00
Mikayla
4de2c0f7ef
Re-implement actions as derive macros instead of blanket impls 2023-11-16 17:32:02 -08:00
Conrad Irwin
074a221e0f Progress on ContextMenu 2023-11-16 16:59:27 -07:00
Max Brunsfeld
f9650b3111 Don't run until all the way until parked when waiting for a model's next event 2023-11-16 15:54:00 -08:00
Max Brunsfeld
6397c05835 Add the ability to deprioritize specific labeled tasks in tests 2023-11-16 15:54:00 -08:00
Conrad Irwin
9456f716c2 Only send one right click event 2023-11-16 15:30:53 -07:00