Repository navigation
fix(db): say under hr and battery rows that day is the UTC date of each sample - #178
Merged
Merged
Conversation
…h sample db rows hr and battery bound their rows on the local day while the day column holds the sample's UTC date, so a row could read the day before the one in the title with nothing on screen to explain it. The table view now ends with one line saying so, naming the timezone. Closes #131 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018qh9xqviBHYmzVtmQWSKqA
Owner
Author
[Low impact] The PR appears safe to merge; the remaining test gap is non-blocking. Findings
SummaryAdds a wrapped explanation below nonempty
Reviews (2) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile |
Comment on lines
+218
to
+219
| const tags = rows('tags'); | ||
| expect(await new Response(tags.stdout).text()).not.toContain('UTC'); |
There was a problem hiding this comment.
Daily-table check can pass incorrectly
The tags check reads an empty collection, so it passes even if the note is wrongly added to every nonempty daily table. It also passes if the command fails and writes nothing to stdout. Insert a daily row inside the requested range, assert a successful exit, and then check that its table has no note.
# Conflicts: # CHANGELOG.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #131.
Planned together with #129 (#177), but the two are unrelated, so each has its own PR.
What
db rows hranddb rows batteryend the table view with one line, wrapped at the screen width:The line appears only for a ranged timeseries (
rangeParams: 'datetime') that returned rows. Daily collections, the ring snapshot, an empty result and JSON output are unchanged.Why
Rows are bounded on the local day, as
fetchbounds its request, whiledaystores the UTC date of the sample (README, agents section). Before this,db rows battery --day 2026-09-10in Asia/Dubai listed rows dated 2026-09-09, and nothing on screen said why.How checked
src/commands/db.test.ts: a temp cache with one battery sample at2026-09-09T22:00:00+00:00, read with--tz Asia/Dubai --day 2026-09-10. The row is listed with day 2026-09-09 and the last line is the note.db rows tagson the same cache prints no note. The test fails on main.src/commands/db.test.ts:const utcNote = range !== null && c.rangeParams === 'datetime' && rows.length > 0→const utcNote = false: 1 of 19 fails (the new test).bun run check: typecheck, Biome, Knip clean; 712 tests pass.Overlap:
src/commands/db.tsis also changed by #176 (descriptions, different lines).🤖 Generated with Claude Code
https://claude.ai/code/session_018qh9xqviBHYmzVtmQWSKqA