Repository navigation
feat(ourlogs): add 'View in table' option to pinned logs - #127765
JoshuaKGoldberg wants to merge 5 commits into
Conversation
Pinned rows get a "View in table" menu option. If the log is already loaded, the table scrolls to it. Otherwise the logs query anchors on the log's precise timestamp, loading the rows on both sides of it, and then centers it. Refs LOGS-891
| }; | ||
| } | ||
|
|
||
| const JSON_NUMBER_NANOSECOND_ROUNDING = 256n; |
There was a problem hiding this comment.
todo for next week:
The anchor is padded by 256ns because browsers round 19-digit nanosecond timestamps when parsing JSON.
look into whether the server giving them as strings, not numbers, would fix things
There was a problem hiding this comment.
Ok yes I think I'm going to keep proposing this as-is. To recap, it's because the server sends timestamp_precise as a numeric value, not string - which JSON rounds sometimes. In theory we could:
- Add a new string version as an alias at the RPC layer
- Have it more smartly handle ints at high number values
- Pipe it up to be used instead here
...but that would be net a lot more code, and one more API field to know about. This PR's rounding logic isn't that much and isn't a huge problem IMO.
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit e66ed5e. Configure here.
| }; | ||
| }, []); | ||
|
|
||
| const scrollToAnchor = useEffectEvent((anchorId: string) => { |
Sentry Snapshot Testing
|
scripts/lint.ts ran root and package lint scripts through pnpm run, which joins every path into one shell string. A change to a widely imported file makes CI lint thousands of impacted files, and pnpm crashes before linting starts. Running each script's command through pnpm exec keeps the paths as separate arguments.
Adds a View in table option to the pinned logs menu. If the log isn't loaded, the logs query anchors on the log's precise timestamp (LOGS-1006) and loads the rows on both sides of it, instead of paging until it turns up. The anchor is padded by 256ns because browsers round 19-digit nanosecond timestamps when parsing JSON.
Supersedes #118457.
Pinned log menu:
Choosing it for a log from 30 minutes ago centers it in the table among its neighbors:
Closes LOGS-891.