-
Notifications
You must be signed in to change notification settings - Fork 346
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
Implement container reordering #1608
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I cherry-picked your commit, built it and tried it. Seems to work as intended.
npm run test
seems to be flaky, but that goes for master too ("should uncancel after 2 seconds" fails with "Error: Timeout of 2002ms exceeded.").
src/js/popup.js
Outdated
@@ -908,6 +922,53 @@ Logic.registerPanel(P_CONTAINERS_EDIT, { | |||
const tr = document.createElement("tr"); | |||
fragment.appendChild(tr); | |||
tr.classList.add("container-panel-row"); | |||
tr.draggable = true; | |||
tr.dataset.containerId = identity.cookieStoreId; | |||
tr.addEventListener("dragstart", e => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tr.addEventListener("dragstart", e => { | |
tr.addEventListener("dragstart", (e) => { |
Just to remain consistent with other code in this repo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
src/js/popup.js
Outdated
if (droppedElement && droppedElement !== tr) { | ||
tr.classList.remove("drag-over"); | ||
parent.insertBefore(droppedElement, tr); | ||
const containerOrder = {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part from 961-969 of saving the order feels like it should be a separate function probably.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems great to me!
Included a few comments, I would prefer we simplify the storage etc.
Would you be interested in implementing this also into firefox as a follow up? (I'm happy to help mentor this).
@jonathanKingston I fixed some stuff according to your suggestions, please take a look
I'm not sure, how does that work? do I create a PR in the Firefox repo and add you as a reviewer? |
This needs to happen |
I would be much appreciated if this PR is approved 🙏 Thanks for your awesome job! |
Query: will the new order chosen here be reflected when the "sort tabs" button is clicked? At least from my previous experimenting, changing the order in containers.json does not affect that other ordering, and I wonder if this is any different. |
Bump on this! It would certainly be very helpful. I'll even help out with testing if need be. Thanks for this. Hopefully it gets approved soon. |
Any progress on approvals? |
@jonathanKingston What's the review process like? Can you approve this, or do we need someone else from Mozilla to look at it too? |
Maybe @maxxcrawford can help with reviewing and merging, or comment situation? He do last merge recently. |
Anyone to approve this? Can we help? |
There are conflicts in @sryze, could you rebase to fix this? |
This looks great! Hope you're able to do the fix @sryze and get the approval... good work! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sryze This will need to be caught up with the main branch, as there are new UX/UI revisions. Can you catch it up and confirm it works as expected in the new layout?
@MurzNN Thanks for the tag. Reviewed! |
@madalincm I will try to fix the conflicts today. |
Your efforts are appreciated |
@maxxcrawford It says that you have requested changed, but I see no lingering comments. Perhaps you need to review again? |
Can we have this feature, please? |
Please can we have this feature, I have over 30 containers now and it's getting hard to find the right one when needed :( |
Since this is getting close to a year since publication, I would very much appreciate a statement from Mozilla explaining why this is not getting any traction. Is the feature unwanted or is it hard to merge for some technical reason? In the world of CI/CD, this seems to lack the C. |
What's the status of this PR? Can we get this feature in 2021? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sryze This is ready to merge in, pending the dark mode we added today. Could you please resolve the conflicts one more time? After that, we can add this in! (But also, be sure this looks/works as expected in dark mode)
@maxxcrawford it's 2021, you get paid to do this, after Mozilla dragged their knuckles for a literal year why don't you just fix the conflicts and merge it in? |
@duoi hey dude, that's super rude and uncalled for. A lot of us share in your frustration but that's no way to talk to someone in OSS. |
Thank you @jc00ke. @duoi - this project's Code of Conduct is the Mozilla Community Participation Guidelines which state:
Don't make statements that personally attack a member of this project, or you will be banned from participation. |
Done |
@groovecoder didn't personally attack anybody, I literally just asked why he doesn’t fix the merge conflict himself. That’s not a personal attack any more than this comment is lol. Anyway, let’s not derail. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code and spot-check looks good.
(I tested in dark mode.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sryze This is great. Merging in now. Thanks for all the hard work on this.
When will this release to production? |
@urda It already is released to production. |
@nicolasbadia Ah guess my add-ons haven't updated yet! Just got the latest and greatest and re-ordering my containers! As promised, donation sent: |
I'm so happy! Thank you all so much for making this happen. Was this issue open a long time? Sure. Do I give a sh.... not anymore! I really appreciate the push towards the end from those responsible for code review and getting this into production. 🙏 🙏 🙏 |
@urda If you add-ons are not set to update automatically, you can update them by going to |
Hi @placoderm, your screenshot is from Firefox's settings, whereas this update affected the extension menu (install the extension from here if you don't have it yet). You can then re-order containers by opening the menu (pictured here) and clicking "Manage Containers" at the bottom. |
@Vinnl Thanks for the super fast reply. I wasn't seeing that at the bottom of the list. I had to zoom waaaaay out to see it. I have moved one of the containers to the top (the yellow sun glasses) However, when I press and hold the Any ideas? |
@placoderm Be frankly I didn't know that holding But I can confirm that this is a bug... I rearranged my containers months ago and now I see that list in main menu and behind of This thread is pull request related. I suspect it will not be visible for big audience. So I would propose to move it to separate issue where you could describe use case in details, provide screenshots and people could vote for fixing it. Here you could drop a comment with reference to the issue you will create. |
This is just a small patch that makes it possible to move / reorder containers via drag&drop.
I added a third button next to the edit (pencil) button that allows users to drag a container and insert it before another container. Container positions are saved in the browser's local storage.
I got the icon from the Mozilla Foundation Icon Font.
Related issue: #330
Example:
firefox_multi-account_containers-6.1.1.zip