Skip to content

Folder tree expand/collapse state resets after a move #2

Description

@ChrisonSimtian

Usage Information

  • BitwardenSharp dbbf4df (develop)
  • .NET SDK 10.0.400, net10.0
  • Avalonia 12.1.1
  • Bitwarden CLI 2026.7.0
  • macOS 26.5.2 (arm64)

Description

Collapsing folders in the tree is undone by any folder operation. After dragging an item onto a
folder, every node is expanded again, so a tree that has been tidied down to a few branches has to
be re-collapsed after every move.

On a vault with nested folders (Homelab/Proxmox, Homelab/Synology, …) this makes repeated
moves tedious, which is exactly the workflow drag-and-drop exists to support.

Reproduction Steps

  1. Unlock and open the vault browser.
  2. Collapse one or more folder nodes in the left-hand tree.
  3. Drag any item from the middle list onto a folder in the tree.
  4. Observe the tree once the move completes.

Expected Behavior

Nodes that were collapsed stay collapsed. The operation changed one item's folder; it did not
change how the tree is being viewed.

Actual Behavior

Every node is expanded. The previous expand/collapse state is gone.

Regression?

No — present since folder management was added (422baed).

Known Workarounds

None. Re-collapse manually after each move.

Notes — where to look

FolderNode already has a two-way–bound IsExpanded, so the binding is not the problem. The
state is lost because VaultViewModel.RebuildFolderTree() calls Folders.Clear() and constructs
brand-new FolderNode instances on every load; the expansion state lives on the objects that were
just discarded.

Two candidate fixes:

Related: #3, #4.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageNeeds triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions