Skip to content

Allow hiding stale sleep recompute entries - #679

Merged
ryanbr merged 1 commit into
ryanbr:mainfrom
kavemang:fix/hide-deleted-sleep-windows-515
Jul 20, 2026
Merged

ryanbr merged 1 commit into
ryanbr:mainfrom
kavemang:fix/hide-deleted-sleep-windows-515

Conversation

@kavemang

Copy link
Copy Markdown

Summary

  • add a Hide action for each persistent deleted-sleep window on Android
  • preserve the underlying tombstone so the mistaken sleep remains suppressed after its management row is hidden
  • persist management visibility in Room with an additive migration; existing rows stay visible after upgrade
  • localize the action, accessibility description, success message, and failure message
  • cover migration safety and the separation between detector-facing and management-facing reads

Root cause

PR #526 made durable sleep-deletion tombstones visible so users could recompute a deleted night, but the same row served both detector suppression and the management UI. Because there was no independent visibility state, every intentionally deleted false sleep remained on the Sleep screen forever.

This change separates those concerns: hiding affects only the management list, while recomputing still explicitly removes the tombstone and reruns detection.

User impact

Users can clear mistaken sleep chunks from the recompute section without allowing them to return. Real sleep recorded later remains unaffected.

Related to #515.

Validation

  • ANDROID_HOME=/home/kaveman/Android/Sdk ./gradlew :app:testFullDebugUnitTest
  • focused DismissedSleepVisibilityMigrationTest and SleepEditRescoreTest
  • python3 Tools/i18n_audit.py (no Android locale key gaps)

