Skip to content

sleep: let a typed window land before the band has synced - #1071

Open
abdulsaheel wants to merge 6 commits into
mainfrom
feat/manual-sleep-before-data
Open

abdulsaheel wants to merge 6 commits into
mainfrom
feat/manual-sleep-before-data

Conversation

@abdulsaheel

@abdulsaheel abdulsaheel commented Dec 4, 2026 •

Copy link
Copy Markdown
Collaborator

set the times and 'i was asleep' now work for a night with no recordings yet, the window scores after the next sync. nights whose recordings were pruned are still refused. stacked on the going-to-bed pr.

Summary by Sourcery

Let users record a sleep window before their band has synced that night.

New Features:

  • Allow users to enter sleep times and mark themselves asleep for nights that have not synced yet, with the saved window awaiting the next band sync.

Enhancements:

  • Distinguish a saved window awaiting sync from a correction that failed, and clear the waiting notice once the night is scored.

Tests:

  • Add coverage confirming the sleep detail screen offers “I was asleep” when no sleep row exists.

Chores:

  • Add localized strings for the new sleep-window waiting status across supported languages.

@sourcery-ai

sourcery-ai Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Implementation

Store whether an override is waiting for a band sync, clear that state when the night scores or the user changes days, and distinguish a stored-but-not-rederived window from a failed re-derive.

  • lib/ui2/screens/sleep_detail.dart L703-707, L1352-1360, L1403-1420 (+4 small edits)

Allow typed sleep windows to be stored without existing recordings, while retaining the separate path that refuses corrections for pruned recordings.

  • lib/ui2/screens/sleep_detail.dart L1249-1252

UI

Offer “I was asleep” when no night row exists, preserve the pruned-recordings refusal, and display the appropriate waiting or failure status.

  • lib/ui2/screens/sleep_detail.dart L820-825, L863-866, L872-877 (+2 small edits)

Add localized text for the sleep-window waiting state across the supported languages.

  • lib/l10n/app_de.arb L4173-4174
  • lib/l10n/app_en.arb L18919-18922
  • lib/l10n/app_es.arb L4173-4174
  • lib/l10n/app_fr.arb L4173-4174
  • lib/l10n/app_hi.arb L4173-4174
  • lib/l10n/app_ru.arb L9504-9505
  • lib/l10n/app_th.arb L17681-17682
  • lib/l10n/app_zh.arb L4173-4174

Tests

Verify that a night with no row still offers the “I was asleep” action and opens the time-entry flow.

  • test/ui2_sleep_detail_test.dart L785-791

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitai Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 48 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 9e8b816 and 0f11b25.

Files ignored due to path filters: 1

  • test/ui2_sleep_detail_test.dart is excluded by !test/**
Files selected for processing: 9

  • lib/l10n/app_de.arb
  • lib/l10n/app_en.arb
  • lib/l10n/app_es.arb
  • lib/l10n/app_fr.arb
  • lib/l10n/app_hi.arb
  • lib/l10n/app_ru.arb
  • lib/l10n/app_th.arb
  • lib/l10n/app_zh.arb
  • lib/ui2/screens/sleep_detail.dart
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 5 issues

Sourcery assessment

Needs a human reviewer. 5 findings to address first, and a typed sleep window can now be stored even when there is no synced night, and may be applied when the band syncs later. If it is attached to the wrong day or has incorrect times, that persisted override outlives a revert, but can be corrected or undone.

Blocking findings: lib/ui2/screens/sleep_detail.dart:1260, lib/ui2/screens/sleep_detail.dart:1260, lib/ui2/screens/sleep_detail.dart:1261, lib/ui2/screens/sleep_detail.dart:1369, lib/ui2/screens/sleep_detail.dart:1371


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread lib/ui2/screens/sleep_detail.dart Resolved
Comment thread lib/ui2/screens/sleep_detail.dart Resolved
Comment thread lib/ui2/screens/sleep_detail.dart Resolved
Comment thread lib/ui2/screens/sleep_detail.dart Resolved
Comment thread lib/ui2/screens/sleep_detail.dart Resolved
@abdulsaheel
abdulsaheel changed the base branch from feat/live-sleep-tap to main December 6, 2026 10:00

This branch has not been deployed

No deployments
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.

1 participant