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
+7 -2
View File
@@ -52,7 +52,11 @@ class InitializationManager {
detectPageType() {
// Get the current page type from URL or data attribute
const path = window.location.pathname;
if (path.includes('/checkpoints')) {
// The recipes page lives at /loras/recipes, so it must be matched
// before the generic '/loras' check.
if (path.includes('/recipes')) {
this.pageType = 'recipes';
} else if (path.includes('/checkpoints')) {
this.pageType = 'checkpoints';
} else if (path.includes('/loras')) {
this.pageType = 'loras';
@@ -216,7 +220,8 @@ class InitializationManager {
const scannerTypeToPageType = {
'lora': 'loras',
'checkpoint': 'checkpoints',
'embedding': 'embeddings'
'embedding': 'embeddings',
'recipe': 'recipes'
};
if (scannerTypeToPageType[data.scanner_type] !== this.pageType) {