StatePlugin: improve restoring current tree item