Zulip-desktop: Make the org tab list draggable in left sidebar

Created on 28 Aug 2018  ·  13Comments  ·  Source: zulip/zulip-desktop

We should make the organization list in the left sidebar draggable so that users can reorder the added organizations.

image

Something like this -

On a technical level we need to make following changes when the user drags the org tabs -

  • Update the index of org in the menu item

image

  • Update the index of org in the left sidebar

  • Update the tooltip

High Enhancement help wanted

All 13 comments

sortable.js is usually the way to do this sort of reordering.

@zulipbot claim

@timabbott I'm sorry, I don't understand. What do you mean when you say sortable.js? I can't find any file by that name in the repo.

sortable.js is a JavaScript library for reorderable drag-and-drop ( they have a repo on GitHub) . Akash has already done a lot of work on this, you can check out the org-tab-drop branch in this repo and then continue from there.

@kanishk98 yeah the dragging part is done in the org-tab-drag. The remaining part is -

  • Update the tooltips
  • Update the index of the orgs

I've been trying to solve the tooltips problem, and I'd like some clarity here:
the initTabs() method in app/renderer/js/main.js calls initServer() using the following code:

const servers = DomainUtil.getDomains();
if (servers.length > 0) {
    for (let i = 0; i < servers.length; i++) {
        this.initServer(servers[i], i);
        DomainUtil.updateSavedServer(servers[i].url, i);
        this.activateTab(i);
    }

If we're looking to update the server icons, should we also be changing the json file containing domain information?
(Since DomainUtil.getDomains() uses that file to pass domains to servers)

I think in order to get everything right, we gotta save the index of the domain otherwise it would be difficult to keep track of all the indexes after dragging/reloading etc.

Hello @kanishk98, you have been unassigned from this issue because you have not updated this issue or any referenced pull requests for over 14 days.

You can reclaim this issue or claim any other issue by commenting @zulipbot claim on that issue.

Thanks for your contributions, and hope to see you again soon!

I'm still on the issue, just been unwell these past few days. The cold's got to me, sorry. I'll get back to work on this tomorrow.

@zulipbot claim

Hello @manavmehta, it looks like you've currently claimed 1 issue in this repository. We encourage new contributors to focus their efforts on at most 1 issue at a time, so please complete your work on your other claimed issues before trying to claim this issue again.

We look forward to your valuable contributions!

@zulipbot I have already made two PRs that are pending for review. Also I am working on both of the issues.
Please allow me to take this one up too.

@manavmehta sure go ahead. I would suggest to build up on PR #617.

Was this page helpful?
0 / 5 - 0 ratings