Skip to content

Code view refresh appends duplicate Usage and Automation content #1

Description

@pollychen-lab

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

  1. Open a vault inside a Libra repository.
  2. Open the Libra Code view.
  3. Switch to the Usage tab or Automation tab.
  4. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions