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

Cannot drag and drop a tab to the browser's bookmark toolbar anymore #2033

Closed
C4rter opened this issue Sep 13, 2018 · 14 comments
Closed

Cannot drag and drop a tab to the browser's bookmark toolbar anymore #2033

C4rter opened this issue Sep 13, 2018 · 14 comments

Comments

@C4rter
Copy link

C4rter commented Sep 13, 2018

Short description

I'm unable to drag a tab from the TST to anywhere else in the browser. A black "not allowed" kind of sign blocks any interaction with the browser except inside the TST area.
Until recently, I could drag and drop a tab from TST to my bookmarks toolbar. That's not working anymore.

Steps to reproduce

  1. Start Firefox with clean profile.
  2. Install TST.
  3. Open website.
  4. Try dragging the tab onto the bookmark toolbar.
  5. A symbol shows and blocks dropping the tab on the bookmarks toolbar.

Expected result

Dragging the tab to the toolbar and dropping it there should create a bookmark.

Actual result

Unable to drop the tab over over the bookmark toolbar.

Environment

  • Platform (OS): Windows 7
  • Version of Firefox: 62.0
  • Version (or revision) of Tree Style Tab: 2.5.4
@C4rter C4rter changed the title Cannot drag a tab to the browser's bookmark toolbar anymore Cannot drag and drop a tab to the browser's bookmark toolbar anymore Sep 13, 2018
@C4rter
Copy link
Author

C4rter commented Sep 13, 2018

Alright I found it in the Debug section in the settings:
Activating "AllowBookmarkCreationFromDraggedTree" fixed it.

I'm not sure why this is hidden inside the debug section but I'm glad it was somewhere.

@C4rter C4rter closed this as completed Sep 13, 2018
@cameel
Copy link

cameel commented Sep 17, 2018

I've just noticed this behavior too and came here to report it.

Looks like it's intentional, introduced in 59811e8:

Allow to tear off dragged ttree from window by default.
Shift-drag allows to create links or bookmarks from dragged tree.
This commit also introduces a new configuration to invert behaviors for regular drag and shift-drag.

So now we can add bookmarks only while holding Shift (or by turning on this debug option).

Honestly, I liked the old default behavior more. It's already too easy to tear off a tab accidentally by dropping it not in the exact right spot or by going a pixel outside the bookmark menu and having it close on you suddenly. Making it even easier is not what I need. Fortunately there's this setting but it really shoudn't be hidden in the Debug menu given it was the official default behavior just a version ago.

Why not keep the old behavior as default and add an option for switching to the new one?

@piroor
Copy link
Owner

piroor commented Sep 17, 2018

Why not keep the old behavior as default and add an option for switching to the new one?

Because the old behavior depended on a Gecko specific API DataTransfer.mozSetDataAt. It is now deprecated and unavailable on Firefox 63 and later. You still can use the API by a secret preference, but its availability is not guaranteed in future versions of Firefox.

@cameel
Copy link

cameel commented Sep 17, 2018

OK. Thanks for the insight. It makes sense in that case.

Does this mean that creating bookmarks with drag an drop as a whole requires this deprecated API and that Shift + drop will stop working too when they remove the API?

@piroor
Copy link
Owner

piroor commented Sep 17, 2018

Actually the old behavior was built on two technologies: the deprecated "mozSetDataAt" and an internal data type "text/x-moz-place". When URLs are transferred with the data type, Firefox allows to create bookmarks but disallows to create shortcuts on the desktop. However, in this case we need to set each URL via the deprecated "mozSetDataAt" method. Without the method we cannot transfer multiple data with the type. (The public "setData" method allows to transfer just one URL as the type "text/x-moz-place".)

