fix(worldclock): keep seconds quiet for TalkBack and apart from the defaults

The time each row and the home readout give TalkBack stays at minute
precision, and the ticking text is kept out of the tree, so a focused
row is not re-read every second. The row's time is capped in width and
shrinks to fit, so a large font scale cannot crowd out the city name.

The setting is its own SettingsPrefs flow rather than a ClockDefaults
field, so flipping it re-emits nothing alarms and timers watch. The
clock-change receiver sits outside the flatMapLatest and restarts the
tick, registering once per subscription and re-measuring the wait
against the clock as it now reads.
This commit is contained in:
makiolaj committed 2026-10-21 19:07:19 +02:00
1 parent a4cec23e5c
commit 65c86af313
21 files changed
+138 -53

No files matched your search

+14 -5
View File
@@ -595,7 +595,7 @@ Four slices:
| Slice | Keys | Owner |
|---|---|---|
| Appearance (M1) | `theme_mode`, `dynamic_color` | `AppearancePrefs` in `core-prefs`, the family's shared key names |
| Clock defaults (M2) | `default_snooze_minutes`, `default_snooze_limit`, `default_vibrate`, `default_volume_ramp_seconds`, `default_alarm_ringtone_uri`, `default_timer_ringtone_uri`, `default_dismiss_challenge`, `home_zone_id`, `world_clock_show_seconds` | `ClockPrefs`, surfaced as `SettingsPrefs.defaults: Flow<ClockDefaults>` |
| Clock defaults (M2) | `default_snooze_minutes`, `default_snooze_limit`, `default_vibrate`, `default_volume_ramp_seconds`, `default_alarm_ringtone_uri`, `default_timer_ringtone_uri`, `default_dismiss_challenge`, `home_zone_id`, `world_clock_show_seconds` | `ClockPrefs`, surfaced as `SettingsPrefs.defaults: Flow<ClockDefaults>`; `world_clock_show_seconds` (#23) as its own `SettingsPrefs.worldClockSeconds`, so flipping a display option re-emits nothing alarms and timers watch |
| Stopwatch run record (M2) | `stopwatch_state`, `stopwatch_started_elapsed_millis`, `stopwatch_accumulated_millis`, `stopwatch_last_lap_cumulative_millis` (M7 is the first caller of the last, for the in-progress lap's split) | `StopwatchPrefs`, behind `StopwatchStateStore` |
| System facts (M3) | `last_boot_id` | `SystemPrefs`, behind `BootStateStore`, the persisted half of the reboot gate |
| Timers (M6) | `timer_presets`, `timer_ring_sounding_since_millis` | `TimerPrefs`: the presets surfaced as `SettingsPrefs.timerPresets`, the ring session's anchor behind `TimerRingStateStore` |
@@ -2458,12 +2458,21 @@ it switches the cadence at once through the same `flatMapLatest`.
A minute is too long to wait for `TIME_SET` or `TIMEZONE_CHANGED`, which can
arrive with the tab on screen (a network zone change on landing, split
screen). So `ClockChanges` (`AndroidClockChanges`, a receiver registered only
while the tab collects) is merged into the tick: those two, plus `TIME_TICK`,
make the state re-read the clock and the zone at once. `TIME_TICK` also
while the tab collects) restarts the tick: those two, plus `TIME_TICK`, make
the state re-read the clock and the zone at once, and the restarted ticker
measures its next wait against the clock as it now reads. `TIME_TICK` also
covers the one gap an aligned `delay` has, a deep sleep inside the
five-second `WhileSubscribed` grace, which stretches the wait because the
main looper's clock stops while the device sleeps. Every one of these is
an extra `build`, and `distinctUntilChanged` drops it if nothing moved.
main looper's clock stops while the device sleeps. The signal is combined
with the stored list, the home zone and the setting *outside* the
`flatMapLatest`, so the receiver is registered once per subscription, not
once per list edit. Each broadcast costs one extra `build`, which
`distinctUntilChanged` drops when nothing moved.
TalkBack is given the time to the minute even with seconds on: the row's
description and the home readout's semantics use the minute formatter, and
the ticking text is kept out of the tree, because a focused node whose text
changed every second would be re-announced every second.
### Twenty-four cities, and a reorder a screen reader can reach
+2 -1
View File
@@ -145,7 +145,8 @@ Field names mirror `ClockPrefs`'/`SettingsPrefs`' own on-disk keys. Older
files may also carry `default_timer_duration_millis`, from a default timer
length setting that has since been removed; it is ignored on import like any
other unknown field. Files from before `world_clock_show_seconds` existed
import with it off, its default. Every
import with it off, its default. It travels with the settings but is not a
clock default: nothing an alarm or timer inherits depends on it. Every
numeric/duration value is clamped on *apply* using the same ranges and encoding
as the existing preference setters, never on parse.