Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decide which panel should be active for a dock based on ordering panels #22346

Merged
merged 5 commits into from
Dec 30, 2024

Conversation

cole-miller
Copy link
Contributor

This means that workspace::ToggleRightDock will open the assistant if no right-dock panel has been manually activated, instead of the chat as before. Also cleans up the active_panel_index logic a bit.

cc @nathansobo

Release Notes:

  • Make workspace::ToggleRightDock open the assistant panel if no right-dock panel has yet been activated

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Dec 22, 2024
@SomeoneToIgnore
Copy link
Contributor

A minor note: we have a way to disable assistant with

// Whether the assistant is enabled.
"enabled": true,

and implicitly with

"button": true,

people with either of these disabled won't be very pleased with the change, it seems.

Frankly, I am not fold of this too as I prefer the terminal to be there instead, but it's not important.

@cole-miller
Copy link
Contributor Author

@SomeoneToIgnore thanks! I'll look into making this degrade gracefully when the assistant is disabled in settings.

Frankly, I am not fold of this too as I prefer the terminal to be there instead, but it's not important.

I didn't think of this because I always have the terminal open in the bottom dock, not the right. I don't think this should break a workflow where you manually make a terminal active for the right dock and toggle it with the action; and my impression from testing was that in the status quo the chat panel occupies that active slot at startup. Am I missing something?

@SomeoneToIgnore
Copy link
Contributor

SomeoneToIgnore commented Dec 22, 2024

It's another edge case (not important, as stated), where I have

"terminal": {
  "dock": "right"
},

in the settings and clear the DB, making the next startup "default".

@cole-miller
Copy link
Contributor Author

I think the current approach is too heavy-handed; thinking about alternatives.

@cole-miller cole-miller force-pushed the cole/right-dock-tweak branch from b661696 to b00cdef Compare December 30, 2024 00:32
@cole-miller cole-miller changed the title Make the assistant panel initially active for the right dock Decide which panel should be active for a dock based on ordering panels Dec 30, 2024
@cole-miller
Copy link
Contributor Author

Pushed a different approach: all defined panels are given a total order, and if no panel is active for some dock when it is toggled open, the first panel in the set for that dock according to the total order is activated. The order is:

project > terminal > assistant2 > assistant > outline > collab > chat > notifications

This brings the "which panel should be initially active for a dock?" decision under explicit control while hopefully minimizing disruption for users. A natural next step would be to allow configuring this ordering of panels, though I haven't done that here since I'm not sure there's demand for it.

@cole-miller cole-miller added this pull request to the merge queue Dec 30, 2024
Merged via the queue into main with commit dcbff98 Dec 30, 2024
13 checks passed
@cole-miller cole-miller deleted the cole/right-dock-tweak branch December 30, 2024 14:44
helgemahrt pushed a commit to helgemahrt/zed that referenced this pull request Jan 1, 2025
…ls (zed-industries#22346)

This means that `workspace::ToggleRightDock` will open the assistant if
no right-dock panel has been manually activated, instead of the chat as
before. Also cleans up the `active_panel_index` logic a bit.

cc @nathansobo 

Release Notes:

- Make `workspace::ToggleRightDock` open the assistant panel if no
right-dock panel has yet been activated
@AaronFeickert
Copy link
Contributor

Unless I'm misunderstanding what this is intended to do, it doesn't always honor settings. If I set "project_panel": { "dock": "right" } and toggle via the keyboard shortcut, the project panel toggles as expected. But if I set "outline_panel": { "dock": "right" } and toggle via the keyboard shortcut, the outline panel will always be replaced by the assistant panel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants