mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-05 10:24:05 +00:00
feat(native): packing, world map and travel group widgets
- Packing: a ring of what is in the bags, each bag against its weight limit, the items still missing in their bag's colour, a nudge when departure is two days or less away - World map: the world as dots from the Atlas country shapes (WorldGrid.swift, generated by WidgetPreviews/make-world-grid.py), the visited countries glowing, the latest one ringed, continents as bars and the latest countries with their flags; it needs no trip - Travel group: who comes along as avatars, the latest chat messages as bubbles and the open poll with its votes as bars - The to-dos widget is about to-dos only; the packing ring moved out The app sends the bags, the Atlas countries (an hour's cache) and the chat and poll with the snapshot; all optional, as before.
This commit is contained in:
@@ -6,6 +6,7 @@ import { isNativeIos } from './platform';
|
||||
import { reportNativeFailure } from './reportFailure';
|
||||
import { TrekShell } from './trekShell';
|
||||
import { stopLook, type WidgetBooking, type WidgetPacking, type WidgetTodos } from './widgetExtras';
|
||||
import type { WidgetAtlas, WidgetCollab, WidgetPackingDetail } from './widgetOnline';
|
||||
|
||||
/**
|
||||
* What the home-screen widgets and the travel-day Live Activity show, built from
|
||||
@@ -38,6 +39,14 @@ export interface WidgetLabels {
|
||||
places?: string;
|
||||
travellers?: string;
|
||||
allDone?: string;
|
||||
missing?: string;
|
||||
countries?: string;
|
||||
world?: string;
|
||||
group?: string;
|
||||
poll?: string;
|
||||
votes?: string;
|
||||
noMessages?: string;
|
||||
departure?: string;
|
||||
}
|
||||
|
||||
interface WidgetStop {
|
||||
@@ -74,7 +83,9 @@ export interface WidgetSnapshot {
|
||||
weather?: WidgetWeather;
|
||||
bookings?: WidgetBooking[];
|
||||
todos?: WidgetTodos;
|
||||
packing?: WidgetPacking;
|
||||
packing?: WidgetPacking & Partial<WidgetPackingDetail>;
|
||||
atlas?: WidgetAtlas;
|
||||
collab?: WidgetCollab;
|
||||
labels: WidgetLabels;
|
||||
}
|
||||
|
||||
@@ -99,7 +110,9 @@ interface SnapshotExtras {
|
||||
weather?: WidgetWeather | null;
|
||||
bookings?: WidgetBooking[];
|
||||
todos?: WidgetTodos;
|
||||
packing?: WidgetPacking | null;
|
||||
packing?: (WidgetPacking & Partial<WidgetPackingDetail>) | null;
|
||||
atlas?: WidgetAtlas | null;
|
||||
collab?: WidgetCollab | null;
|
||||
}
|
||||
|
||||
export interface TripDay {
|
||||
@@ -259,6 +272,8 @@ export function buildSnapshot(
|
||||
if (extras.bookings) snapshot.bookings = extras.bookings;
|
||||
if (extras.todos) snapshot.todos = extras.todos;
|
||||
if (extras.packing) snapshot.packing = extras.packing;
|
||||
if (extras.atlas) snapshot.atlas = extras.atlas;
|
||||
if (extras.collab) snapshot.collab = extras.collab;
|
||||
return snapshot;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user