Skip to content

Toggle Sidebar command is poorly coded. #34

@V7MoVknqxavTR

Description

@V7MoVknqxavTR

The Toggle Sidebar command is poorly coded.

def sidebar_toggle(self):
    new_state = False if self.sidebarDockWidget.isVisible() else True
    self.sidebarDockWidget.setVisible(new_state)

This function doesn't have any form of refreshing. The result is that if you open a browser with the sidebar toggled off previously;y, then use this command, it opens the sidebar, but it's empty and non-functional. AI told me this code is better, and I tested it, and it works correctly:

def sidebar_toggle(self):
    if not self.sidebarDockWidget.isVisible():
        self.sidebarDockWidget.setVisible(True)
        self.mw.progress.timer(250, self.sidebar.refresh, False)  # Add the refresh with delay
    else:
        self.sidebarDockWidget.setVisible(False)

Best Regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions