Author Topic: Expand/Collapse Folders on the 'Email' page  (Read 19648 times)

Offline davo

  • Jr. Member
  • **
  • Posts: 10
Expand/Collapse Folders on the 'Email' page
« on: March 14, 2007, 03:01:28 AM »
Hi guys, I'm not sure if this is the right place to post this or not (apologies if it's not). I've done some work on expand/collapse for mail folders with some server-side stuff to remember the folder state between pageloads/sessions. There are 2 versions:

1 - Session Only
Folders remember their open/closed state for the duration of the session.
http://download.recurser.com/roundcubemail_r507_session_only.tar.gz

2- Database
Folders store their open/closed state in a new DB table ('folders') so they can maintain state between sessions.
http://download.recurser.com/roundcubemail_r507_with_new_table.tar.gz

I lean towards the second one because I've usually got a stupidly large amount of folders and i like to have them keep their open/closed state between sessions so I don't have to keep re-opening commonly used folders every time i log in.

The only problem with the second solution is that if folders are renamed/deleted in the 'Personal Settings->Folders' section there will be orphaned rows in the folders table (hope that makes sense!). I tried to alter the folder delete/rename so that the folders table would be kept up to date but folder rename seems to crash firefox & IE for me (connection timeout or something) so i just left it as is.

Feel free to use either (or neither!) as you see fit. Love roundcube - keep up the great work!

edit #1: i've only tested it in FireFox & IE6 on windows - would be cool if someone could give opera/mac/IE7 a go.
edit #2: sorry looks like i should have put this in the Plug-Ins forum, didn't see it before

Offline seansan

  • Jr. Member
  • **
  • Posts: 84
Re: Expand/Collapse Folders on the 'Email' page
« Reply #1 on: March 14, 2007, 02:12:08 PM »

How great?! This is a good contribution. maybe also log an issue referring to this in the tracker

http://trac.roundcube.net/trac.cgi/report

Offline davo

  • Jr. Member
  • **
  • Posts: 10
Re: Expand/Collapse Folders on the 'Email' page
« Reply #2 on: March 14, 2007, 08:18:51 PM »
Thanks, i dropped a note in http://trac.roundcube.net/trac.cgi/ticket/1267231 - seems to be a feature request for this.

Offline NaiosKae

  • Jr. Member
  • **
  • Posts: 40
Re: Expand/Collapse Folders on the 'Email' page
« Reply #3 on: March 22, 2007, 09:44:25 AM »
Really good Improvement.

Works better than mine and your source code is also nicer ;p

Edit: after having replaced mine : result in FF 2.0 is :


Offline davo

  • Jr. Member
  • **
  • Posts: 10
Re: Expand/Collapse Folders on the 'Email' page
« Reply #4 on: March 24, 2007, 01:22:43 PM »
Thanks for the feedback NaiosKae - are you on windows or mac, and what os version/screen resolution are you using? I've tried it out on IE6-7/Opera9/FF mac and windows, but obviously from your screenshot it's far from ok for you. i'd love to figure out how to reproduce this myself! Ideally should look like this:

Offline NaiosKae

  • Jr. Member
  • **
  • Posts: 40
Re: Expand/Collapse Folders on the 'Email' page
« Reply #5 on: March 26, 2007, 04:53:12 AM »
Hi,
I'm using Firefox 2.0.3 running under Linux debian Etch with a wide screen (1680x1050).
First time I used it, it was very nice, looking like your's but when I connected for the second time (after having updated my firefox to iceweasel meaning : 1.5 to 2.0.3), you can see on the screenshot.

result is strangely similary as the one I have with IE7 on my dirty solution of collapsing folders

Offline davo

  • Jr. Member
  • **
  • Posts: 10
Re: Expand/Collapse Folders on the 'Email' page
« Reply #6 on: March 26, 2007, 07:04:27 AM »
Yeah i had a similar problem with IE6 before, the css got a little crazy trying to coax it into working. I think we've got a debian machine at work somewhere - I'll have a go tomorrow and see what it looks like. Is it ok on IE 6/7 and windows FF for you?

