mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-13 15:51:00 +00:00
80c04df4fc
Packing items, tasks and expenses swipe sideways to their actions, as in Mail or Reminders: done or open one way, delete and edit the other, the first one run by a full swipe. They are second ways to what each row already offers; an expense still asks before it goes. A long press on a trip card lifts it and opens its menu with the card's own actions. Plain confirmations in MConfirmSheet now also ask through the system where the app can. Lists, the atlas and a journey show grey placeholders in their shape while loading instead of a spinner in an empty screen (MSkeleton); buttons keep theirs. A picture still loading fades in once it is there; one from the cache shows at once. In the iOS app the page bounces at its ends again, except on screens with pull-to-refresh, whose pull it would race; Android keeps its stretch off. On iOS a long press on the app icon offers "New trip" and the trip coming up by its name, set by the UI in its language (TrekShell.setQuickActions, feature quickActions), and a tap opens it, also from a cold start. The app's own CSS moves out of index.css into native/nativeApp.css, which had outgrown its size budget.
78 lines
3.8 KiB
TypeScript
78 lines
3.8 KiB
TypeScript
import React from 'react'
|
|
import ReactDOM from 'react-dom/client'
|
|
import { BrowserRouter } from 'react-router'
|
|
import App from './App'
|
|
// Self-hosted Poppins (bundled, same-origin) so the app font can't be blocked by
|
|
// ad/tracker blockers the way the Google Fonts CDN can.
|
|
import '@fontsource/poppins/300.css'
|
|
import '@fontsource/poppins/400.css'
|
|
import '@fontsource/poppins/500.css'
|
|
import '@fontsource/poppins/600.css'
|
|
import '@fontsource/poppins/700.css'
|
|
// MuseoModerno for the login wordmark — same reasoning, it used to come from the
|
|
// Google Fonts CDN via a render-blocking <link> in index.html.
|
|
import '@fontsource/museomoderno/400.css'
|
|
import '@fontsource/museomoderno/700.css'
|
|
import '@fontsource/museomoderno/800.css'
|
|
// Geist Sans (self-hosted too) — used only for secondary "subtext" via --font-subtext.
|
|
import '@fontsource/geist-sans/400.css'
|
|
import '@fontsource/geist-sans/500.css'
|
|
import '@fontsource/geist-sans/600.css'
|
|
// Leaflet CSS bundled from node_modules instead of unpkg: the service worker
|
|
// cached the CDN stylesheet as an opaque response, which the browser then
|
|
// rejected, breaking the Atlas/trip maps (#1497). Bundling keeps it same-origin
|
|
// and precached with the app shell. Must stay above index.css, which overrides
|
|
// several .leaflet-* styles.
|
|
import 'leaflet/dist/leaflet.css'
|
|
import './index.css'
|
|
import './native/nativeApp.css'
|
|
import './styles/rtl.css'
|
|
import './styles/ferratas.css'
|
|
import './styles/paddle.css'
|
|
import './styles/walkRoute.css'
|
|
import './styles/bike.css'
|
|
import './styles/horse.css'
|
|
import './styles/hike.css'
|
|
// Native HTML5 drag-and-drop never fires on touch input, so the planner's place /
|
|
// day reordering was dead on Android and iOS. The `drag-drop-touch` polyfill synthesises
|
|
// the standard drag events from touch gestures over draggable elements (#1265). It is
|
|
// loaded only on non-mobile viewports: reorder DnD is disabled on mobile (#1432), where
|
|
// the polyfill's synthetic click/dblclick otherwise turned quick one-finger map pans into
|
|
// double-tap zooms (#1440). See utils/touchDragPolyfill.ts.
|
|
import { maybeInstallTouchDragPolyfill } from './utils/touchDragPolyfill'
|
|
import { startConnectivityProbe } from './sync/connectivity'
|
|
import { startNativeApp } from './native/nativeApp'
|
|
import { requestPersistentStorage } from './sync/persistentStorage'
|
|
import { isIosDevice } from './utils/iosDevice'
|
|
import ErrorBoundary, { RootErrorFallback } from './components/shared/ErrorBoundary'
|
|
import { installGlobalErrorHandlers } from './utils/globalErrorHandlers'
|
|
import { schedulePrecacheRepair } from './utils/serviceWorkerShell'
|
|
|
|
void maybeInstallTouchDragPolyfill()
|
|
startConnectivityProbe()
|
|
// Inside the iOS/Android app: splash, back button, status bar, offline start (iOS).
|
|
startNativeApp()
|
|
// Keep offline data (map tiles, file blobs, IndexedDB) exempt from eviction.
|
|
void requestPersistentStorage()
|
|
// A tile cache past the iOS budget slows every cold start of the home screen app (#3008).
|
|
// Loaded on iOS only, so the prefetcher stays out of everyone's first chunk.
|
|
if (isIosDevice()) void import('./sync/tilePrefetcher').then((m) => m.scheduleTileCacheTrim())
|
|
// Event handlers and async code never reach a boundary; this is where they land.
|
|
installGlobalErrorHandlers()
|
|
// A page the precache keeps under a stylesheet's or a script's name would be
|
|
// handed on to every later release (#2524).
|
|
schedulePrecacheRepair()
|
|
|
|
ReactDOM.createRoot(document.getElementById('root')!).render(
|
|
<React.StrictMode>
|
|
<BrowserRouter>
|
|
{/* Outermost net: catches App itself and TranslationProvider, which every
|
|
boundary further in sits below. Its fallback is untranslated on purpose
|
|
— if the provider is the thing that broke, t() would echo raw keys. */}
|
|
<ErrorBoundary boundaryId="root" level="root" fallback={s => <RootErrorFallback {...s} />}>
|
|
<App />
|
|
</ErrorBoundary>
|
|
</BrowserRouter>
|
|
</React.StrictMode>,
|
|
)
|