@kavemang
kavemang marked this pull request as ready for review July 20, 2026 16:06
@ryanbr
ryanbr merged commit 1f046f3 into ryanbr:main Jul 20, 2026
1 check passed
ryanbr added a commit that referenced this pull request Jul 20, 2026
Marketing version stays 9.0.3; Android versionCode 296->297 and iOS
CURRENT_PROJECT_VERSION 206->207 so the new staging build installs over the
previous one. Content since the last testing build: Health Connect writeback
failure surfacing (#672), SpO2/respiration empty-track explanation (#673),
WHOOP 5/MG raw-IMU offload persist (#675), hide stale sleep recompute entries
(#679), Oura activity MET research corpus + cap/rotation (#676/#680), trend
chart date alignment (#528), and corrupt-DB quarantine preservation (#681).
DX23876 pushed a commit to DX23876/noop that referenced this pull request Jul 22, 2026
Add a Hide action for persistent deleted-sleep windows on the Android Sleep screen. A new managementVisible flag (additive Room MIGRATION_21_22, default 1) separates the recompute-list view from the detector tombstone: hiding a row only filters the management read (dismissedSleepsUnion), while the detector's unfiltered read keeps suppressing the deleted sleep. Localized de/es/fr/zh + a11y; migration + read-separation tests. iOS tombstones live in UserDefaults, so no GRDB twin. Related ryanbr#515/ryanbr#526.
DX23876 pushed a commit to DX23876/noop that referenced this pull request Jul 22, 2026
Marketing version stays 9.0.3; Android versionCode 296->297 and iOS
CURRENT_PROJECT_VERSION 206->207 so the new staging build installs over the
previous one. Content since the last testing build: Health Connect writeback
failure surfacing (ryanbr#672), SpO2/respiration empty-track explanation (ryanbr#673),
WHOOP 5/MG raw-IMU offload persist (ryanbr#675), hide stale sleep recompute entries
(ryanbr#679), Oura activity MET research corpus + cap/rotation (ryanbr#676/ryanbr#680), trend
chart date alignment (ryanbr#528), and corrupt-DB quarantine preservation (ryanbr#681).
simoncad7 pushed a commit to simoncad7/noop that referenced this pull request Aug 17, 2026
Add a Hide action for persistent deleted-sleep windows on the Android Sleep screen. A new managementVisible flag (additive Room MIGRATION_21_22, default 1) separates the recompute-list view from the detector tombstone: hiding a row only filters the management read (dismissedSleepsUnion), while the detector's unfiltered read keeps suppressing the deleted sleep. Localized de/es/fr/zh + a11y; migration + read-separation tests. iOS tombstones live in UserDefaults, so no GRDB twin. Related ryanbr#515/ryanbr#526.
simoncad7 pushed a commit to simoncad7/noop that referenced this pull request Aug 17, 2026
Marketing version stays 9.0.3; Android versionCode 296->297 and iOS
CURRENT_PROJECT_VERSION 206->207 so the new staging build installs over the
previous one. Content since the last testing build: Health Connect writeback
failure surfacing (ryanbr#672), SpO2/respiration empty-track explanation (ryanbr#673),
WHOOP 5/MG raw-IMU offload persist (ryanbr#675), hide stale sleep recompute entries
(ryanbr#679), Oura activity MET research corpus + cap/rotation (ryanbr#676/ryanbr#680), trend
chart date alignment (ryanbr#528), and corrupt-DB quarantine preservation (ryanbr#681).
UtkuDenizAltiok added a commit to UtkuDenizAltiok/noop that referenced this pull request Oct 3, 2026
A deleted night keeps a marker so the detector does not bring it back, and
the undo strip lasts seven seconds. After that a night deleted by mistake
could not come back on Apple platforms. Android has had a persistent list
since ryanbr#526/ryanbr#679; this brings the same card to the shared SleepView:

- each deleted night, newest first, "d MMM, HH:mm – d MMM, HH:mm";
- "Recompute this night" lifts the marker and re-scores, so the detector
  finds the night again in the raw data (a footnote says an imported night
  with no raw data may not return);
- "Hide" takes the row off the list and keeps the marker, so a sleep
  deleted on purpose stays deleted. Android stores that as the
  managementVisible column; here the markers live in the defaults, so the
  hidden ones are a second token list beside them, pruned to markers that
  still stand and cleared when a marker is lifted (recompute or undo).

The card and the undo strip also show on the empty screen, which is where
deleting the only recorded night lands. Strings reuse Android's, in all nine
locales, with the computer-sense "sleep" in pl/pt-PT corrected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
UtkuDenizAltiok added a commit to UtkuDenizAltiok/noop that referenced this pull request Oct 6, 2026
A deleted night keeps a marker so the detector does not bring it back, and
the undo strip lasts seven seconds. After that a night deleted by mistake
could not come back on Apple platforms. Android has had a persistent list
since ryanbr#526/ryanbr#679; this brings the same card to the shared SleepView:

- each deleted night, newest first, "d MMM, HH:mm – d MMM, HH:mm";
- "Recompute this night" lifts the marker and re-scores, so the detector
  finds the night again in the raw data (a footnote says an imported night
  with no raw data may not return);
- "Hide" takes the row off the list and keeps the marker, so a sleep
  deleted on purpose stays deleted. Android stores that as the
  managementVisible column; here the markers live in the defaults, so the
  hidden ones are a second token list beside them, pruned to markers that
  still stand and cleared when a marker is lifted (recompute or undo).

The card and the undo strip also show on the empty screen, which is where
deleting the only recorded night lands. Strings reuse Android's, in all nine
locales, with the computer-sense "sleep" in pl/pt-PT corrected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
UtkuDenizAltiok added a commit to UtkuDenizAltiok/noop that referenced this pull request Oct 6, 2026
A deleted night keeps a marker so the detector does not bring it back, and
the undo strip lasts seven seconds. After that a night deleted by mistake
could not come back on Apple platforms. Android has had a persistent list
since ryanbr#526/ryanbr#679; this brings the same card to the shared SleepView:

- each deleted night, newest first, "d MMM, HH:mm – d MMM, HH:mm";
- "Recompute this night" lifts the marker and re-scores, so the detector
  finds the night again in the raw data (a footnote says an imported night
  with no raw data may not return);
- "Hide" takes the row off the list and keeps the marker, so a sleep
  deleted on purpose stays deleted. Android stores that as the
  managementVisible column; here the markers live in the defaults, so the
  hidden ones are a second token list beside them, pruned to markers that
  still stand and cleared when a marker is lifted (recompute or undo).

The card and the undo strip also show on the empty screen, which is where
deleting the only recorded night lands. Strings reuse Android's, in all nine
locales, with the computer-sense "sleep" in pl/pt-PT corrected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
UtkuDenizAltiok added a commit to UtkuDenizAltiok/noop that referenced this pull request Oct 7, 2026
A deleted night keeps a marker so the detector does not bring it back, and
the undo strip lasts seven seconds. After that a night deleted by mistake
could not come back on Apple platforms. Android has had a persistent list
since ryanbr#526/ryanbr#679; this brings the same card to the shared SleepView:

- each deleted night, newest first, "d MMM, HH:mm – d MMM, HH:mm";
- "Recompute this night" lifts the marker and re-scores, so the detector
  finds the night again in the raw data (a footnote says an imported night
  with no raw data may not return);
- "Hide" takes the row off the list and keeps the marker, so a sleep
  deleted on purpose stays deleted. Android stores that as the
  managementVisible column; here the markers live in the defaults, so the
  hidden ones are a second token list beside them, pruned to markers that
  still stand and cleared when a marker is lifted (recompute or undo).

The card and the undo strip also show on the empty screen, which is where
deleting the only recorded night lands. Strings reuse Android's, in all nine
locales, with the computer-sense "sleep" in pl/pt-PT corrected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
UtkuDenizAltiok added a commit to UtkuDenizAltiok/noop that referenced this pull request Oct 8, 2026
A deleted night keeps a marker so the detector does not bring it back, and
the undo strip lasts seven seconds. After that a night deleted by mistake
could not come back on Apple platforms. Android has had a persistent list
since ryanbr#526/ryanbr#679; this brings the same card to the shared SleepView:

- each deleted night, newest first, "d MMM, HH:mm – d MMM, HH:mm";
- "Recompute this night" lifts the marker and re-scores, so the detector
  finds the night again in the raw data (a footnote says an imported night
  with no raw data may not return);
- "Hide" takes the row off the list and keeps the marker, so a sleep
  deleted on purpose stays deleted. Android stores that as the
  managementVisible column; here the markers live in the defaults, so the
  hidden ones are a second token list beside them, pruned to markers that
  still stand and cleared when a marker is lifted (recompute or undo).

The card and the undo strip also show on the empty screen, which is where
deleting the only recorded night lands. Strings reuse Android's, in all nine
locales, with the computer-sense "sleep" in pl/pt-PT corrected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
UtkuDenizAltiok added a commit to UtkuDenizAltiok/noop that referenced this pull request Oct 9, 2026
A deleted night keeps a marker so the detector does not bring it back, and
the undo strip lasts seven seconds. After that a night deleted by mistake
could not come back on Apple platforms. Android has had a persistent list
since ryanbr#526/ryanbr#679; this brings the same card to the shared SleepView:

- each deleted night, newest first, "d MMM, HH:mm – d MMM, HH:mm";
- "Recompute this night" lifts the marker and re-scores, so the detector
  finds the night again in the raw data (a footnote says an imported night
  with no raw data may not return);
- "Hide" takes the row off the list and keeps the marker, so a sleep
  deleted on purpose stays deleted. Android stores that as the
  managementVisible column; here the markers live in the defaults, so the
  hidden ones are a second token list beside them, pruned to markers that
  still stand and cleared when a marker is lifted (recompute or undo).

The card and the undo strip also show on the empty screen, which is where
deleting the only recorded night lands. Strings reuse Android's, in all nine
locales, with the computer-sense "sleep" in pl/pt-PT corrected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
UtkuDenizAltiok added a commit to UtkuDenizAltiok/noop that referenced this pull request Nov 5, 2026
A deleted night keeps a marker so the detector does not bring it back, and
the undo strip lasts seven seconds. After that a night deleted by mistake
could not come back on Apple platforms. Android has had a persistent list
since ryanbr#526/ryanbr#679; this brings the same card to the shared SleepView:

- each deleted night, newest first, "d MMM, HH:mm – d MMM, HH:mm";
- "Recompute this night" lifts the marker and re-scores, so the detector
  finds the night again in the raw data (a footnote says an imported night
  with no raw data may not return);
- "Hide" takes the row off the list and keeps the marker, so a sleep
  deleted on purpose stays deleted. Android stores that as the
  managementVisible column; here the markers live in the defaults, so the
  hidden ones are a second token list beside them, pruned to markers that
  still stand and cleared when a marker is lifted (recompute or undo).

The card and the undo strip also show on the empty screen, which is where
deleting the only recorded night lands. Strings reuse Android's, in all nine
locales, with the computer-sense "sleep" in pl/pt-PT corrected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 2c15130)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants