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

add the shortcut "Toggle sidebar" to the plugin #37

Closed
ralf3u opened this issue Jun 15, 2022 · 7 comments
Closed

add the shortcut "Toggle sidebar" to the plugin #37

ralf3u opened this issue Jun 15, 2022 · 7 comments
Labels
enhancement New feature or request wontfix This will not be worked on

Comments

@ralf3u
Copy link

ralf3u commented Jun 15, 2022

condition
before to start to solve this issue, the shortcut name "Toggle between the editor and preview" should be changed to "Toggle between editor and preview" #34 (comment)

behavior
when pressing 1x the shortcut "Toggle sidebar", only the sidebar should appear
when pressing it again, the only-sidebar-view should not be there any more

tab feature
the shortcut "Toggle sidebar" should have exactly the same tab feature like the shortcut "Toggle focus between the editor and preview", so that users are less disoriented; so, when switching focus from the editor to the sidebar, then the Preview-tab should be in foreground, but when leaving sidebar focus, then the foreground of the tab of the sidebar should not change

  • if the editor is in focus while editor and preview is visible, and if there is an other tab of the sidebar than the Preview-tab in the foreground, then, when pressing the shortcut "Toggle sidebar", the Preview-tab should be in the foreground
  • if only the sidebar is visible, and an other tab of the sidebar than the Preview-tab is in the foreground, then, when pressing the shortcut "Toggle sidebar", the tab of the sidebar should not lose the foreground
  • if the sidebar is in focus while editor and preview is visible, and an other tab of the sidebar than the Preview-tab is in the foreground, then, when pressing the shortcut "Toggle sidebar", the tab of the sidebar should not lose the foreground

I don't think that the tab feature need to be programed. I think that it will work automatically when focus feature will work.

focus feature
the shortcut "Toggle sidebar" should have exactly the same focus feature like the shortcut "Toggle focus between the editor and preview", so that users are less disoriented

  • if the editor is in focus, and when pressing the shortcut "Toggle sidebar", the content of the Preview-tab should be in focus
  • if the sidebar is in focus, and when pressing the shortcut "Toggle sidebar", then the highlighted line should appear in the editor, on that place where it was the last time

Maybe the focus feature could be solved with copy & paste of a part of the code of the shortcut "Toggle focus between the editor and preview", because they have both exactly the same focus feature.

crisscross feature
a state file would be good, so that interactions between the shortcut "Toggle sidebar" and the shortcut "Toggle editor" are possible, so that when pressing "Toggle sidebar" and then "Toggle editor", or vice versa, that no empty Geany appears;
so, if "Toggle editor" is active, then first de-activate only-editor-view

alternative
as long as the shortcut "Toggle sidebar" is not part of the plugin, the toggle-editor-scripts can be used (https://github.com/xiota/geanylua-scripts); but the scripts don't offer all the features above

name of the shortcut
In Geany there is the shortcut "Toggle Sidebar". This makes sense, because in Geany the editor is the center while other tools are some kind of accessories, what can be enabled and disabled. But in the plugin Geany Preview the center consists of two items: editor and preview. So, here we have a completely other starting point. Now, before pressing a shortcut in Geany Preview, users have a clear vision of the final result in them heads. And the final result is to see only the sidebar. And that is why the shortcut should be called "Toggle sidebar" and not "Toggle editor", even if it is about disabling and enabling the editor.
By the way, the possible shortcut "Toggle editor" inside the plugin, would correspond to the shortcut "Toggle Sidebar" in Geany, because the final result is to see only the editor, even if it is about disabling and enabling the sidebar.

history
this issue is a continuation of xiota/geanylua-scripts#4

reasons for adding the shortcut to the plugin
I think that the three shortcuts "Toggle focus between the editor and preview", "Toggle Sidebar" and "Toggle editor" are important shortcuts in Geany Preview. And also because they don't need to be personalized, they should be inside the plugin (the shortcut "Toggle focus between the editor and preview" is already part of the plugin). And I think that the shortcut "Toggle sidebar" is easier to develop and to maintain than outside Geany Preview (see down below "possible order of development"). And users will benefit of options that work out of the box.

possible order of development
I think that it is easier to develop first the shortcut "Toggle editor" #38 and then this shortcut, because then somehow the development of this shortcut is something like a copy & paste work (the code for focus feature can be copied from the code "Toggle focus between the editor and preview" ", and the code the for the crisscross feature can be copied from the code of the shortcut "Toggle editor").

@xiota
Copy link
Owner

xiota commented Aug 8, 2022

I would rather leave this as a lua script. Could you explain more succinctly why the script isn't good enough?

@ralf3u
Copy link
Author

ralf3u commented Aug 8, 2022

I would rather leave this as a lua script. Could you explain more succinctly why the script isn't good enough?

The lua-script works fine. The three reasons for this issue are:
1: the lua-script does not offer focus feature (see description above)
2: the lua-script does not offer crisscross feature (see description above)
3: the lua-script does not work out of the box of Geany Preview

I admit that this issue is an advanced feature.

@ralf3u
Copy link
Author

ralf3u commented Oct 11, 2022

focus-feature
For reasons of documentation, I would like to mention that, according to #5 (comment), the focus-feature could be realized in this issue by a kind of copy/paste of the focus-feature of the shortcut "Toggle focus between editor and sidebar":

Not exactly copy/paste, but they're doable.

@ralf3u
Copy link
Author

ralf3u commented Oct 19, 2022

Today I have a better shortcut name than Toggle sidebar:
Toggle between only sidebar and editor/sidebar

@ralf3u
Copy link
Author

ralf3u commented Oct 20, 2022

Today I think it is better not to offer the crisscross-feature to the shortcut, because the shortcut Toggle between only editor and only sidebar offers the crisscross-feature. I recognized today that this would mean less confusion.

So, if the shortcut is active (only sidebar is visible) and if the shortcut #38 is pressed, then nothing should happen.

@xiota xiota added enhancement New feature or request wontfix This will not be worked on labels Feb 25, 2023
@xiota
Copy link
Owner

xiota commented Feb 25, 2023

This is out-of-scope for the preview plugin. The lua scripts provide "good enough" functionality. I'll take a look at them again to see if/how they can be improved.

@xiota xiota closed this as completed Feb 25, 2023
@ralf3u
Copy link
Author

ralf3u commented Feb 25, 2023

I'll take a look at them again to see if/how they can be improved.

Before you look at it again, please give me till tomorrow time to rethink about this shortcut, if the features that I described in this issue are really good.

@xiota xiota closed this as not planned Won't fix, can't repro, duplicate, stale Feb 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants