RetroShare / RSNewWebUI

30 stars 20 forks source link

Added mailcompose, tags, search #50

Closed Sukhamjot-Singh closed 2 years ago

Sukhamjot-Singh commented 2 years ago

Tries to fix issue #39

Sukhamjot-Singh commented 2 years ago

mail1 mailcompose

Some screenshots for reference

csoler commented 2 years ago

Looks very cool (I tried it). Shall we merge this right away, or would you like to make some more progress on it? (The PR is not very large so it's fine to keep working on it)

rottencandy commented 2 years ago

Should we be using a popup for composing mail? It's not resizable/movable at this point and might be a bit too small for writing mails. What if we used a full page for it instead?

defnax commented 2 years ago

normaly best popup mode but the dialog is to small, would be nice bigger default size and resizable. im not jure if its possible in popup mode have bigger size?

defnax commented 2 years ago

example the fullscreen composer mode from google its uses 80-90% of the page

image

rottencandy commented 2 years ago

normaly best popup mode but the dialog is to small, would be nice bigger default size and resizable. im not jure if its possible in popup mode have bigger size?

Popup is of fixed size and not movable presently, adding support for resizing would require quite a bit of refactoring. And we would also have to move it into the auto-redrawing system.

I think a full-page composer would be easier to implement at this point.

defnax commented 2 years ago

then it needs bigger fixed size

Sukhamjot-Singh commented 2 years ago

@rottencandy @defnax @csoler I have increased the size for the compose dialog box. Please review and suggest changes. image

defnax commented 2 years ago

i would make little bigger on the left you have more space 150-200 pixel image

defnax commented 2 years ago

it looks ok now but wondering why it doesnt centered? left and right has different spacing

Sukhamjot-Singh commented 2 years ago

it looks ok now but wondering why it doesnt centered? left and right has different spacing image

I will fix this issue. It should be centered.

defnax commented 2 years ago

any news?

Sukhamjot-Singh commented 2 years ago

any news?

Yes, I will commit more tomorrow. I was a bit busy with college assignments.

Sukhamjot-Singh commented 2 years ago

image I am calling getIdDetails API with the correct srcID of the mail. It is returning me the same object each time, which is when I send Retroshare id ("32 zeroes"). image

csoler commented 2 years ago

If I remember correctly, this is because the srcId is not a RsPeerId but a RsGxsId. We did not want at this time to use a complex type since the usage of RsPeerId for mail is deprecated, but still wanted to keep backward compatibility. So what you need to do is first look into rsgxsid_srcId and if null then use rspeerid_srcId.

Sukhamjot-Singh commented 2 years ago

If I remember correctly, this is because the srcId is not a RsPeerId but a RsGxsId. We did not want at this time to use a complex type since the usage of RsPeerId for mail is deprecated, but still wanted to keep backward compatibility. So what you need to do is first look into rsgxsid_srcId and if null then use rspeerid_srcId.

I have and printed and used rsgxsid_srcId to call the API. I cannot pinpoint the mistake. image image

csoler commented 2 years ago

seems that getIdDetails returns false. That would mean the ID is not known, or most probably not in the cache. If so, calling getIdDetails later will give a correct result. We did not want to have a blocking API for getIdDetails as it was not needed for the Qt UI. Can you cope with this in JS?

Sukhamjot-Singh commented 2 years ago

seems that getIdDetails returns false. That would mean the ID is not known, or most probably not in the cache. If so, calling getIdDetails later will give a correct result. We did not want to have a blocking API for getIdDetails as it was not needed for the Qt UI. Can you cope with this in JS?

I understand that its not a blocking API . Will async-await solve the problem?

csoler commented 2 years ago

I'm not 100% sure. At least what you can do is try multiple times at regular intervals. We can also implement a blocking API if you need. That a bit of work, but do-able.

Sukhamjot-Singh commented 2 years ago

I'm not 100% sure. At least what you can do is try multiple times at regular intervals. We can also implement a blocking API if you need. That a bit of work, but do-able.

No I dont think we need to implement. I just found out that getIdDetails is also being called in 'People' section and it seems to be working fine. I will look into it.

Sukhamjot-Singh commented 2 years ago

image

Trash box implemented, but I cannot get it to show my trash mails.

image

I have tried to copy the other boxes schema. It should be working.

Sukhamjot-Singh commented 2 years ago

Can someone review changes for from column and Trash box?

Sukhamjot-Singh commented 2 years ago

@rottencandy I was actually busy with my examinations. I will continue to work on this PR. Will review the suggested changes.

defnax commented 2 years ago

Trash box implemented, but I cannot get it to show my trash mails.

@Sukhamjot-Singh i found why, the the trash not using RS_MSG_BOXMASK that is only for inbox,draft,sent,outbox

Messages.trash = Messages.all.filter(
 (msg) => (msg.msgflags & util.RS_MSG_TRASH) 
);

image

defnax commented 2 years ago

@Sukhamjot-Singh flags for the other Quick view boxes

Messages.star = Messages.all.filter(
 (msg) => (msg.msgflags & util.RS_MSG_STAR) 
);}

Messages.system = Messages.all.filter(
 (msg) => (msg.msgflags & util.RS_MSG_SYSTEM) 
 );

Messages.spam = Messages.all.filter(
  (msg) => (msg.msgflags & util.RS_MSG_SPAM) 
 );
defnax commented 2 years ago

We need to display the tags boxes too not sure how have handle that and show the dynamicly generated ones

        /* calcluate tag count */

        for (auto tagId = (*it).msgtags.begin(); tagId != (*it).msgtags.end(); ++tagId)
        {
            int nCount = tagCount [*tagId];
            ++nCount;
            tagCount [*tagId] = nCount;
        }

`

for (tag = tags.types.begin(); tag != tags.types.end(); ++tag) {
        text = TagDefs::name(tag->first, tag->second.first);
        QPixmap tagpixmap(16,16);
        tagpixmap.fill(QColor(tag->second.second));

        item = new QListWidgetItem (text, ui.quickViewWidget);
        item->setData(Qt::ForegroundRole, QColor(tag->second.second));
        item->setIcon(tagpixmap);
        item->setData(ROLE_QUICKVIEW_TYPE, QUICKVIEW_TYPE_TAG);
        item->setData(ROLE_QUICKVIEW_ID, tag->first);
        item->setData(ROLE_QUICKVIEW_TEXT, text); // for updateMessageSummaryList

        if (selectedType == QUICKVIEW_TYPE_TAG && tag->first == selectedId) {
            itemToSelect = item;
        }
    }

`

image

defnax commented 2 years ago

hi @Sukhamjot-Singh you stopped? no time more or?

Sukhamjot-Singh commented 2 years ago

hi @Sukhamjot-Singh you stopped? no time more No, I will work. I still have to push some commits. I also want to work on my GSoC proposal for the same.

Sukhamjot-Singh commented 2 years ago

image Starred is working as of now I need code review in the latest commit. I am replicating the code of the sidebar to make a new sidebar(quick view) as done in qt. Is this okay and should I go ahead with it?

Sukhamjot-Singh commented 2 years ago

image Starred is working as of now I need code review in the latest commit. I am replicating the code of the sidebar to make a new sidebar(quick view) as done in qt. Is this okay and should I go ahead with it?

Once this is complete I can finalize a major chunk of this issue and PR. Would love some help @defnax @rottencandy @csoler

defnax commented 2 years ago

First was nice a working useable mail ui. i mean finish all needed stuff on mail ui then later cleanup mail ui design/looknfeel. when you wait for add every feature a review i think it take some month that mail is finished :D

not done yet:

Sukhamjot-Singh commented 2 years ago

First was nice a working useable mail ui. i mean finish all needed stuff on mail ui then later cleanup mail ui design/looknfeel. when you wait for add every feature a review i think it take some month that mail is finished :D

not done yet:

* spam box

* attachment box ( this feature was only one qt ui list all mails which contains attachaments)

* system box

* tags boxes

* search/filter mails

* reply/replay all/forward/delete mail buttons

* complete message composer

Okay I will focus on developing mail completely now.

Sukhamjot-Singh commented 2 years ago

image Update

Sukhamjot-Singh commented 2 years ago

image

defnax commented 2 years ago

hi its possible to show the mail message under the message list? image

defnax commented 2 years ago

but on my notebook from trash to quickview takes lots of space

Sukhamjot-Singh commented 2 years ago

hi its possible to show the mail message under the message list? image

Yeah sure, I can try. Actually this was already implemented to be in a new page.

Sukhamjot-Singh commented 2 years ago

but on my notebook from trash to quickview takes lots of space

I will look into this and decrease the gap maybe.

defnax commented 2 years ago

look here image

when i use the right scrooolbar the top boxes stays static on same place, maybe a bug or something there image

Sukhamjot-Singh commented 2 years ago

look here image

when i use the right scrooolbar the top boxes stays static on same place, maybe a bug or something there image

Yes I understand now, This is a css bug, I will fix it in my next commit.

Sukhamjot-Singh commented 2 years ago

image As of now delete is working fine. But MessageToTrash does not seem to work. Also in my qt interface delete mail is crashing Retroshare. I can't seem to find a fix

Sukhamjot-Singh commented 2 years ago

@G10h4ck I was wondering if you could review my proposal as the mentor of Web Interface project which I have submitted on the GSoC portal. Cyril has given me a review already. I could not contact you any other way :).

G10h4ck commented 2 years ago

Hi! Thanks for pinging me @Sukhamjot-Singh I am very happy to see work in this direction!

About profile creation and login JSON API already expose everything needed for profile creation and login, and I think it is a priority to implement that in webui, this way retroshare-service can be used standalone without trickeries.

About mail tab I think we should give priority to basic functions, like mail reading, sending and maybe folder, I would completely ignore tags, and all the unnecessary things we have in retroshare-gui

Sukhamjot-Singh commented 2 years ago

Hi! Thanks for pinging me @Sukhamjot-Singh I am very happy to see work in this direction!

About profile creation and login JSON API already expose everything needed for profile creation and login, and I think it is a priority to implement that in webui, this way retroshare-service can be used standalone without trickeries.

About mail tab I think we should give priority to basic functions, like mail reading, sending and maybe folder, I would completely ignore tags, and all the unnecessary things we have in retroshare-gui

Yes @G10h4ck , I have included Mail tab in my proposal. I was not sure of the profile creation and login as it was also not mentioned in the GSoC ideas page of freifunk. Can I send you my proposal draft somehow or you can see it on the GSoC page. Email sukhamjot2001@gmail.com

defnax commented 2 years ago

please merge this @csoler @G10h4ck