Skip to content

fix(status): reopen a Today status as Today near 16:00 - #275

Merged
loganj merged 1 commit into
mainfrom
larry/status-duration-closest
Sep 25, 2026
Merged

loganj merged 1 commit into
mainfrom
larry/status-duration-closest

Conversation

@loganj

@loganj loganj commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

🤖

Summary

  • When you set a status to clear "Today" and open the status editor again, the duration menu should still say Today. Near 16:00 local time it said 8 hours, and near 23:00 it said 1 hour.
  • This also caused an intermittent failure in the WebKit browser test user-status.spec.mjs. The browser tests run in UTC, so any CI run that saved a status between about 15:58 and 16:02 UTC failed with Duration: 8 hours.
  • The editor now picks the preset that matches the saved expiry most closely.

Details

  • Statuses save only an expiry time, not the preset the user picked. When the editor reopens, it guesses the preset by comparing the expiry with each preset's deadline, allowing a difference of up to two minutes. Before, it took the first preset in the list that was within two minutes. Around 16:00, "8 hours from now" is also within two minutes of midnight, and "8 hours" comes before "Today" in the list.
  • Now it takes the preset with the smallest difference. The preset the user actually picked is normally an exact or near-exact match, so it wins.
  • A mix-up can still happen if two presets produce the same deadline to the second. For example, on Sunday "Today" and "This week" both end at midnight. In that case either label describes the saved expiry correctly.
  • The new unit test in status-duration.test.ts covers 16:00 and 23:00. It fails on main with Expected "today", Received "28800".
  • The browser failure was reproduced locally. The WebKit test ran with the browser clock at about 15:59: it fails on main with the same error seen in CI and passes with this change.

The editor infers which duration preset a saved status used by comparing
its expiry with each preset's deadline, within two minutes. It took the
first match. Around 16:00 the 8-hour deadline is also within two minutes
of midnight, so a Today status reopened as 8 hours (and 1 hour near
23:00). Choose the closest preset instead.

Signed-off-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz>
@loganj
loganj force-pushed the larry/status-duration-closest branch from f0c1608 to d5f07c9 Compare September 25, 2026 19:11
@loganj
loganj marked this pull request as ready for review September 25, 2026 19:31
@loganj
loganj requested review from a team, comp615 and wesbillman as code owners September 25, 2026 19:31

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Star Lord — automated source review via Wes's account

No actionable findings in this change.

Reviewed head d5f07c9bef22b5fffc74a9316b0ac8e3e200687e against base/merge-base 76946a4a6dabec18fd208ef71dcd9c676d970592.

  • Traced the nearest-deadline selection through the status editor's initialization and unchanged-expiry preservation, plus the status parsing/save path. On production integer-second timestamps, this retains the existing two-minute tolerance; exact ties preserve preset order, consistent with the documented limitation that the chosen preset is not persisted.
  • Inspected the deterministic unit regression cases around the eight-hour and one-hour midnight overlaps, existing editor deadline-preservation coverage, and the unchanged browser reopen assertion. The change stays scoped to preset inference and its unit regression test.

Validation limits: source-only review; pinned source extracts verified and read-only git diff --check passed. No PR code, tests, builds, or app workflows were executed. The PR's reported fail-then-pass/WebKit results were not independently reproduced; CI and runtime acceptance were not assessed. This is a non-blocking COMMENT review, not approval or merge authorization.

@loganj
loganj merged commit 734949a into main Sep 25, 2026
12 checks passed
@loganj
loganj deleted the larry/status-duration-closest branch September 25, 2026 23:38
zrmarley added a commit that referenced this pull request Sep 28, 2026
…ad-on-send

* origin/main: (58 commits)
  Keep profile avatar cutouts transparent and align the header gutter (#319)
  Restore sidebar status icons beside names (#316)
  docs(mentions): specify portable mention rules (#343)
  fix(agents): wait for native host operations (#331)
  Simplify channel templates and report setup failures accurately (#318)
  feat(agents): Harnesses Goose install (slice 3/5) (#279)
  feat(agents): Harnesses status card in Settings (slice 2/5, stacked on #272) (#277)
  Fix timer operation ownership and stabilize timing regressions (#317)
  Restore cached workspace before relay startup (#311)
  test(browser): wait for the app's own quota cooldown before retrying (#284)
  docs: define Harnesses setup and global agent defaults (#272)
  Make mention choices consistent and stable (#258)
  Discover saved relay agents without changing the page (#224)
  feat: add persistent dev log levels and relay traffic summaries (#306)
  Polish inline message reactions and previews (#213)
  feat(identity): add native macOS import, creation and backup (#308)
  fix(status): reopen a Today status as Today near 16:00 (#275)
  test: use current navigation for GIF send roundtrip (#309)
  Fix composer focus when selecting channels and DMs (#307)
  fix: retire mention searches after chips and refuted prose (#303)
  ...

# Conflicts:
#	src/features/messages/MessageComposer.test.tsx
#	src/features/messages/MessageComposer.tsx
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