Refine 'Automatically save "FileTree" and "PageTree" widgets (see #5398)'