Summary
The refresh buttons inside the Libra Code view Usage and Automation tabs append a new toolbar/list pair each time they are clicked instead of replacing the current tab contents.
Reproduction
- Open a vault inside a Libra repository.
- Open the Libra Code view.
- Switch to the Usage tab or Automation tab.
- Click the refresh icon more than once.
Actual behavior
Each refresh leaves the existing tab contents in the DOM and appends another toolbar/list below it, so the tab accumulates duplicate sections.
Expected behavior
Refreshing either tab should replace the existing tab body with one fresh toolbar and result list.
Cause
renderUsageTab and renderAutomationTab are called directly from their refresh buttons with the existing tab body element, but neither method clears the body before appending new content. The current sibling cleanup only operates after the newly-created toolbar, so it never removes the previous render.
Fix
Clear the tab body at the start of each sub-tab render, then render a single fresh toolbar/list pair.
Summary
The refresh buttons inside the Libra Code view Usage and Automation tabs append a new toolbar/list pair each time they are clicked instead of replacing the current tab contents.
Reproduction
Actual behavior
Each refresh leaves the existing tab contents in the DOM and appends another toolbar/list below it, so the tab accumulates duplicate sections.
Expected behavior
Refreshing either tab should replace the existing tab body with one fresh toolbar and result list.
Cause
renderUsageTab and renderAutomationTab are called directly from their refresh buttons with the existing tab body element, but neither method clears the body before appending new content. The current sibling cleanup only operates after the newly-created toolbar, so it never removes the previous render.
Fix
Clear the tab body at the start of each sub-tab render, then render a single fresh toolbar/list pair.