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

Implement container reordering #1608

Merged
merged 1 commit into from
Jan 22, 2021
Merged

Implement container reordering #1608

merged 1 commit into from
Jan 22, 2021

Conversation

sryze
Copy link
Contributor

@sryze sryze commented Dec 25, 2019

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-container-reordering

firefox_multi-account_containers-6.1.1.zip

Copy link

@lindhe lindhe left a 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 Show resolved Hide resolved
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 => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
tr.addEventListener("dragstart", e => {
tr.addEventListener("dragstart", (e) => {

Just to remain consistent with other code in this repo

Copy link
Contributor Author

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 = {};
Copy link
Contributor

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.

src/js/popup.js Outdated Show resolved Hide resolved
src/js/popup.js Outdated Show resolved Hide resolved
Copy link
Contributor

@jonathanKingston jonathanKingston left a 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).

@sryze
Copy link
Contributor Author

sryze commented Feb 1, 2020

@jonathanKingston I fixed some stuff according to your suggestions, please take a look

Would you be interested in implementing this also into firefox as a follow up? (I'm happy to help mentor this).

I'm not sure, how does that work? do I create a PR in the Firefox repo and add you as a reviewer?

@Laurensdc
Copy link

This needs to happen

@idoleat
Copy link

idoleat commented Mar 14, 2020

I would be much appreciated if this PR is approved 🙏 Thanks for your awesome job!

@jwdevel
Copy link

jwdevel commented Apr 10, 2020

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.

@jrdnrch
Copy link

jrdnrch commented May 15, 2020

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.

@aghassemlouei
Copy link

Any progress on approvals?

@lindhe
Copy link

lindhe commented Jun 9, 2020

@jonathanKingston What's the review process like? Can you approve this, or do we need someone else from Mozilla to look at it too?

@MurzNN
Copy link

MurzNN commented Jun 10, 2020

Maybe @maxxcrawford can help with reviewing and merging, or comment situation? He do last merge recently.

@nicolasbadia
Copy link

Anyone to approve this? Can we help?

@heitorPB
Copy link

There are conflicts in src/css/popup.css and in src/js/popup.js.

@sryze, could you rebase to fix this?

@gethubb
Copy link

gethubb commented Jul 7, 2020

This looks great! Hope you're able to do the fix @sryze and get the approval... good work!

@maxxcrawford maxxcrawford self-requested a review July 7, 2020 14:55
Copy link
Collaborator

@maxxcrawford maxxcrawford left a 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?

@maxxcrawford
Copy link
Collaborator

@MurzNN Thanks for the tag. Reviewed!

@sryze
Copy link
Contributor Author

sryze commented Jul 11, 2020

@madalincm I will try to fix the conflicts today.

@urda
Copy link

urda commented Jul 11, 2020

@madalincm I will try to fix the conflicts today.

Your efforts are appreciated

@sryze
Copy link
Contributor Author

sryze commented Jul 11, 2020

Merged with master, in the new version the "move" buttons will be shown inside the "Manage Containers" menu:

firefox-container-reordering

Also I couldn't get the top black border effect to work for some reason... so now containers are simply highlighted in gray when you drag over them.

@lindhe
Copy link

lindhe commented Aug 5, 2020

@maxxcrawford It says that you have requested changed, but I see no lingering comments. Perhaps you need to review again?

@Makishima
Copy link

Can we have this feature, please?

@mahalel
Copy link

mahalel commented Aug 26, 2020

Please can we have this feature, I have over 30 containers now and it's getting hard to find the right one when needed :(

@lindhe
Copy link

lindhe commented Nov 22, 2020

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.

@urda
Copy link

urda commented Jan 1, 2021

What's the status of this PR? Can we get this feature in 2021?

Copy link
Collaborator

@maxxcrawford maxxcrawford left a 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)

@duoi
Copy link

duoi commented Jan 21, 2021

@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?

@jc00ke
Copy link

jc00ke commented Jan 21, 2021

@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.

@groovecoder
Copy link
Member

Thank you @jc00ke.

@duoi - this project's Code of Conduct is the Mozilla Community Participation Guidelines which state:

frustration should never turn into a personal attack

Don't make statements that personally attack a member of this project, or you will be banned from participation.

@sryze
Copy link
Contributor Author

sryze commented Jan 21, 2021

@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)

Done

@duoi
Copy link

duoi commented Jan 21, 2021

@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.

Copy link
Member

@groovecoder groovecoder left a 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.

@groovecoder
Copy link
Member

(I tested in dark mode.)

Copy link
Collaborator

@maxxcrawford maxxcrawford left a 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.

@urda
Copy link

urda commented Feb 2, 2021

When will this release to production?

@nicolasbadia
Copy link

@urda It already is released to production.

@urda
Copy link

urda commented Feb 2, 2021

@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:

image

@jc00ke
Copy link

jc00ke commented Feb 2, 2021

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. 🙏 🙏 🙏

@maxxcrawford
Copy link
Collaborator

@urda If you add-ons are not set to update automatically, you can update them by going to about:addons and clicking on the gear icon and selecting "Check for updates"

image

@placoderm
Copy link

I am running 8.0.6 version of the plugin and I don't see the handles to re-arrange the containers.
Any idea what I am doing wrong? FF 98.0.1
image

Sorry if this isn't the right place to ask this question.

@Vinnl
Copy link

Vinnl commented Mar 25, 2022

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.

@placoderm
Copy link

@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)
image

However, when I press and hold the + button to open a new container, the possition hasn't changed. You can see it still in its original place:

image

I have closed and restarted FF.

Any ideas?

@achernyakevich-sc
Copy link

@placoderm Be frankly I didn't know that holding + shows list of containers that you could open tab for. :)

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 + button sorted different way.

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.

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

Successfully merging this pull request may close these issues.