zulip-desktop
zulip-desktop copied to clipboard
Reorder sidebar org list by dragging
Rebase and update PR #617 to master.
Feature works as expected, tested upto 5 organizations.
I haven't gone through the code and logic yet, and would soon do so, but I would encourage you to test the feature as is now and report in usability issues and mishappenings.
@akashnimare is it possible for you test this out ?
The code logic looks fine to me and the feature is working. The PR can be reviewed and ready for merging if approved.
cc @andersk @timabbott .
Awesome, thanks for rebasing @abhigyank! @andersk do you have time to review this? I think it's one of the top few features users want in the desktop app.
We have far too many indices flying around to be confident that it would be correct to start mutating them:
-
ServerManagerView#activeTabIndex
-
ServerManagerView#tabIndex
-
ServerTab#index
-
ServerTab#tabIndex
-
SettingsOptions.lastActiveTab
-
WebView#index
-
WebView#tabIndex
- the
data-tab-id
attribute - the
index
closed byServerTab#onHoverOut
- the
index
closed byServerTab#onHover
- the
index
closed byWebView#isActive
- the indices of
DomainUtil.getDomains()
- the indices of
ServerManagerView#tabs
- the indices of
document.querySelectorAll(".server-icons")
- the indices of
document.querySelectorAll(".tab .server-icons")
- the indices of
document.querySelectorAll(".tab .server-tooltip")
- the values of
ServerManagerView#functionalTabs
Before I’ll accept any PR that allows organizations to be reordered, I want as many of these indices as possible to be replaced by stable identifiers that do not change under reordering.
(A good example of a stable identifier is the reference to the Tab
object itself. We could probably solve many of these problems by storing direct object references to the Tab
instead of indirect numerical references to one of its indices.)
Heads up @abhigyank, we just merged some commits that conflict with the changes your made in this pull request! You can review this repository's recent commits to see where the conflicts occur. Please rebase your feature branch against the upstream/main
branch and resolve your pull request's merge conflicts accordingly.
Is this merged? i would like to take on the issue @akashnimare @abhigyank