-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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: issue while switching between views #6200
fix: issue while switching between views #6200
Conversation
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
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 34a4028 in 18 seconds
More details
- Looked at
40
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
2
drafted comments based on config settings.
1. frontend/src/container/ExplorerOptions/ExplorerOptions.tsx:352
- Draft comment:
The order of function calls inhandleSelect
has been changed. Ensure thatupdatePreservedViewInLocalStorage
andupdateOrRestoreSelectColumns
are intended to be called beforeonMenuItemSelectHandler
. This change seems logical as it updates the local storage and restores columns before handling the menu item selection. - Reason this comment was not posted:
Confidence changes required:50%
The PR changes the order of function calls inhandleSelect
. This change is logical because it updates the local storage and restores columns before handling the menu item selection, which seems to be the intended behavior.
2. frontend/src/container/ExplorerOptions/ExplorerOptions.tsx:349
- Draft comment:
Avoid using inline styles in React components. Consider using external stylesheets, CSS classes, or styled components instead. This applies to other inline styles in this file as well. - Reason this comment was not posted:
Comment was on unchanged code.
Workflow ID: wflow_jHIk9orPcW6GoUY2
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
34a4028
to
0319da3
Compare
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
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 0319da3 in 17 seconds
More details
- Looked at
44
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
4
drafted comments based on config settings.
1. frontend/src/hooks/useUrlQueryData.ts:4
- Draft comment:
Consider using consistent import paths throughout the codebase. The import path foruseUrlQuery
was changed from an absolute to a relative path. Ensure this is consistent with other imports. - Reason this comment was not posted:
Confidence changes required:20%
The import statement foruseUrlQuery
was changed from a relative path to an absolute path, which is a minor change but should be consistent with the rest of the codebase.
2. frontend/src/hooks/useUrlQueryData.ts:14
- Draft comment:
The order of dependencies in theuseMemo
hook was changed. Ensure this order is consistent with other similar hooks in the codebase. - Reason this comment was not posted:
Confidence changes required:20%
TheuseMemo
dependency array was reordered, which is a minor change but should be consistent with the rest of the codebase.
3. frontend/src/hooks/useUrlQueryData.ts:35
- Draft comment:
TheuseCallback
dependency array was modified to removeurlQuery
. Ensure this change does not affect the expected behavior of theredirectWithQuery
function. - Reason this comment was not posted:
Confidence changes required:50%
TheuseCallback
dependency array was updated to removeurlQuery
, which is a significant change. This could affect the behavior of theredirectWithQuery
function.
4. frontend/src/hooks/useUrlQueryData.ts:1
- Draft comment:
Avoid using thecomponent/index.tsx
file structure approach, as it makes it difficult to debug and find components using global search tools like VS Code. Ensure that the file structure is clear and components are easily searchable. - Reason this comment was not posted:
Confidence changes required:50%
The code does not violate any of the specified rules. It uses hooks and does not involve any design tokens, inline styles, or ClickHouseReader interface issues.
Workflow ID: wflow_uSKP9VbRfAukCWmR
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
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! Incremental review on 88c3fa8 in 15 seconds
More details
- Looked at
24
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. frontend/src/hooks/useUrlQueryData.ts:27
- Draft comment:
Consider usinglocation.search
instead ofwindow.location.search
for consistency with thelocation
object fromuseLocation()
. - Reason this comment was not posted:
Comment was on unchanged code.
Workflow ID: wflow_yH6g6PJUhqDGon8S
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Summary
the root cause of #6187 was, using
useUrlQuery
to get the current URL's search params, we used to get the staleviewName
, therefore, it would update the selectColumns with the oldviewName
being selected. thus it would keep the old view selected.by creating
URLSearchParams
inside theredirectWithQuery
, we ensure that we're working with the most up-to-date URL state.Related Issues / PR's
close #6187
close https://github.com/SigNoz/engineering-pod/issues/1913
Screenshots
NA
Affected Areas and Manually Tested Areas
Affecter areas:
Tested:
Important
Fixes URL query handling in
useUrlQueryData
by usingURLSearchParams
for up-to-date query state and corrects import path foruseUrlQuery
.useUrlQueryData
by usingURLSearchParams
to ensure up-to-date query state.redirectWithQuery
to construct URLs with current pathname and updated query string.This description was created by for 88c3fa8. It will automatically update as commits are pushed.