fix(recipes): show initialization screen and auto-reload during first scan

The recipes page always rendered with is_initializing=False, so a cold
start displayed an empty grid that never updated until a manual refresh.
Mirror the model pages: gate render_page on the scanner state, broadcast
init progress from RecipeScanner (including a completion message, and a
failure fallback so the page never stalls), and teach initialization.js
to detect the /loras/recipes page before the generic /loras match.
This commit is contained in:
Will Miao
2026-08-24 09:13:53 +08:00
committed by pixelpaws
parent 87e93636dc
commit 06c270a6e1
3 changed files with 57 additions and 4 deletions
+10 -2
View File
@@ -176,11 +176,19 @@ class RecipePageView:
user_language = self._settings.get("language", "en")
self._server_i18n.set_locale(user_language)
# While the initial scan is running, show the initialization
# screen (same as the model pages) instead of an empty grid; the
# page reloads itself when the scanner broadcasts completion.
is_initializing = (
recipe_scanner._cache is None or recipe_scanner.is_initializing()
)
try:
await recipe_scanner.get_cached_data(force_refresh=False)
if not is_initializing:
await recipe_scanner.get_cached_data(force_refresh=False)
rendered = self._template_env.get_template(self._template_name).render(
recipes=[],
is_initializing=False,
is_initializing=is_initializing,
settings=self._settings,
request=request,
t=self._server_i18n.get_translation,