On the other hand, the current version transfers dragged tabs as two types "application/x-treestyletab-tree" and "text/x-moz-url". (Both these types allow to transfer multiple URLs with the "setData" method.)
"application/x-treestyletab-tree" is TST's internal type, it is impossible to be dropped to both the desktop and bookmarks. "text/x-moz-url" is droppable on both the desktop and bookmarks. To allow to detach the tab by dragging, we need to disallow dropping to the desktop. So, when I want to allow detaching of tabs by dragging, TST doesn't set "text/x-moz-url" data type and it also disallows dropping to bookmarks. When I want to allow dropping to bookmarks, TST sets "text/x-moz-url" data type and it also allows to drop tabs to the desktop (to create shortcuts). Those behaviors are sadly exclusive.

@cameel
Copy link

cameel commented Sep 18, 2018

I see. So with this new method you had a choice to either use text/x-moz-url as the default (which breaks tearing off when dropping on desktop) or to use application/x-treestyletab-tree as the default default (which breaks adding bookmarks).

At least now I know that it's just a necessary trade-off between two features rather than a random UI change. I'd personally have preferred to break tearing off but that's simply because I'm rarely ever using that feature. People who use it more would likely disagree.

Thanks for taking your time to explain it. And for making this great extension :)

By the way, I see that the reason they're deprecating mozSetDataAt() is primarily because they think no one is using it:

It's probably too late for them to back off from this change now but I wonder if they would have reconsidered if they knew that Tree Style Tab does rely on it.

On the other hand, the current version transfers dragged tabs as two types "application/x-treestyletab-tree" and "text/x-moz-url". (Both these types allow to transfer multiple URLs with the "setData" method.)

I just tried it and with Shift pressed it adds only one bookmark. Is it a bug?

I can add multiple tabs as bookmarks only when I have allowBookmarkCreationFromDraggedTree enabled.

@piroor
Copy link
Owner

piroor commented Sep 18, 2018

I just tried it and with Shift pressed it adds only one bookmark. Is it a bug?

Oh... it is a bug, not a desired result. I forgot to block selection by Shift-click. You couldn't drag whole tree because just one tab was selected by Shift-click before you start dragging. I must fix this problem in the next release.

Edit: I misunderstood my past work. TST was designed to drag just one tab without descendants when the drag action is started with Shift key. So I need to redesign drag action to keep four different results: dragging one tab for a bookmark, dragging one tab for tearing off, dragging tree for bookmarks, and dragging tree for tearing off.

@piroor
Copy link
Owner

piroor commented Sep 19, 2018

So I need to redesign drag action to keep four different results: dragging one tab for a bookmark, dragging one tab for tearing off, dragging tree for bookmarks, and dragging tree for tearing off.

Now I'm planning to implement a new UI for these operations. The idea is:

  • A small "tab" will appear at the edge of the mouseover tab.
  • When the small "tab" get mouseover state, it will be expanded automatically and there are some draggable handles (with icons?) for different operations:
    1. dragging for tearing off the whole tree.
    2. dragging for bookmarking the whole tree.
    3. dragging for tearing off just one tab.
    4. dragging for bookmarking just one tab.

I think such an visual UI will help people who don't know such secret actions with modifier keys.

@piroor
Copy link
Owner

piroor commented Oct 14, 2018

The tab drag handle is now available on the development build.
https://piro.sakura.ne.jp/xul/xpi/nightly/treestyletab-we.xpi

By pointing on edge of each tab, small palette will appear near the cursor.
screenshot

@C4rter
Copy link
Author

C4rter commented Oct 18, 2018

It stopped working for me in the official version and the debug option is gone.
Shift+Drag still works.

Will this new palette replace the old Drag+Drop feature in the release now or why was it removed?

@piroor
Copy link
Owner

piroor commented Oct 22, 2018

On the latest release version, you can change configs at a new section "Drag and Drop" in the options page.

@C4rter
Copy link
Author

C4rter commented Jan 10, 2019

With the latest version this stopped working for me. I'm unable to drag an drop the tab to the bookmarks.

@piroor
Copy link
Owner

piroor commented Jan 11, 2019

By default you need to shift-drag TST's tab to drop bookmarks. Did you try that?

@C4rter
Copy link
Author

C4rter commented Jan 11, 2019

It started working again today, with and without shift. Don't know what that was yesterday. Sorry for the inconvenience.

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

No branches or pull requests

3 participants