-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(logs): centralize time range handling in DateTimeSelectionV2 #7175
Open
ahmadshaheer
wants to merge
1
commit into
main
Choose a base branch
from
fix/time-range-edge-case
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+24
−74
Conversation
This file contains 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
- Remove custom time range handling logic from logs components - Use unified time range selection through DateTimeSelectionV2 component
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good to me! Reviewed everything up to f8c2788 in 1 minute and 0 seconds
More details
- Looked at
268
lines of code in5
files - Skipped
0
files when reviewing. - Skipped posting
12
drafted comments based on config settings.
1. frontend/src/container/LogsExplorerViews/index.tsx:102
- Draft comment:
Good removal of the onTimeRangeChange logic. Ensure that unified time range changes are fully handled in DateTimeSelectionV2 now. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold50%
None
2. frontend/src/container/TopNav/DateTimeSelectionV2/index.tsx:762
- Draft comment:
Avoid inline styles (e.g., using style={{ marginRight: 12 }}). Use CSS classes or styled components to ensure design consistency. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
3. frontend/src/hooks/logs/types.ts:5
- Draft comment:
Removal of pageSize field from LogTimeRange looks intentional. Verify that no dependent code still relies on it. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold50%
None
4. frontend/src/hooks/logs/useCopyLogLink.ts:44
- Draft comment:
onLogCopy implementation is straightforward. Verify that URL query manipulation aligns with new time range centralization. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold50%
None
5. frontend/src/hooks/useLogsData.ts:151
- Draft comment:
Ensure that merging of logs in useEffect([data]) properly handles resetting when a new query is issued. - Reason this comment was not posted:
Confidence changes required:33%
<= threshold50%
None
6. frontend/src/container/LogsExplorerViews/index.tsx:102
- Draft comment:
Removal of the onTimeRangeChange prop centralizes time range updates to DateTimeSelectionV2. Ensure that all side‐effects on time changes are now solely handled by the unified component. - Reason this comment was not posted:
Confidence changes required:33%
<= threshold50%
None
7. frontend/src/container/TopNav/DateTimeSelectionV2/index.tsx:317
- Draft comment:
The conditional branch for non-logs explorer pages was removed to unify URL updates. Verify that this unified handling correctly updates URL parameters for all pages. - Reason this comment was not posted:
Confidence changes required:33%
<= threshold50%
None
8. frontend/src/container/TopNav/DateTimeSelectionV2/index.tsx:762
- Draft comment:
Avoid using inline styles (e.g. marginRight inline here). Move this styling to a CSS class or styled component to maintain design and theming consistency. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
9. frontend/src/hooks/logs/types.ts:5
- Draft comment:
The unused 'pageSize' property has been removed from LogTimeRange. Ensure that all consumers of this type are updated accordingly. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%
<= threshold50%
This comment is asking the PR author to ensure that all consumers of the type are updated, which violates the rule against asking the author to ensure things are tested or reviewed. It doesn't provide a specific suggestion or point out a specific issue.
10. frontend/src/container/LogsExplorerViews/index.tsx:459
- Draft comment:
Typographical suggestion: In the error message ('Panel limit exceeded for ... Please checkout our paid plans'), consider changing 'checkout' to 'check out' for improved clarity. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
11. frontend/src/container/TopNav/DateTimeSelectionV2/index.tsx:93
- Draft comment:
Typo: The state variable 'isValidteRelativeTime' appears to be misspelled. Consider renaming it to 'isValidRelativeTime' for clarity. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
12. frontend/src/container/TopNav/DateTimeSelectionV2/index.tsx:293
- Draft comment:
Typo: The variable 'minutedDiff' is likely a misspelling of 'minutesDiff'. Consider renaming it to improve readability. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
Workflow ID: wflow_0Jc0QeJ6JG7zegYc
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
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.
Summary
Time range selection was not updating correctly when logs explorer
query_range
returned empty results. This was caused by custom time range handling logic in logs components that bypassed the time range handling inDateTimeSelectionV2
component.DateTimeSelectionV2
componentRelated Issues / PR's
close #7163
Screenshots
Before:
2025-02-23.19-00-26.mov
After:
2025-02-23.19-01-04.mov
Affected Areas and Manually Tested Areas
Important
Centralizes time range handling in
DateTimeSelectionV2
, removing custom logic from logs components.DateTimeSelectionV2
.LogsExplorerViews
anduseCopyLogLink
.onTimeRangeChange
fromuseCopyLogLink
anduseLogsData
.LogTimeRange
type fromtypes.ts
.DateTimeSelectionV2
by removing conditional logic for logs explorer.DateTimeSelectionV2
to remove unused imports and variables.This description was created by
for f8c2788. It will automatically update as commits are pushed.