Re: Preserving the File Browser tree state when switching PM Browsers

From: vais <>
Date: Sat, 14 Feb 2009 12:35:21 -0800 (PST)


Thank you for posting a reply. Yeaaah... this severely limits the
usefulness of the file browser (or any hierarchical browser for that
matter). There are two possible solutions I see for this (and these
may well be the ones you have contemplated already, so I really would
like to know your thoughts on the matter):

1. Abandoning the hierarchical browser idea in favor of a flat one
with a ".." parent directory pointer for navigation (double-clicking
on a directory changes to that directory). This way, no tree is
required at all, and it is possible to preserve state using the root
string alone (because, well, there is no other state to preserve!).
This is not ideal, but it is a solid, workable solution that makes
file browser usable in real-world scenarios (i.e. where one does,
inevitably, switch to a different browser and expects to see the file
browser in the same state as they left it).

2. Adding more functionality to support preserving tree state. This
can be done in one of two ways, both of which involve adding support
for another key in the tree data table:
  a) "children" key that contains a table of children that may in turn
have their tables of children ad infinitum. If this key has a table
value, the node is presented as expanded without requiring user
  b) "expand" key, which is a boolean value. When tree data is loaded,
if "parent" is true and "expand" is true, get_contents_for gets called
right away without user interaction, and the node is presented as
expanded in the tree.

I imagine that option 2 adds quite a bit more complexity to the
implementation, but I do not see how a tree is useful without state. I
personally would rather have a reliable flat implementation than a
tree that screws me over each time I leave and come back :)

Is it just me?


On Feb 14, 1:22 am, mitchell <> wrote:
> Vais,
> > So, is there an elegant way to serialize the tree state and display it
> > the same way it was before you navigated away to another browser?
> Nope. When you expand a row, those children are queried in real-time.
> The root structure is the only thing you could serialize.
> I considered restoring previous views, but there was too much
> complexity involved.
Received on Sat 14 Feb 2009 - 15:35:21 EST

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:37:20 EST