fix: race condition on custom styles loading + misc cleanup
All checks were successful
Deploy / Build and Deploy to Production (push) Successful in 22s

Guard watcher-triggered renders in usePreviewRenderer until first
explicit render completes, preventing premature renders with default
styles. Also: disable Contenu tab, update content/blueprints, add
global disabled button styles, minor formatting.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
isUnknown 2026-02-24 13:53:55 +01:00
parent 59dfa18ec7
commit f760e1942a
14 changed files with 46 additions and 24 deletions

View file

@ -16,6 +16,7 @@ export function usePreviewRenderer({
let savedScrollPercentage = 0;
const currentFrameIndex = ref(1); // 1 or 2, which iframe is currently visible
const isTransitioning = ref(false);
const initialized = ref(false);
let keyboardShortcutHandler = null;
/**
@ -117,6 +118,9 @@ export function usePreviewRenderer({
// Swap current frame
currentFrameIndex.value = currentFrameIndex.value === 1 ? 2 : 1;
isTransitioning.value = false;
if (!initialized.value) {
initialized.value = true;
}
}, 200); // Match CSS transition duration
}, 50); // Small delay to ensure scroll is set
}, 200); // Wait for PagedJS
@ -127,6 +131,7 @@ export function usePreviewRenderer({
watch(
() => stylesheetStore.content,
() => {
if (!initialized.value) return;
renderPreview();
}
);
@ -135,6 +140,7 @@ export function usePreviewRenderer({
watch(
() => narrativeStore.data,
() => {
if (!initialized.value) return;
if (narrativeStore.data) {
renderPreview();
}
@ -152,6 +158,7 @@ export function usePreviewRenderer({
renderPreview,
currentFrameIndex,
isTransitioning,
initialized,
setKeyboardShortcutHandler,
};
}