Thanks for your help!

Offline davo

  • Jr. Member
  • **
  • Posts: 10
Re: Expand/Collapse Folders on the 'Email' page
« Reply #7 on: March 28, 2007, 09:00:56 AM »
Unfortunately the closest I could get to debian was an ubuntu edgy box, and it seemed to work ok in iceweasel on that. Is there any chance you could have a play with the css and try to figure out what's going on? As far as i can tell it's working in every other recent browser I can get my hands on. Also a bit odd that it worked the first time you loaded it, but not after that :( i'm a bit stumped on this

Offline NaiosKae

  • Jr. Member
  • **
  • Posts: 40
Re: Expand/Collapse Folders on the 'Email' page
« Reply #8 on: April 03, 2007, 11:39:38 AM »
Hi again,

after some other tries, behavior was the same on windows version of FF 2.0

in fact, the real strange thing is that it works well when window is in full-screen mode.

due to dimension of my screen (1680*1050 at home and 1900*1440 at work) my browser does never use the whole screen.

the display bug may stand in the geometry of wide-screens.



Offline davo

  • Jr. Member
  • **
  • Posts: 10
Re: Expand/Collapse Folders on the 'Email' page
« Reply #9 on: April 11, 2007, 02:19:35 AM »
Thanks NaiosKae, quite bizarre that it works in fullscreen mode but not otherwise. I'm kind of stumped and unfortunately i don't have access to a screen that big to reproduce this. Does the original code you wrote work at these resolutions? If you get time I'd love it if you could play around with the css and see if you can figure out what's happening. If I can get my hands on a big monitor I'll do the same.

Thanks again for the feedback!

Offline NaiosKae

  • Jr. Member
  • **
  • Posts: 40
Re: Expand/Collapse Folders on the 'Email' page
« Reply #10 on: April 16, 2007, 05:14:58 AM »
I tried again at work (1900x1440 screen), it works well
Same at home

I don't understand what happened, may be cache conflict ?

Edit : I've found what happend.

I replaced the link pointing on my version with a link pointing on yours.
my css data were conflicting with yours then I had the result shown above.
Even if I have a cache size of 0Mb on Firefox profiles, I had to empty it to make it works.

Offline davo

  • Jr. Member
  • **
  • Posts: 10
Re: Expand/Collapse Folders on the 'Email' page
« Reply #11 on: April 16, 2007, 07:19:23 AM »
That's great, thanks for all your help NaiosKae! I'm going to have to get myself a bigger screen one of these days :)

Edit : I've updated everything to work with the latest 552 release ( http://download.recurser.com/roundcubemail_r552_session_only.tar.gz ) if anyone needs it

Offline knuckles

  • Jr. Member
  • **
  • Posts: 28
Re: Expand/Collapse Folders on the 'Email' page
« Reply #12 on: June 07, 2007, 06:19:36 AM »
Can you provide just the code for this? I'm trying to get it to work with SVN 607.

Offline davo

  • Jr. Member
  • **
  • Posts: 10
Re: Expand/Collapse Folders on the 'Email' page
« Reply #13 on: June 14, 2007, 04:48:04 AM »
Sorry about the slow reply knuckles, i don't come here much. I've upped everything to version 620, you can grab it here if that helps you:

http://download.recurser.com/roundcubemail_r620_session_only.tar.gz

I'm not sure what you mean by 'provide just the code' ? There are changes to 4 existing files, 2 new files, and 2 images... do you want me to paste the changes in here or something?

Give me a shout if you need anything more

cheers

dave

Offline Inferno

  • Newbie
  • *
  • Posts: 2
Re: Expand/Collapse Folders on the 'Email' page
« Reply #14 on: June 15, 2007, 08:32:31 AM »
Installed the new version. Looks ok for now