Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

revert(mobile): keep the page transitions' timing and drop the unused route preload

Maurice79420cd945d6
diff --git a/client/src/mobile/mobile.css b/client/src/mobile/mobile.css
index 58e2ec802..6a435fcb3 100644
--- a/client/src/mobile/mobile.css
+++ b/client/src/mobile/mobile.css
@@ -453,23 +453,23 @@
}
}
:root[data-route-transition='forward']::view-transition-old(root) {
- animation: m-vt-out-leading 0.3s cubic-bezier(0.32, 0.72, 0, 1) both;
+ animation: m-vt-out-leading 0.4s cubic-bezier(0.32, 0.72, 0, 1) both;
}
:root[data-route-transition='forward']::view-transition-new(root) {
- animation: m-vt-in-trailing 0.3s cubic-bezier(0.32, 0.72, 0, 1) both;
+ animation: m-vt-in-trailing 0.4s cubic-bezier(0.32, 0.72, 0, 1) both;
box-shadow: -16px 0 40px -12px rgb(0 0 0 / 0.35);
}
:root[data-route-transition='back']::view-transition-old(root) {
z-index: 1;
- animation: m-vt-out-trailing 0.26s cubic-bezier(0.32, 0.72, 0, 1) both;
+ animation: m-vt-out-trailing 0.34s cubic-bezier(0.32, 0.72, 0, 1) both;
box-shadow: -16px 0 40px -12px rgb(0 0 0 / 0.35);
}
:root[data-route-transition='back']::view-transition-new(root) {
- animation: m-vt-in-leading 0.26s cubic-bezier(0.32, 0.72, 0, 1) both;
+ animation: m-vt-in-leading 0.34s cubic-bezier(0.32, 0.72, 0, 1) both;
}
:root[data-route-transition='tab']::view-transition-old(root),
:root[data-route-transition='tab']::view-transition-new(root) {
- animation-duration: 0.15s;
+ animation-duration: 0.18s;
}
@media (prefers-reduced-motion: reduce) {
::view-transition-group(*),
diff --git a/client/src/mobile/routeTransition.ts b/client/src/mobile/routeTransition.ts
index 6296bb61d..84c7ffdde 100644
--- a/client/src/mobile/routeTransition.ts
+++ b/client/src/mobile/routeTransition.ts
@@ -18,7 +18,7 @@ import type { Location, NavigationType } from 'react-router';
*/
export type RouteTransitionKind = 'forward' | 'back' | 'tab';
-const SETTLE_MS = 300;
+const SETTLE_MS = 800;
let skipNext = false;
let current: ViewTransition | null = null;
diff --git a/client/src/utils/lazyWithRetry.ts b/client/src/utils/lazyWithRetry.ts
index 454d94806..22a4b502e 100644
--- a/client/src/utils/lazyWithRetry.ts
+++ b/client/src/utils/lazyWithRetry.ts
@@ -44,33 +44,9 @@ export function retryUrlFor(error: unknown): string | null {
return busted.href;
}
-/** Every route loader, so the phone can fetch them ahead while idle (preloadLazyRoutes). */
-const loaders: (() => Promise<unknown>)[] = [];
-
-/**
- * Fetches every lazily loaded page in the background, a few at a time, so
- * opening one later does not wait for the network. A loader that fails is
- * simply tried again when the page is opened. Skipped where the user asked to
- * save data.
- */
-export function preloadLazyRoutes(): void {
- const connection = (navigator as { connection?: { saveData?: boolean } }).connection;
- if (connection?.saveData) return;
- const queue = [...loaders];
- const next = () => {
- const load = queue.shift();
- if (!load) return;
- void load()
- .catch(() => {})
- .then(next);
- };
- for (let i = 0; i < 3; i++) next();
-}
-
export function lazyWithRetry<T extends ComponentType<any>>(
load: () => Promise<{ default: T }>
): LazyExoticComponent<T> {
- loaders.push(load);
return lazy(() =>
load()
.catch((error: unknown) => {