Riverscapes / QRAVEPlugin

QGIS Plugin for viewing Riverscapes projects
GNU General Public License v3.0
0 stars 0 forks source link

Close and Open Project Expands other Collapsed Projects #32

Closed joewheaton closed 2 years ago

joewheaton commented 3 years ago

Version: 0.5.1

Part of keeping the QRAVE tree from being over-whelming is controlling (with businesses logic collapsed tag) whether a project tree is collapsed or not. When a user takes time to control the collapsed state of other open projects, we should NOT mess with that. What is happening is when you open a new project, or close an existing project, then the other projects loose their collapsed state and expand out. It makes it really hard to see the project you just opened, and will annoy users. See video:

Alt-text

MattReimer commented 3 years ago

Agreed. Not sure if we need to track expand/collapse state of every item but there may be some middle ground here.


Update: Just a note for future Matt

I did explore writing the tree collapsed state as a project setting. I think that's a nice-to-have feature for sure but for now all we need to do is serialize the tree state in an error-correcting way (i.e. Use what you can, ignore stuff that doesn't make sense, fall back to sensible defaults) and store it in-memory so that we can re-apply it after a tree refresh.

philipbaileynar commented 2 years ago

Quick summary: when you open or close a project, no other project tree elements should change. If they were collapsed or expanded before the user opened/closed a project, then that is the state that they should have afterward.

(I'm pretty sure this is how ArcRAVE works. ArcRAVE does not rebuild the entire project tree every time a project is opened or closed. It only affects the project being altered.)

joewheaton commented 2 years ago

Perfect summary @philipbaileynar. One minor clarification. Newly opened projects should also get added to the TOP of the project explorer tree so if tree is busy, we stand chance of seeing them.

I suppose this brings up a minor issue you and I did not discuss @philipbaileynar on #19, which is when adding items from a project to the map for a project that does not yet exist in TOC, where does new layer group for that project get added. I'm guessing at top makes sense? Ignoring order of projects within the RAVE tree? Thoughts @philipbaileynar

MattReimer commented 2 years ago

Yeah, rebuilding the whole tree every time was a bit of a hack to get it out quickly without having to figure out how to edit an existing tree.

While it might seem easy this is not necessarily a trivial fix since that rebuild is triggered in a few places. Just FYI

joewheaton commented 2 years ago

Thanks @philipbaileynar for capturing below in #59

I suppose this brings up a minor issue you and I did not discuss @philipbaileynar on #19, which is when adding items from a project to the map for a project that does not yet exist in TOC, where does new layer group for that project get added. I'm guessing at top makes sense? Ignoring order of projects within the RAVE tree? Thoughts @philipbaileynar

KellyMWhitehead commented 2 years ago

QRave updated to remember each items collapsed state in the tree before reloading the tree.

e8667b5baa7e6708bbd01df914264f62f221b842

joewheaton commented 2 years ago

I am so excited to have this functionality back. This will be huge. Thanks @KellyMWhitehead.