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

How to disconnect the field on the new GhostText? #178

Open
fregante opened this issue Jan 27, 2021 · 6 comments
Open

How to disconnect the field on the new GhostText? #178

fregante opened this issue Jan 27, 2021 · 6 comments

Comments

@fregante
Copy link
Owner

Originally posted by @subnut in #172 (comment):

If a field is currently connected, then clicking the GhostText extension icon and selecting the connected field should disconnect it.

Yeah the current disconnection logic isn't super clear. In the previous version you would just click the button again and it would disconnect, but now it just looks for more fields.

So the solution I came up with is to right click the button 😬 or to just close the editor tab (which would make more sense, since you're done with it so you want to go back to the browser)

Does anyone have any suggestions for an intuitive way to disconnect the editor from the browser?

@subnut
Copy link
Contributor

subnut commented Jan 27, 2021

I think that the current method is sufficient...
but I think that it would be more intuitive if clicking on the extension caused us to enter Toggle mode instead of Register new element mode. i.e. Clicking on an already-enabled field should disable it, and clicking on a non-enabled field should enable it

@llinfeng
Copy link

@fregante Ideas to disconnect:

  1. How about adding another keyboard shortcut to disconnect? From a couple of months ago, I recall hitting the same (and only) shortcut shall toggle the text fields on and off. For now, hitting the shortcut for "Connect to GhostText" no longer disconnects. The downside is that now we need to remember another key-binding.

  2. Personally, I would prefer having an option with the add-on that restores the old behavior. Maybe we can call it "toggle mode"? With one single shortcut, I enter and edit, and hit it again when done. I use GhostText mostly with Jupyter notebooks.

@fregante
Copy link
Owner Author

fregante commented Feb 24, 2021

  1. How about adding another keyboard shortcut to disconnect

I like that. Keyboard shortcuts are cheap, as long as I can register an action without setting a default shortcut (so it's up to the user to customize it)

2. I would prefer having an option with the add-on that restores the old behavior

I feel you, the simplicity was good. I wonder if that should be the regular behavior, while still allowing multiple fields by:

However this would mean that the first Activation would work one way, and the next activations would work differently… a bit confusing.

@fregante
Copy link
Owner Author

fregante commented Feb 24, 2021

Makes me wonder if GT should exclusively handle focused fields:

  • if a field is focused, toggle it

That's it. Simple. No field focused = do nothing.

You must select the field first and then you activate GhostText. This should simplify the code too, because there's no more "Focus (another) field to activate" state.

Perhaps with an additional behavior:

  • if nothing is focused, disconnect all (or leave all disconnected)

Full flow chart: https://user-images.githubusercontent.com/1402241/108940258-a2598300-7618-11eb-902f-b704c5a02c5a.png

@llinfeng

This comment has been minimized.

@fregante
Copy link
Owner Author

Right-clicking is a bit awkward and doesn't work when the icon is in a menu on Safari (it used to be the same in Chrome, but they added hamburgers now)

Screenshot

I think GhostText should have a minimal UI to allow disconnection. This would appear sticky on the page:

225006670-b8294791-1344-42e2-bd42-dcdd9bfa923e

The only concern is integrating it with the notifications. Maybe:

  • no "connected" notification:
    notify('log', 'Connected! You can switch to your editor');
  • add "Switch to your editor" message in the UI (+ "Hide this" button so that it won't appear anymore)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants