Skip to content

Refactor/home page background - #522

Merged
whes1015 merged 92 commits into
mainfrom
refactor/home-page-background
Aug 11, 2026
Merged

Refactor/home page background#522
whes1015 merged 92 commits into
mainfrom
refactor/home-page-background

Conversation

@whes1015

@whes1015 whes1015 commented Aug 9, 2026

Copy link
Copy Markdown
Member

No description provided.

@whes1015
whes1015 force-pushed the refactor/home-page-background branch from 551706a to 0481412 Compare August 9, 2026 15:25
@whes1015
whes1015 force-pushed the refactor/home-page-background branch from 0481412 to 25b7bd4 Compare August 9, 2026 15:32
@whes1015
whes1015 force-pushed the refactor/home-page-background branch from 92f3d06 to 42589dc Compare August 10, 2026 14:09
Wire the home sheet's 近 1 小時降雨趨勢 card to
GET /api/weather/rainforecast/{code} (exptech.dingbot.tw), decoding the
start/60×mm envelope into RainHourTrend with loading/error states.
Keep the blur/dim layer's tree shape constant (ImageFiltered.enabled +
an always-present transparent scrim) so the sky's element is never
re-parented when the sheet starts climbing or content scrolls — which
used to reset WeatherSkyBackground's shader cache and flash the flat
fallback colour.
CWB's ones digit refines the glyph: showers, fog banks, hail and
lightning each get their own icon (with 大雷雨 filled, the heaviest
rung), while the accent colour keeps following the resolved mode so the
family tint stays consistent.
Featured earthquake card on primaryContainer plus a two-column ranking
grid with accent-coloured icons and badges.
RainHourTrend gains a structured summary (grade, sustained, stop time)
that drives a one-line reading under the card title; the chart's axis
now labels minutes-from-now ticks instead of Taipei wall clock times.
Pre-render one PNG per speed bucket with a black outline baked in
(MapLibre's icon-halo only works on true SDF images), pick the image via
a step expression, and expose readingIcon so sheets can reuse the arrow.
The speed curve is drawn in per-bucket runs (the same white→pink ramp as
the map arrows) instead of one flat line, and the X-axis ticks use
speed-coloured WindArrowIcon glyphs; the station hero gains the same
rotating arrow icon.
fl_chart requires one tooltip item per touched spot; a touch at a segment
boundary hits two bars at the same x, and deduping them shrank the list
— drawTouchTooltip threw "tooltipItems and touchedSpots size should be
same". windTooltipItems returns every item; the identical duplicates
overlap and read as one card.
Bump the native memory cache to 24M and warm outward from the selected
frame (0 ±4, then ±12 and beyond while space remains): warm() gains a
fillUntil target so injection stops at the mirror's cap instead of
churning LRU, and the timeline re-centres its warm band when scrubbing
past it.
Extract the radar layer's scan-range + county + township overlay into a
ScanRangeOverlayChrome mixin and reuse it for the QPESUMS layer, so the
next-1-hour forecast layer draws the same boundaries as the radar.
After a hot restart the engine can still own the previous isolate's view
id, so UiKitView creation fails with recreating_view and onMapCreated
never fires. Remount the map with a fresh key when it isn't ready within
4s (bounded retries), and treat the benign platform exception as neither
a log entry nor a fatal crash.
Replace the native MapLibre compass (rendered inside the platform view,
so any Flutter overlay — typhoon forecast tooltips, an expanded sheet —
paints over it) with a Flutter MapCompass at the top of the map stack,
driven by the camera bearing and tapping to reset north.
未來1小時 → 未來 1 小時 for the four Chinese variants.
Legacy handled tap → navigation inside notify.dart; the rewrite had it
as a private method on the app service host. Move it to
notification_routes.dart (which already owns the channel → route table)
as routeNotificationTap — the app host just registers it on
NotificationTaps — with an injectable navigate for tests.
@whes1015
whes1015 force-pushed the refactor/home-page-background branch from 8306f93 to 7e3c228 Compare August 10, 2026 16:00
Add the full AHI band catalogue (B01–B16) plus the named products the
satellite-tiles-go backend serves (btd_*, cloudtop, truecolor, ash, …),
each with its own id/label mapping. The frame API now takes a `channel`
query; a band can carry a `style` for temperature-scaled renderings.
Satellite imagery is fully opaque and overall dark, so the white admin
frame washes out on it. AdminOutline.add takes an optional lineColor and
satellite draws bright yellow country/county + dark yellow township
borders (typhoon's satellite underlay too); radar/QPESUMS keep the white
core. Add an onReloadActive hook to MapLayer chrome so a style change can
re-mount a layer, and stop moving the camera on a bare layer switch.
Thermal bands get a colour-style menu (grayscale/jma/bd) that re-mounts
the layer through onReloadActive; every channel's picker tile shows a
subtitle with the band or formula. Per-channel legends explain the colour
scale and why parts are transparent (clear sky, night, no value), all
localised across the supported locales.
A lost GPS fix left RegionStore on the stale last-known township, so the
home backdrop kept framing and outlining a place the user wasn't in.
LocationMonitor now clears the code when location becomes unusable, and
the backdrop frames on a cached fix (never a live read) so a simulator
with no location falls back to the nationwide view instantly instead of
waiting out the 10s GPS timeout.
A `pub get` run while the local path override was active had rewritten
the lock entry to the machine-local fork path. Restore the committed git
source so CI resolves the pinned revision.
_restackOverlays fell back to the last applied code, so an explicit null
(GPS lost, or the nationwide view) re-drew the previous township's mesh
and purple selection outline. The caller now owns the subject and a
deliberate null reaches the outline layers unchanged, clearing the frame.
Add the 數值預報 group to the map: a QPESUMS sibling that fetches each
model's WND1 grid (/api/v1/wind/<model>/<ts>.bin) and rides a CPU
particle field over the wind tiles, ported from the web renderer's
trail-buffer pass. A forecast opens on the frame nearest the present
instead of its furthest step (nowFrameIndex), the 0.25° grids cap at
zoom 7, and the layer draws its own admin frame via the shared
AdminOutlineChrome.
The world-country frame is noise on a Taiwan-focused surface, so it now
ships off everywhere and is an explicit toggle: radar/QPESUMS fold their
admin chrome onto the shared AdminOutlineChrome (which gains the global
toggle and its legend row), and satellite gets the same toggle in both
its style menu (thermal bands) and a new reference menu (products and
reflectance bands), with the legend row following the switch.
Drop the appendUnit mode so every value column stays numbers-only and
the unit lives on its own line below the ramp.
ECMWF/GFS tile URLs are content-addressed like radar/satellite, but the
marker list never covered the wind path — every revisit re-downloaded the
frame. One marker brings them into SQLite, the native intercept, and the
warm path, with a parity test alongside the radar one.
Cut the per-frame CPU cost without changing the picture: the view rotation
is computed once and inlined instead of a sin/cos per particle, u/v bilinear
samples share one cell-geometry pass, the speed buckets are reused instead
of allocated every frame, and the layer stops re-casting the repository.
NetworkUsageStore gains a zero-filled per-hour history query, and the
Developer page plots the trailing 24 hours under the network section.
Frames either side of the present now carry an era label in a fixed hue
(history blue, now green, future purple, light/dark shaded per theme) on
both the headline time and the ruler ticks.
The per-hour usage chart leaves DeveloperPage as a public NetworkUsageChart
widget so the stacked downloaded/saved bars and the empty placeholder are
covered by widget tests instead of living inline in the page.
Brings files that had drifted from dart format back in line (pure layout
changes; no behaviour touched).
Download plots red and Saved green for contrast, and a segmented switch
chooses stacked-both, download-only, or saved-only — the legend and
tooltip follow the selection.
Store history() aggregates into arbitrary bucket widths, so the chart can
switch between 24 hourly points and 28 six-hour points for the trailing
week. The x-axis is labelled in Taipei wall-clock (11日13時).
fl_chart's BarChart ignores SideTitles.interval (discrete x slots), so
every hour was labelled and the full-width 11日13時 text collided. The
step is now applied inside getTitlesWidget — every 6 h on the 24h window,
every 7 buckets on 7d — and the 7d bars are slimmed so 28 fit the width.
The tooltip for edge bars rendered past the phone bounds. Clamp the
bubble with fitInsideHorizontally/Vertically and cap its width so it
always stays within the chart.
nowFrameIndex used absolute distance, so at 21:43 a 3-hourly ECMWF set
labelled the 23:00 prediction as the present (77 min away) over the
already-due 20:00 (103 min). The present is now the newest frame at or
before now — observed data is unchanged, and a forecast never presents
a prediction as current before it has happened.
Picking Google/Apple Maps now awaits the launch result and, when the app
is missing, shows an error snackbar instead of silently doing nothing.
The mapAppOpenFailed string is added across every ARB and the l10n
generated code is refreshed to match.
A next-hour forecast frame at 21:00 estimates the 21:00-22:00 window, so
QPESUMS now renders the selected frame as a range ("21:50 – 22:50") instead
of a bare instant read as a point measurement. Wind layers (ECMWF/GFS)
additionally name the model-run issue time (資料時間) under the caption:
the API serves only the latest run, so the oldest frame is the run start.
Restroom/shelter chips are gone from the peek; each body now takes its
sub-layer's colour accent. Map-app flow is folded into one pickAndOpenMapApp
helper with a shared failure snackbar, and AED pages can dial the emergency
phone via a tel: helper (mapAppCallFailed when no handler).
Warning blocks gain an icon and a border; tapped waypoints become filled
circle markers with a forecast-lead line and a clearer two-line layout.
A local pubspec_overrides.yaml path fork leaked into the lockfile and
failed the check_pubspec_lock.sh CI gate. Regenerated the lock with the
override aside so maplibre_gl resolves back to the pinned git ref.
@whes1015
whes1015 merged commit 087d927 into main Aug 11, 2026
3 checks passed
@whes1015
whes1015 deleted the refactor/home-page-background branch August 11, 2026 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant