Commit Graph

431 Commits

Author SHA1 Message Date
Antonio Scandurra
aa09bc527f Allow signing in again if authentication is pending or was unsuccessful
The local server that we spin up to receive OAuth callbacks isn't
called when an error occurs and it is non-trivial to do so with
next-auth. Besides, there could be cases where the user explicitly
closes the browser window before the callback can be invoked.

With this commit, the user can sign in even while an authentication
is still in progress. As opposed to waiting for at most 10 minutes
before killing the local HTTP server if we haven't received the callback,
we will repeatedly check for a response every second for 100 seconds.
This gives us a chance to determine whether a new authentication has started
in the meantime and, if so, abort the current authentication flow.
2022-08-02 14:16:14 +02:00
Antonio Scandurra
df6e733e68 Open both old and new log files, but just retain the last 1000 lines 2022-07-28 10:25:40 +02:00
Keith Simmons
4ff007eaab
Merge pull request #1414 from zed-industries/fix-theme-issues
Fix tab bar themes
2022-07-26 11:55:17 -07:00
K Simmons
2bd0819ac8 Extract tab bar from workspace 2022-07-26 10:41:02 -07:00
Antonio Scandurra
8552ba15dc Show symbols located in visible paths before ones located externally 2022-07-26 14:48:18 +02:00
Julia
888405a4b2
Merge pull request #1409 from zed-industries/middle-mouse-close-tabs
Allow closing tabs with the middle mouse button
2022-07-25 17:05:00 -04:00
ForLoveOfCats
36d789ff84 Allow closing tabs with the middle mouse button 2022-07-25 14:23:38 -04:00
Antonio Scandurra
ca3e73106c Merge branch 'main' into ime-support-2 2022-07-25 10:47:49 +02:00
Mikayla Maki
8c1d4d877f
Merge pull request #1393 from zed-industries/graceful-exit
Polishing the terminal
2022-07-22 13:59:13 -07:00
Antonio Scandurra
7b009c8bbe Merge branch 'main' into ime-support-2 2022-07-22 16:03:38 +02:00
K Simmons
d6519ad280 Minor naming improvements and revert empty pane background color change 2022-07-21 14:56:17 -07:00
Mikayla Maki
c6d5decbf9 Finished erorr terminal refactoring 2022-07-21 12:37:15 -07:00
Antonio Scandurra
97ce3998ec Position IME input according to where the selection is rendered 2022-07-21 17:35:40 +02:00
K Simmons
fb2fbf2ac7 fix test failure 2022-07-20 19:13:16 -07:00
K Simmons
daceb1eb5f Fix warning 2022-07-20 19:02:12 -07:00
K Simmons
225055ed5d Address some issues where panes don't get focused properly, make the focused pane more obvious, and prevent splitting of the pane with no items 2022-07-20 18:52:32 -07:00
Nate Butler
bcc554a3db Merge branch 'main' into theme-improvements 2022-07-19 20:12:02 -04:00
Nate Butler
46384e71b7 Add icon sets for sizes 8, 12 and 16, remove old icons 2022-07-19 17:11:15 -04:00
K Simmons
8add81350e Rework presenter and MouseRegion to use Handler hashmap rather than individual fields 2022-07-17 23:19:32 -07:00
Nate Butler
4ca4449394 Update icons in rust
Updated icons
- Diagnostic states
- Sidebar icons (project, contacts)
- Navigation arrows
2022-07-16 11:51:10 -04:00
Antonio Scandurra
d89465c451
Merge pull request #1356 from zed-industries/differentiate-same-tab-titles
Differentiate among tabs with the same name
2022-07-15 08:30:22 +02:00
Antonio Scandurra
49ef33090c Add test for tab disambiguation 2022-07-14 16:42:30 +02:00
Antonio Scandurra
07d269234f Differentiate among tabs with the same name
This commit introduces a new, optional `Item::tab_description` method
that lets implementers define a description for the tab with a certain
`detail`. When two or more tabs match the same description, we will
increase the `detail` until tabs don't match anymore or increasing the
`detail` doesn't disambiguate tabs any further.

