Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Reorder Working Set with Drag and Drop #1846

Closed
wants to merge 48 commits into from
Closed

Reorder Working Set with Drag and Drop #1846

wants to merge 48 commits into from

Conversation

TomMalbran
Copy link
Contributor

This add the ability to reorder the files in the working set by dragging then up or down.

@peterflynn
Copy link
Member

I think you'll need to change the order in the underlying model too (DocumentManager). Otherwise when you restart Brackets it will restore the old order (and you'll get other funny behavior, like closing a file won't switch to the item next to it).

@TomMalbran
Copy link
Contributor Author

Yes, I'll figure I would need to do that, but I didn't research on it, and for some reason my Brackets doesn't restore the previous session now, not sure why because I think it worked before.

@redmunds
Copy link
Contributor

Try clearing your cache: https://github.com/adobe/brackets/wiki/Cache-Folder

@TomMalbran
Copy link
Contributor Author

Thank you redmus, that worked.

Now the code changes the workingSet, but it doesn't change the cache. Will look how to add that too.

@ghost ghost assigned redmunds Oct 21, 2012
@@ -175,7 +272,12 @@ define(function (require, exports, module) {
_updateListItemSelection($newItem, curDoc);

$newItem.mousedown(function (e) {
FileViewController.openAndSelectDocument(file.fullPath, FileViewController.WORKING_SET_VIEW);
// Try to reorder only with the right click and just open the file in other cases
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean left click, not right click, correct?

@redmunds
Copy link
Contributor

When dragging, I think it's a bit confusing, and possibly dangerous, to keep the mouse capture when mouse goes outside Brackets app. I think you should perform drop in MouseLeave event. Even within Brackets app, it's probably not necessary to track mouse outside of working set container.

@TomMalbran
Copy link
Contributor Author

It scrolls into view only if you are dragging the selected item out of view. Could also be added if the selected elements scrolls out of view, but can feel weird if you are not dragging that item, specially if the selected item wasn't in the view before dragging.

I've been trying to rebase, but I end up with errors from several commits. Should I combine only my commits or every commit that appears from the merging with the master branch?

@redmunds
Copy link
Contributor

I am not seeing any auto-scrolling on Win7. Here's what I'm trying:

  1. Double-click on each of the 12 files in src/widgets so they're all in Working Set
  2. Make sure Working Set is scrolled to top
  3. Slowly drag top file down to and then past bottom position

Results
I can drag file past bottom where I can't see it any longer. Working Set never scrolls. File is dragged past last visible file, but I can't drag it all the way to the last position.

Expected
When dragging over the last visible position, and there are more items that can be scrolled to, the Working Set automatically scrolls down until I drop file or move back up away from bottom. Note that getting scrolling speed right is tricky: too fast scrolls through the whole list before you can drop and too slow takes too long.

@redmunds
Copy link
Contributor

For rebasing, you only want to use your commits.

@TomMalbran
Copy link
Contributor Author

Ok, I see what is expected. I'll try to see how to work it out. I was just scrolling once the item was dropped, not allowing to use drag and drop outside of the visible area.

I'll try again to rebase after the next commit.

@TomMalbran
Copy link
Contributor Author

This time i added the scrolling while dragging. I also had to disable the mousewheel just when dragging to avoid weird behaviors. I moved the close to the reorder function, but is only called if the item isn't really moved, same as open. So now is possible to leave the close icons while dragging.

@TomMalbran
Copy link
Contributor Author

I did the rebase, what should I do next?

@redmunds
Copy link
Contributor

This looks great. You'll need to submit a new pull request with your new (should be single) commit. Then we can close this pull request. If possible, add a reference to this pull request in the new one so this history is not lost.

@TomMalbran
Copy link
Contributor Author

I made a mess with this branch and didn't new sure how to fix it, so I just started from 0, made a new branch and a new commit with all the changes. I'll close this pull request and make a new one.

@TomMalbran TomMalbran closed this Oct 25, 2012
humphd pushed a commit to mozilla/brackets that referenced this pull request Mar 20, 2017
* Remove key binding

* Commit changes

* indent fixes

* Changes - that add new for next/prev page [OSX]

* Remove key-binding next/prev

* Indent changes

* mend
Rajat-dhyani pushed a commit to Rajat-dhyani/brackets that referenced this pull request Apr 20, 2017
* Remove key binding

* Commit changes

* indent fixes

* Changes - that add new for next/prev page [OSX]

* Remove key-binding next/prev

* Indent changes

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

Successfully merging this pull request may close these issues.

7 participants