-
Notifications
You must be signed in to change notification settings - Fork 67
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
Ability to re-order accounts #1494
Ability to re-order accounts #1494
Conversation
e4c9468
to
3c3bfe5
Compare
3c3bfe5
to
1d38752
Compare
Thanks for doing this, and all the work with regards to database migrations for anonymous accounts! I just did a very quick code review of the changes, and I do want to bring up some potential changes regarding the architecture (if you agree with it of course!) Do you have any thoughts on perhaps merging Accounts and Anonymous Instances together? For example, we could add a new column ( My main thought surrounding this is that:
I do understand that this would require a lot of changes to the current PR, which is why I wanted to bring it up for discussion! I'm also bringing this up here because I think it'll be easier to change it now rather than later down the road if we do decide otherwise (since we'll have to deal with more complicated database migrations) |
Pinging @micahmo in case you didn't see my previous comment! |
Hey, sorry, I thought I already responded to this thread! I totally agree that anonymous instances could be in the same table as accounts. We could even use the JWT being null as an indicator that it's anonymous (if we didn't want to add another column). But either way, as you said, this should open up a lot more possibilities. (Although, personally, I do like distinguishing the types of accounts in the profile switcher, even if they're stored the same way under the hood.) What I was going to suggest was doing the database migration in a separate PR, and then once everything's in the same table, we can add the UI for re-ordering. |
Thanks for the response!
I agree with you here - I think separating them on the profile switcher makes things cleaner and more organized
Sounds good! |
Would you be ok with reviewing and merging #1495 before I do any more database changes (as you have time, of course). The reason I ask is because, not only did I add another migration there, which would conflict here, but I also reversed the order of the downgrades. They should have been in descending version order all along, but it was just an oversight on my part. I only realized it when I tried to delete a column after the table had been dropped 😆 Anyway, having that one merged would create a good clean slate for the next round of changes. |
Done! |
ae3683a
to
3343607
Compare
2e13a50
to
684e7e2
Compare
684e7e2
to
488982f
Compare
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.
Just did a quick glance at it, but it looks good!
Pull Request Description
The PR allows accounts and anonymous instances to be manually re-sorted in the account switcher modal. To accomplish this, a new
index
column has been added to the database table (where the initial value is based on the ID, so the initial order should be the same after upgrading). The account entries have been made sortable usingSliverReorderableList
. When the order is manually changed, all IDs are re-calculated, so there are no gaps. When a new account/instance is added, its index is the highest current index + 1.Notes:
P.S. I haven't looked yet, but I'm assuming there will be some database conflicts with #1492. Not sure who should go first. :)
Issue Being Fixed
Issue Number: #1488
Screenshots / Recordings
qemu-system-x86_64_XoWdVEcvKN.mp4
Checklist
semanticLabel
s where applicable for accessibility?