As soon as we find a valid `detail` that disambiguates tabs enough, we
will pass it to `Item::tab_content`. In `Editor`, this is implemented by
showing more and more of the path's suffix as `detail` is increased.
2022-07-14 11:54:11 +02:00
K Simmons
52b29c0928 When tab closed, move to previous tab, and when opening an existing tab, reorder it to be after the current active tab 2022-07-13 20:14:44 -07:00
Antonio Scandurra
9677db9f8f Deploy context menu when clicking on split icon 2022-07-13 12:15:36 +02:00
Antonio Scandurra
c87efb0dbc Show split button at the right edge of the tab bar 2022-07-13 11:44:33 +02:00
Antonio Scandurra
b1e3b38cb3 Don't prompt guest to save when closing window after disconnection 2022-07-12 09:05:39 +02:00
Mikayla Maki
bbd0c0d44d Merge branch 'main' into gpui-changes 2022-07-07 16:08:32 -07:00
Mikayla Maki
9fd2bf2fa1 Updated drag API to pass old,new, instead of delta,new 2022-07-07 16:07:24 -07:00
Max Brunsfeld
6642b78331 Add tooltips to pane nav buttons and make them trigger on click 2022-07-07 13:36:08 -07:00
Mikayla Maki
b2fa511acd GPUI change proposals 2022-07-06 17:52:20 -07:00
Max Brunsfeld
70cf6b4041 Give nav buttons a background on hover 2022-07-06 16:33:44 -07:00
Max Brunsfeld
4e8dbbfd4b Add test for pane nav history covering notification of pane's toolbar 2022-07-06 16:29:11 -07:00
Max Brunsfeld
a378ec49ec Enable and disable nav buttons based on pane's navigation stack
Also, make the `NavHistory` type private to the `workspace` crate.
Expose only the `ItemNavHistory` type, via a method on Pane called
`nav_history_for_item`.
2022-07-06 15:46:43 -07:00
Max Brunsfeld
7e5cf6669f Add forward and backward navigation buttons to toolbar 2022-07-06 14:05:24 -07:00
Max Brunsfeld
a858b3fda9 Treat window deactivation as a focus change for the purpose of autosave 2022-07-06 11:20:29 -07:00
Antonio Scandurra
ab4931da65 Prevent autosave for deleted files 2022-07-06 17:25:33 +02:00
Antonio Scandurra
9286893177 Save item when closing it if autosave on focus change is enabled 2022-07-06 17:04:41 +02:00
Antonio Scandurra
5e00df6267 Move autosave tests down into Workspace 2022-07-06 16:55:05 +02:00
Antonio Scandurra
b937c1acec Move autosave logic up into Workspace and Pane 2022-07-06 16:33:22 +02:00
Max Brunsfeld
8048758990 Add application menu item to open default key bindings 2022-07-05 12:41:38 -07:00
Max Brunsfeld
581c9af395 Adjust pane, tab, panel management bindings to match VS Code 2022-06-29 15:33:46 -07:00
Max Brunsfeld
8fe6809932 Exclude hidden worktrees from project's diagnostic summaries 2022-06-28 14:23:24 -07:00
Antonio Scandurra
57f34c6992 💄 2022-06-28 08:04:39 +02:00
Antonio Scandurra
c6e7ae528f Add test for reopening closed items 2022-06-27 17:59:25 +02:00
Antonio Scandurra
0652542f60 Introduce pane::ReopenClosedItem bound to cmd-shift-t 2022-06-27 17:44:33 +02:00
Antonio Scandurra
a21dbdd0d6 Update window edited status when pane item is removed 2022-06-23 14:28:10 +02:00
Antonio Scandurra
d9b5357234 Always prevent window from closing and manually invoke Workspace::close
This ensures we ask the user to save their state if there are unsaved
changes.
2022-06-23 11:44:14 +02:00
Antonio Scandurra
ca8ddcdeec Set window's edited = true when there are unsaved changes 2022-06-23 10:59:50 +02:00
Antonio Scandurra
137a3996a1 Replace "Remove Folder from Project" label with "Remove from Project` 2022-06-20 10:53:26 +02:00
Max Brunsfeld
dd7b874039 Return focus to the workspace center on escape 2022-06-16 11:30:02 -07:00
Antonio Scandurra
4e4210ac39 Open a buffer for every language server error when clicking on status 2022-06-16 10:00:29 +02:00
Antonio Scandurra
516bd13474 Add tooltip to follow collaborators 2022-06-15 17:08:39 +02:00
Antonio Scandurra
f2a48c6b02 Add tooltips for sidebar buttons 2022-06-15 13:50:04 +02:00
Antonio Scandurra
da1eb91935 Replace pane::Split action with Split{Left,Up,Right,Down}
This allows us to show them in the command palette.
2022-06-15 13:06:59 +02:00
Antonio Scandurra
68093342e7 Broadcast only visible worktree root names 2022-06-14 15:15:23 +02:00
Antonio Scandurra
cfbd8b94d1 Prevent setting files from showing up in project and contacts panels 2022-06-14 14:47:16 +02:00
Max Brunsfeld
b9eb875bf4 Prompt to save changes before quitting the app 2022-06-10 17:26:33 -07:00
Antonio Scandurra
3a69943df3 Require that PartialEq is implemented for Action 2022-06-06 09:18:44 +02:00
Antonio Scandurra
74aa9c1320 Capture mouse events when rendering disconnected overlay
We do so by replacing `EventHandler::capture` with a new `::capture_all` method.
After switching to mouse regions as part of zed-industries/zed#1081, overriding
`dispatch_event` on `EventHandler` wasn't enough anymore because mouse interactions
take place on a privileged code path that runs *before* dispatching any event.

With this change, `EventHandler` will now push a mouse region that intercepts all
mouse interactions, as well as pushing a cursor region that resets the cursor style
to `Arrow`.

One interesting change as part of this is that we've removed the ability to see which
event we are capturing: we were not using this capability anyway and `capture_all` provides
a simpler interface, so I went with that. In the future, we can opt into capturing specific
events or mouse interactions if there's a code path that needs that.
2022-06-04 10:41:29 +02:00
Max Brunsfeld
41b7fd4a27 Rename a public/private to online/offline in a few more places 2022-06-03 17:08:44 -07:00
Max Brunsfeld
e18bc24989 Rename project's 'public'/'private' flag to 'online'/'offline' 2022-06-03 14:39:06 -07:00
Max Brunsfeld
afdd386057 Move persistence and restoration logic from workspace into project
Co-authored-by: Antonio Scandurra <me@as-cii.com>
2022-06-03 11:52:14 -07:00
Max Brunsfeld
6a3a3a1124 Add tooltip to the toggle public button in the contacts panel
Co-authored-by: Antonio Scandurra <me@as-cii.com>
2022-06-03 10:36:29 -07:00
Max Brunsfeld
f7e7a7c6a7 Use rocksdb to store project paths' public/private state 2022-06-02 17:38:33 -07:00
Max Brunsfeld
3ea061a11e Allow making projects private 2022-06-02 17:32:42 -07:00
Max Brunsfeld
7ef9de32b1 Show private projects in the contacts panel
Introduce a ProjectStore that lets you iterate through all open projects.
Allow projects to be made public by clicking the lock.
2022-06-02 17:29:11 -07:00
Max Brunsfeld
a60fef52c4 Start work on private projects 2022-06-02 17:29:11 -07:00
Antonio Scandurra
d180f7a2c3 Jump to primary diagnostic when clicking on header's jump icon 2022-05-31 16:25:14 +02:00
Antonio Scandurra
339069b1d3 Cap MessageStream buffer size to 1MB
We temporarily let it grow when the message size exceed the limit,
but restore the buffer's capacity shortly after. This ensures that,
for each connection in its entire lifetime, we only ever use 1MB.
2022-05-31 11:16:32 +02:00
Antonio Scandurra
20e1044d49 Merge branch 'main' into project-panel-with-new-mouse-events 2022-05-30 18:29:46 +02:00
Max Brunsfeld
a88b4eb3c5 Populate the window title whenever worktrees or active path change
* Refactor the way the project's active entry is assigned. Assign it
  together with the window title, as opposed to on every notification
  from a pane.
* Emit the ActiveItem event from panes consistently, even when adding
  the first item to an empty pane.
