feat(ourlogs): only re-query truncated logs on significant viewport width increases#117014
Merged
Merged
Conversation
Logs query with a `truncate` parameter derived from the viewport width. Previously the value tracked `window.innerWidth` directly, so shrinking the viewport lowered `truncate`, changed the query key, and triggered an unnecessary re-query even though the already-fetched messages were long enough to display. Round the truncation length up to the next power of two and track it as a monotonically increasing high-water mark. Shrinking the viewport never lowers the value, and small growth stays within the same power-of-two bucket, so a re-query only happens when the viewport grows past the next boundary. Refs LOGS-839 Co-Authored-By: Claude <noreply@anthropic.com>
Member
Author
|
@cursor review |
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 2e2b9e4. Configure here.
nsdeschenes
approved these changes
Jun 8, 2026
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.

Logs query with a
truncateparameter derived from the viewport width. Previously the value trackedwindow.innerWidthdirectly, so shrinking the viewport loweredtruncate, changed the query key, and triggered an unnecessary re-query even though the messages already fetched were long enough to display. 😬This PR adds a monotonic, power-of-two truncation length. Meaning: truncation length is now rounded up to the next power of two and tracked as an increasing high-water mark (we never go down, only equal or up).
The truncation length steps up at these viewport widths:
innerWidthThis means we fetch a little bit more data for logs than we need. But it's not much more data and shouldn't change much.
Closes LOGS-839