fix transition flash between apps

- Set app-opening class BEFORE loading content to prevent flash
- Keep app-closing at opacity 0 after animation ends
- Remove unnecessary class removal in playCloseAnimation
This commit is contained in:
2026-01-20 13:10:22 +01:00
parent efc007e487
commit b3055d8f1a
2 changed files with 16 additions and 11 deletions

View File

@@ -60,6 +60,12 @@ function loadAppContent_internal(app_id, app_path, skip_animation)
-- Load app content using C++ function
if loadAppContent then
-- Set opening animation BEFORE loading content to prevent flash
if not skip_animation then
app_container:SetClass("app-opening", true)
app_container:SetClass("app-closing", false)
end
local success = loadAppContent(app_container, app_path)
showLoading(false)
@@ -68,16 +74,11 @@ function loadAppContent_internal(app_id, app_path, skip_animation)
current_app_path = app_path
print("[Shell] App loaded: " .. app_id)
-- Play opening animation (unless skipped for initial load)
if not skip_animation then
app_container:SetClass("app-opening", true)
app_container:SetClass("app-closing", false)
-- Remove animation class after it completes
if setTimeout then
setTimeout(function()
app_container:SetClass("app-opening", false)
end, 300)
end
-- Remove animation class after it completes
if not skip_animation and setTimeout then
setTimeout(function()
app_container:SetClass("app-opening", false)
end, 300)
end
-- If home was loaded, populate apps dynamically
@@ -144,7 +145,8 @@ local function playCloseAnimation(callback)
app_container:SetClass("app-closing", true)
app_container:SetClass("app-opening", false)
setTimeout(function()
app_container:SetClass("app-closing", false)
-- Don't remove app-closing yet - callback will load new content
-- and loadAppContent_internal will switch to app-opening
if callback then callback() end
end, 200)
else

View File

@@ -58,6 +58,9 @@
.app-closing {
animation: 0.2s quadratic-in app-close;
/* Keep at end state after animation */
opacity: 0;
transform: scale(0.8);
}
@keyframes app-open {