From 4c490498e037921f1b856d962f88b2a9860c7f9b Mon Sep 17 00:00:00 2001 From: pax Date: Thu, 9 Apr 2026 20:07:26 -0500 Subject: [PATCH] main_window: set _categories_pending BEFORE set_post renders The flag was set in _ensure_post_categories_async which runs AFTER _on_post_selected calls info_panel.set_post. By the time the flag was True, the flat tags had already rendered. The flash persisted. Fix: check whether a fetch is needed and set the flag in _on_post_selected, right before set_post. The info panel sees the flag and skips the flat-tag fallback on its first render. --- booru_viewer/gui/main_window.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/booru_viewer/gui/main_window.py b/booru_viewer/gui/main_window.py index bf67038..8e9ec41 100644 --- a/booru_viewer/gui/main_window.py +++ b/booru_viewer/gui/main_window.py @@ -1137,6 +1137,16 @@ class BooruApp(QMainWindow): + (f" {post.created_at}" if post.created_at else "") ) if self._info_panel.isVisible(): + # Signal the info panel whether a category fetch is + # about to fire so it skips the flat-tag fallback + # (avoids the flat→categorized re-layout flash). + if not post.tag_categories: + client = self._make_client() + self._info_panel._categories_pending = ( + client is not None and client.category_fetcher is not None + ) + else: + self._info_panel._categories_pending = False self._info_panel.set_post(post) self._on_post_activated(index)