mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-23 05:21:15 +00:00
feat(native): swipe rows, long-press menus, placeholders while loading, fading pictures, iOS bounce and app icon quick actions
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.
This commit is contained in:
@@ -7,11 +7,13 @@ import { useSettingsStore } from '../store/settingsStore';
|
||||
import { isEffectivelyOffline } from '../sync/networkMode';
|
||||
import { checkAppUpdate, loadNativeCapabilities } from './capabilities';
|
||||
import { installNativeGeolocation } from './geolocation';
|
||||
import { fadeInImages } from './imageFade';
|
||||
import { keepFieldInView } from './keepFieldInView';
|
||||
import { prepareKeyboardFields } from './keyboardFields';
|
||||
import { keepOfflineShellFresh } from './offlineShell';
|
||||
import { isNativeApp, isNativeIos } from './platform';
|
||||
import { openPushTarget, startNativePush } from './push';
|
||||
import { startQuickActions } from './quickActions';
|
||||
import { reportNativeFailure } from './reportFailure';
|
||||
import { startSharedFiles } from './sharedFiles';
|
||||
import { trackTouchInput } from './touchInput';
|
||||
@@ -30,10 +32,14 @@ export function startNativeApp(): void {
|
||||
// Marks the app for index.css: no text selection or long-press callout on the
|
||||
// UI itself, as in any native app. Fields stay selectable there.
|
||||
document.documentElement.setAttribute('data-native-app', '');
|
||||
// iOS only: the page may bounce at its ends there (mobile.css).
|
||||
if (isNativeIos()) document.documentElement.setAttribute('data-native-ios', '');
|
||||
// No hover left behind by a tap, a press that shows, no focus ring after a tap.
|
||||
trackTouchInput();
|
||||
// The keyboard's return key, capitalisation and autocorrect fit the field.
|
||||
prepareKeyboardFields();
|
||||
// Pictures fade in once loaded instead of building up.
|
||||
fadeInImages();
|
||||
|
||||
followThemeInStatusBar();
|
||||
|
||||
@@ -45,6 +51,8 @@ export function startNativeApp(): void {
|
||||
void startSharedFiles();
|
||||
// Taps on TREK notifications open the place they point at.
|
||||
void loadNativeCapabilities().then(() => startNativePush());
|
||||
// A quick action on the app icon opens its page, also the one the app was launched with.
|
||||
void loadNativeCapabilities().then(() => startQuickActions());
|
||||
|
||||
// A widget or Live Activity tap opens com.liketrek.trek://navigate/<path>.
|
||||
void App.addListener('appUrlOpen', ({ url }) => {
|
||||
|
||||
Reference in New Issue
Block a user