Question about TabGroups and FLATVIEW

Hi

I have the configuration item Folders>Folder Behaviour>Cancel Flat View mode when folder is changed ticked, but I've found that when I switch to a Tab Group, if an existing tab was in FLAT view, it will remain in FLAT view.

For clarification, the initial lister had a single pane, pointing to an unrelated directory.

This raises two questions:

  1. Is this a bug? Should FLAT view reset when switching to a new tab group?
  2. Can FLAT view state (mixed, mixednofolders) be preserved as
    a) part of the tab group
    b) part of a folder format?

For now I have this script which matches the folder path against a configured list and toggles FlatMode dynamically.

This only issue I now have is that switching to/from FLATVIEW discards the sort order settings in the folder format.

Note that the "Group By" settings are preserved in FLATVIEW, even to the point of ensuring the grouped column is visible when switching. Can the same be done for SORTBY?

The following script auto-toggles FLAT view (or disables it where it is not wanted) and resets the sort column to what it was before entering FLAT view. This doesnt help if I'm in a normal directory and want to toggle flat view. How to preserve the SORT state without an external script?

function OnAfterFolderChange(afc) {
  if (afc.tab) {
    var cmd = DOpus.Create().Command();
    cmd.SetSourceTab(afc.tab);
    var path = afc.tab.path;
    var folders = Script.config.Folders;
    for (var i = 0; i < folders.count; i++) {
      var fpath = DOpus.FSUtil.Resolve(folders(i));
      if (path + '' === fpath + '') {
        cmd.AddLine('Set FLATVIEW=on,mixednofolders');
        cmd.AddLine('Set SortBy=' + afc.tab.format.sort_field);
        cmd.Run();
        return;
      }
    }
    cmd.RunCommand('Set FLATVIEW=off');
  }
}

Thanks

That's a bug. It will be fixed in 12.20.2 beta.

Tab Groups always turn off Flat View in the tabs they open. (Aside from the first tab, of course, until that bug is fixed.)

Folder Formats don't affect Flat View at all. (But Flat View can affect Folder Formats; see below.)

Lister Layouts and Lister Styles can both apply Flat View to the windows/tabs they open (if any).

That could be due to the Flat View folder format. (Preferences / Folders / Folder Formats, then look under Folder Type Formats.) The main reason it exists is so it can turn on one of the Location columns when you switch Flat View on. You can edit or disable it if it isn't doing what you need.

That's a bug. It will be fixed in 12.20.2 beta.

Thanks. Trying to script a workaround has proven troublesome. I now check AFC.action to ensure I dont reset folder view on a refresh or refreshsub.. (Is refreshsub documented anywhere? F5 in flat mode seems to produce a refreshsub instead of a refresh.)

That could be due to the Flat View folder format. ( Preferences / Folders / Folder Formats , then look under Folder Type Formats .) The main reason it exists is so it can turn on one of the Location columns when you switch Flat View on. You can edit or disable it if it isn't doing what you need.

That looks like it. If I disable i Flat View folder format, I can preserve sort, but at the cost of losing the other customizations that Flat View normally adds automatically.

Thanks for pointing me in the right direction, It actually makes more sense to save a lister layout with the tabs and format I want. This only hard part was figuring out Prefs LAYOUT=xxx was needed, not GO LAYOUT=xxx which seems counterintuitive.

That's correct. We'll update the docs, since it was missed.

Nice.

I've added a row of buttons which trigger Prefs LAYOUT=xxx LAYOUTTHISLISTER=paths NOSCRIPT gives a seamless transition between what I was doing, and my next task.

Loving DOpus more every day.
Thanks for the great work.

1 Like