Commit Graph
2503 Commits
Author SHA1 Message Date
Max BrunsfeldandNathan Sobo 4436301fa3 Coalesce followed view updates only within one frame
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-22 17:03:24 -07:00
Max BrunsfeldandNathan Sobo b920b865c4 Combine updates from multiple view events when updating followers
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-22 16:22:42 -07:00
Max Brunsfeld a0d18fc007 Allow customizing the pane's following border width in the theme 2022-03-22 13:32:25 -07:00
Antonio Scandurra b6dd7c1662 WIP 2022-03-22 13:35:37 +01:00
Antonio Scandurra cbf7584ad3 Merge branch 'main' into follow 2022-03-22 11:20:55 +01:00
Antonio Scandurra 2fea8a3cda Stop following when leader disconnects 2022-03-22 11:16:04 +01:00
Antonio Scandurra e3bd33a549 Forget last pane's leader when such pane is removed
This is just a memory optimization and doesn't cause any observable
change in behavior.
2022-03-22 11:06:52 +01:00
Antonio Scandurra fa960c0e43 Follow last collaborator or the next one via cmd-alt-shift-f 2022-03-22 10:16:58 +01:00
Antonio Scandurra 3f03d2b641 Stop following when activating a different item on the follower pane 2022-03-22 09:42:37 +01:00
Antonio Scandurra 0de3f0980f Automatically unfollow when editing, scrolling or changing selections 2022-03-22 09:17:01 +01:00
Max Brunsfeld 0cc1f68b61 WIP - Start work on unfollowing automatically 2022-03-21 21:52:28 -07:00
Max Brunsfeld c9aa130958 Show borders around avatars and panes to indicate following state 2022-03-21 15:12:15 -07:00
Max BrunsfeldandAntonio Scandurra 18848bd463 Match the leader's last selection when unfollowing
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-03-21 14:04:55 -07:00
Max BrunsfeldandAntonio Scandurra 3cfde9b2e6 Avoid infinite loop when collaborators follow each other
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-03-21 11:47:00 -07:00
Antonio Scandurra 995149babe 💄 2022-03-21 18:16:06 +01:00
Antonio Scandurra 9300c2add6 Allow unfollowing of leaders by clicking on their avatar 2022-03-21 17:10:23 +01:00
Antonio Scandurra 5e249ad324 Implement Workspace::unfollow
This also changes the structure of the follow state back to be per-pane. This
is because we can't share the same view state across different panes for
a couple of reasons:

- Rendering the same view in N different panes is almost always not something
that we want due to global state such as focus.
- If we allowed it and a user followed the same person in two different panes,
there would be no way of unfollowing in one pane without also unfollowing in
the other.
2022-03-21 16:55:18 +01:00
Antonio Scandurra f04e08eb4b Hide cursor both locally and remotely when following 2022-03-21 15:16:56 +01:00
Nathan Sobo 6a987cedcc Pass project entry id to Pane when opening a project items
This fixes an oversight where we were failing to associate project items with their project entry ids, which broke the logic that prevented the same project entry from being opened twice in the same pane.
2022-03-20 08:54:20 -06:00
Max Brunsfeld 2163cacb0c Handle view updates when following
Basic following now works. Editors' scroll positions
are their only replicated view state.
2022-03-18 15:56:57 -07:00
Max Brunsfeld 0be1a81fbb Allow clicking a titlebar avatar to initiate following 2022-03-18 13:37:07 -07:00
Max Brunsfeld 395d11d98b Allow FollowableItem::to_state_message to return None
This way, we can avoid a panic if we don't handle certain cases,
like a non-singleton editor.
2022-03-18 13:36:05 -07:00
Max BrunsfeldandAntonio Scandurra 70e323e4dc Start work on updating editors's scroll positions when following
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-03-18 12:56:20 -07:00
Max BrunsfeldandAntonio Scandurra a1e22c5feb Rename FollowedItem -> FollowableItem
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-03-18 10:12:51 -07:00
Antonio Scandurra f80a5578ec WIP 2022-03-18 18:07:03 +01:00
Antonio Scandurra 2831546bce Broadcast active view to followers 2022-03-18 16:00:03 +01:00
Antonio Scandurra d5c008d1c3 Allow accessing workspace after adding item to pane 2022-03-18 14:59:53 +01:00
Antonio Scandurra 55322903a9 WIP: Start on sending view updates to followers 2022-03-18 14:20:09 +01:00
Antonio Scandurra d37930e006 Serialize initial follow state in leader and reflect it in follower 2022-03-18 10:22:13 +01:00
Max Brunsfeld 6360072b43 WIP 2022-03-17 17:53:49 -07:00
Max Brunsfeld e42c3a02b0 Start work on an integration test for following 2022-03-17 13:53:06 -07:00
Max BrunsfeldandAntonio Scandurra 41d2ba294f Always read project entry id from workspace::Item
We cannot store a workspace item's project entry id separately,
since buffers' entry ids can change (for example when doing
a *save as*).

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-03-17 10:58:20 -07:00
Max BrunsfeldandAntonio Scandurra b781e2da67 Set up logic for starting following
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-03-17 10:46:54 -07:00
Antonio ScandurraandMax Brunsfeld ab51e04f95 Avoid passing a closure to workspace::register_project_item
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-03-17 17:39:25 +01:00
Antonio ScandurraandNathan Sobo 53d7dfb195 Introduce workspace::register_project_item
This lets downstream crates like `editor` define how project items should be
opened.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-17 15:54:34 +01:00
Antonio ScandurraandNathan Sobo c9524e63a0 Remove Editor::find_or_create
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-17 15:13:47 +01:00
Antonio ScandurraandNathan Sobo e158b79115 Rename app_state to global in gpui
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-17 14:33:01 +01:00
Antonio ScandurraandNathan Sobo 4ead48541f Rename build_editor to build_item in Pane::open_item
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-17 14:31:05 +01:00
Antonio Scandurra ac220025d8 Rename open_buffer_for_path to open_buffer 2022-03-17 11:42:13 +01:00
Antonio Scandurra 88f72360b5 Search only in active pane when using Editor::find_or_create 2022-03-17 11:39:39 +01:00
Antonio Scandurra 7347e68a6d Delete unused code 2022-03-17 11:33:58 +01:00
Antonio Scandurra 60c4428900 Rename ItemView to Item 2022-03-17 11:32:46 +01:00
Antonio Scandurra e2c28d19d1 Finish refactoring of how editors are opened 2022-03-17 11:29:46 +01:00
Nathan SoboandMax Brunsfeld e5b82e80da WIP: Massage opening of editors
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2022-03-16 17:40:09 -06:00
b87e204972 Remove open_item_in_pane
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-Authored-By: Keith Simmons <keith@the-simmons.net>
2022-03-16 16:08:13 -06:00
29ab1f30bc Replace ProjectEntry struct with ProjectEntryId
Previously, we tracked the worktree_id and entry_id separately, but now that entry ids are unique across all worktrees this is unnecessary.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-Authored-By: Keith Simmons <keith@the-simmons.net>
2022-03-16 15:59:47 -06:00
4c7d18530a Remove workspace::Item trait
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Keith Simmons <keith@zed.dev>
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2022-03-16 13:34:06 -07:00
Max BrunsfeldandKeith Simmons d5a8001155 Open settings file in new window if current window isn't local
Co-Authored-By: Keith Simmons <keith@zed.dev>
2022-03-14 17:12:07 -07:00
Antonio ScandurraandNathan Sobo 88ac3564de Re-render workspace when removing an inactive pane
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-14 15:49:08 +01:00
Max Brunsfeld 836480a3e3 Merge branch 'main' into settings-file 2022-03-13 10:43:23 -07:00