2022-05-27 10:51:14 -07:00
Antonio Scandurra
9099c40364 Merge branch 'mouse-events' into project-panel-context-menu 2022-05-27 12:07:00 +02:00
Antonio Scandurra
82d6e606fc Use a MouseEventHandler for activating tabs on mouse down
Previously, we were using an `EventHandler` which doesn't take into
account other mouse regions floating above the rendered element. This
was problematic because, when clicking the `x` icon on a tab that was
not active, we were first activating it and then closing it.
2022-05-27 11:43:58 +02:00
Antonio Scandurra
98de269b4a Don't focus editor when clicking on sidebar resize handle 2022-05-27 11:36:37 +02:00
Nathan Sobo
893f15ddab Switch MouseEventHandler to use MouseRegions
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2022-05-26 20:00:01 -06:00
Antonio Scandurra
5b2d6e41f3 Introduce keyboard navigation in context menus 2022-05-26 16:36:30 +02:00
Antonio Scandurra
991eb742b0 Start adding project panel context menu actions 2022-05-26 15:23:40 +02:00
Nathan Sobo
b110fd5fb7 Render a context menu when right-clicking in project panel
It doesn't currently do anything, but I managed to get it rendering in an absolutely positioned way.
2022-05-26 09:59:25 +02:00
Antonio Scandurra
3ac6fc89c1 Pretty-print JSON of server snapshot 2022-05-26 09:34:39 +02:00
Max Brunsfeld
acf9a59cc2
Merge pull request #1027 from zed-industries/missing-menu-commands
Add missing File menu commands, improve handling of unsaved multibuffers
2022-05-23 21:29:32 -07:00
Max Brunsfeld
ece8604547 Fix comments in Pane::close_items 2022-05-23 18:07:22 -07:00
Max Brunsfeld
0becbe482a Distinguish between singleton and non-singleton workspace items
* Prompt to save singleton items before non-singleton ones
* Don't prompt to save multi-buffers if they contain excerpts to items that are open elsewhere and not being closed.

Co-authored-by: Nathan Sobo <nathan@zed.dev>
2022-05-23 16:03:00 -07:00
Nathan Sobo
d8dbbf1c05 Merge remote-tracking branch 'origin/main' into invite-codes-2 2022-05-23 15:46:39 -06:00
Max Brunsfeld
fbd589b589 Start work on handling multibuffers properly when closing unsaved buffers 2022-05-22 16:48:33 -07:00
Max Brunsfeld
21206800bc Add "Close Window" command 2022-05-20 16:53:03 -07:00
Max Brunsfeld
b08cad9ef5 Add "Save As" command 2022-05-20 16:24:42 -07:00
Max Brunsfeld
8ed33cadeb Add "Add Folder to Project" command to application menu 2022-05-20 16:19:43 -07:00
Max Brunsfeld
e72f5cea22 Add "New Window" command 2022-05-20 11:01:20 -07:00
Antonio Scandurra
0597c662e4 Show contacts panel the first time a new user connects to collab
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-05-20 17:33:09 +02:00
Max Brunsfeld
c4554c1720 Replace build_workspace fn with an initialize function that takes a workspace
This makes it clearer that the function is not providing necessary
dependencies to a workspace, but rather configuring it with all of
the panels and widgets which are defined in downstream crates.
2022-05-19 16:50:22 -07:00
Max Brunsfeld
ef0b584532 Remove AppState from workspace actions
This allows those actions to be bound to keystrokes in the keymap.
Also, remove the WorkspaceParams struct, simplify how Workspaces are
constructed.
2022-05-19 14:37:26 -07:00
Max Brunsfeld
9b29245590 Avoid duplicate notifications
Co-authored-by: Nathan Sobo <nathan@zed.dev>
2022-05-17 11:19:22 -07:00
Antonio Scandurra
8f88803695 Automatically follow host when joining a project 2022-05-17 15:35:57 +02:00
Antonio Scandurra
cc598a6f71 Send LeaveProject when waiting room is dismissed while waiting 2022-05-17 11:25:14 +02:00
Nathan Sobo
d821e7a4c1 Cancel join requests when the requester closes the window 2022-05-16 20:29:36 -06:00
Nathan Sobo
7c3eebf93e Refine messages on waiting to join screen and include host avatar 2022-05-16 16:52:31 -06:00
Antonio Scandurra
ed6ed99d8f Show the reason why a join request was declined
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-05-16 19:57:50 +02:00
Antonio Scandurra
aa90c06012 Display a temporary window while remote project is loading 2022-05-16 17:45:50 +02:00
Max Brunsfeld
be51a58311 Start work on requesting to join projects
Co-authored-by: Nathan Sobo <nathan@zed.dev>
2022-05-12 17:53:11 -07:00