diff --git a/ui/pages/sync.py b/ui/pages/sync.py index 0799296b..0bf0bbf1 100644 --- a/ui/pages/sync.py +++ b/ui/pages/sync.py @@ -1915,7 +1915,9 @@ class PlaylistDetailsModal(QDialog): def refresh_track_table(self): """Refresh the track table with loaded tracks""" + import traceback logger.info(f"refresh_track_table called for playlist {self.playlist.name}") + logger.debug(f"Call stack: {traceback.format_stack()[-3:-1]}") # Show who called this method if not hasattr(self, 'track_table'): logger.error("No track_table attribute found") @@ -1978,6 +1980,15 @@ class PlaylistDetailsModal(QDialog): logger.info(f"Finished populating all {len(tracks_to_show)} tracks") + # Force table refresh and repaint + try: + self.track_table.resizeColumnsToContents() + self.track_table.viewport().update() + self.track_table.repaint() + logger.info("Forced table refresh and repaint") + except Exception as e: + logger.error(f"Error during table refresh: {e}") + # Add info message if tracks were limited if total_tracks > display_limit: # Update the modal title to show track count info