-
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
feat: add documentation link for logs explorer quick filters #6854
base: main
Are you sure you want to change the base?
Conversation
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 bb9f8e2 in 2 minutes and 59 seconds
More details
- Looked at
132
lines of code in3
files - Skipped
0
files when reviewing. - Skipped posting
3
drafted comments based on config settings.
1. frontend/src/components/QuickFilters/FilterRenderers/Checkbox/Checkbox.tsx:426
- Draft comment:
Consider adding a null check forsection
before using it in the URL to prevent potential issues iffilter.attributeKey.key
is not found inQUICK_FILTER_DOC_PATHS
. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
- The comment has a valid concern - if the key doesn't exist in QUICK_FILTER_DOC_PATHS, section would be undefined. 2. However, this is a UI element for documentation links - worst case is the link doesn't work perfectly. 3. The keys in QUICK_FILTER_DOC_PATHS seem to match the expected filter keys. 4. This is not a critical path that would break functionality.
The comment identifies a real edge case that could occur. Missing documentation links could be frustrating for users.
While valid, this is a low-risk UI enhancement feature. The worst case is a slightly malformed documentation URL, not a critical error.
The comment should be deleted as it suggests defensive programming for a non-critical UI feature. The potential issue is minor and doesn't warrant the added complexity.
2. frontend/src/components/QuickFilters/QuickFilters.tsx:128
- Draft comment:
Ensure that thekey
prop for theCheckbox
andSlider
components is unique. Consider using a combination offilter.type
andfilter.title
or another unique identifier. - Reason this comment was not posted:
Comment did not seem useful.
3. frontend/src/components/QuickFilters/FilterRenderers/Checkbox/Checkbox.tsx:553
- Draft comment:
Avoid using inline styles likecolor={Color.BG_ROBIN_400}
. Use CSS classes or styled components instead. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
While generally avoiding inline styles is good practice, this case is using a proper design token from a design system. The color is not hardcoded but rather referenced from a centralized token system. The styling is also quite minimal - just a single color property. Moving this to a CSS class would add complexity without much benefit.
The comment correctly identifies an inline style usage. Using CSS classes could make the styling more maintainable and consistent with other components.
However, since this is using a proper design token and is just a single color property, the benefit of moving it to CSS would be minimal. The current approach maintains the connection to the design system while being simple and clear.
The comment should be deleted as it's suggesting a change that would add complexity without significant benefit, especially since proper design tokens are already being used.
Workflow ID: wflow_PNmEAQdHqkiRp1ef
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.
Updated recording after the suggested changes 2025-01-20.17-21-58.mov |
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.
❌ Changes requested. Incremental review on 233e0eb in 58 seconds
More details
- Looked at
355
lines of code in3
files - Skipped
0
files when reviewing. - Skipped posting
4
drafted comments based on config settings.
1. frontend/src/assets/CustomIcons/EmptyQuickFilterIcon.tsx:90
- Draft comment:
TheEmptyQuickFilterIcon
component is well-structured and follows best practices. No issues found. - Reason this comment was not posted:
Confidence changes required:0%
The PR introduces a new icon componentEmptyQuickFilterIcon
which is used in theCheckboxFilter
component. The icon is a static SVG and does not have any dynamic behavior or props that could lead to issues. The component is well-structured and follows React best practices. No issues found here.
2. frontend/src/components/QuickFilters/FilterRenderers/Checkbox/Checkbox.styles.scss:164
- Draft comment:
The CSS changes are consistent with existing styles and follow best practices. No issues found. - Reason this comment was not posted:
Confidence changes required:0%
The CSS changes inCheckbox.styles.scss
are mostly structural and stylistic, aligning with the new design requirements. The changes are consistent with the existing styles and do not introduce any obvious issues. The use of BEM-like naming conventions is appropriate.
3. frontend/src/components/QuickFilters/FilterRenderers/Checkbox/Checkbox.tsx:478
- Draft comment:
The logic for displaying the documentation link is correctly implemented and aligns with the PR's intent. No issues found. - Reason this comment was not posted:
Confidence changes required:0%
TheCheckboxFilter
component has been updated to include a new section for the documentation link when no attribute values are found. This aligns with the PR's intent to add a documentation link. The logic for displaying this section is correctly implemented, checking for!isLoading
,!isInfraMonitoring
, and!attributeValues.length
. The URL construction for the documentation link is also correct.
4. frontend/src/components/QuickFilters/FilterRenderers/Checkbox/Checkbox.tsx:494
- Draft comment:
Avoid using inline styles for the ArrowUpRight icon's color property. Use a CSS class or styled component instead. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
While generally avoiding inline styles is good practice, in this case the color is using a design token which is the recommended approach for maintaining consistent theming. The comment seems to misunderstand that using a design token via props is actually a good pattern. The icon component likely expects a color prop as part of its API.
Could there be value in moving even design token colors to CSS classes for better maintainability? Would that make the code more complex for little benefit?
Using design tokens via props is a valid and common pattern, especially for icon components. Moving this to CSS would add complexity without clear benefits since we're already using the design system correctly.
Delete this comment since it incorrectly flags proper usage of design tokens through component props as an issue.
Workflow ID: wflow_QR0sCgfhZivLh9FC
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
@ahmadshaheer the loading state shows the filter and no values found, which should not be the case. please take care of that |
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.
❌ Changes requested. Incremental review on a103c97 in 51 seconds
More details
- Looked at
163
lines of code in3
files - Skipped
0
files when reviewing. - Skipped posting
3
drafted comments based on config settings.
1. frontend/src/components/QuickFilters/FilterRenderers/Checkbox/QuickFilterEmptyState.tsx:22
- Draft comment:
Consider adding a default case forQUICK_FILTER_DOC_PATHS
to handle unknownattributeKey
values gracefully. - Reason this comment was not posted:
Confidence changes required:50%
The PR introduces a new componentQuickFilterEmptyState
to handle the empty state of quick filters. This component is used inCheckbox.tsx
to replace the inline JSX for the empty state. The component correctly uses theQUICK_FILTER_DOC_PATHS
to generate the documentation link based on theattributeKey
. The logic for opening the documentation link is encapsulated within thehandleLearnMoreClick
function, which is a good practice for separation of concerns. The component is styled using the existing CSS classes, ensuring consistency with the rest of the application. Overall, the component is well-structured and integrates seamlessly with the existing code.
2. frontend/src/components/QuickFilters/FilterRenderers/Checkbox/Checkbox.tsx:460
- Draft comment:
Ensure that theattributeKey
passed toQuickFilterEmptyState
is always valid and present inQUICK_FILTER_DOC_PATHS
to avoid potential issues with undefined links. - Reason this comment was not posted:
Confidence changes required:50%
The PR modifies theCheckbox.tsx
file to use the newQuickFilterEmptyState
component. This change is appropriate as it encapsulates the empty state logic into a separate component, improving code readability and maintainability. TheQuickFilterEmptyState
component is used when there are no attribute values and theisInfraMonitoring
flag is false. This logic aligns with the existing behavior, ensuring that the empty state is displayed under the correct conditions. The removal of thehandleLearnMoreClick
function fromCheckbox.tsx
and its inclusion inQuickFilterEmptyState
is a good refactor, as it centralizes the logic related to the empty state in one place.
3. frontend/src/components/QuickFilters/FilterRenderers/Checkbox/QuickFilterEmptyState.tsx:1
- Draft comment:
Avoid usingcomponent/index.tsx
file structure forQuickFilterEmptyState
. It makes it difficult to debug and find components using global search tools. - Reason this comment was not posted:
Comment was on unchanged code.
Workflow ID: wflow_Olb2ZgMvbk92p2dC
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
frontend/src/components/QuickFilters/FilterRenderers/Checkbox/QuickFilterEmptyState.tsx
Show resolved
Hide resolved
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.
❌ Changes requested. Reviewed everything up to f9afdeb in 1 minute and 49 seconds
More details
- Looked at
411
lines of code in7
files - Skipped
0
files when reviewing. - Skipped posting
4
drafted comments based on config settings.
1. frontend/src/components/QuickFilters/FilterRenderers/Checkbox/QuickFilterEmptyState.tsx:23
- Draft comment:
Consider adding a check to handle cases whereattributeKey
is not found inQUICK_FILTER_DOC_PATHS
to avoid potential undefined behavior. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
The issue is real - an undefined section would lead to a broken URL. However, looking at the QUICK_FILTER_DOC_PATHS object, it seems to be a fixed mapping for specific known attributes. The component is likely only used with these known keys. The PR rules say not to make speculative comments or ask for checks unless we're certain there's an issue.
I could be wrong about the component only being used with known keys - there might be dynamic attribute keys passed in that aren't in the mapping.
Without seeing the parent components and how this is used, we can't be certain this is a real issue. The PR rules specifically say to delete comments if we need more context.
Delete the comment since we don't have strong evidence that undefined keys are actually possible in practice.
2. frontend/src/components/QuickFilters/FilterRenderers/Checkbox/Checkbox.tsx:24
- Draft comment:
Consider makingsource
a required prop without a default value to ensure it is always provided. - Reason this comment was not posted:
Confidence changes required:50%
TheCheckboxFilter
component uses thesource
prop to determine if the empty state with documentation should be shown. This is a good approach, but it would be more robust to ensure thatsource
is always provided by making it a required prop without a default value. This will prevent any potential issues if thesource
is accidentally omitted.
3. frontend/src/components/QuickFilters/FilterRenderers/Checkbox/Checkbox.tsx:447
- Draft comment:
Consider storing the conditionattributeValues.length > 0
in a variable to avoid repetition and improve readability. - Reason this comment was not posted:
Confidence changes required:30%
TheCheckboxFilter
component has a section where it checks ifattributeValues.length > 0
to render the values. However, this check is repeated multiple times in the component. It would be more efficient to store this condition in a variable and reuse it, improving readability and maintainability.
4. frontend/src/pages/LogsExplorer/index.tsx:119
- Draft comment:
Avoid using thecomponent/index.tsx
file structure approach. It makes it difficult to debug and find components using global search tools. This applies to other similar files as well. - Reason this comment was not posted:
Comment was not on a valid diff hunk.
Workflow ID: wflow_2TxkJUHL0ZClGF2U
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
…MONITORING for consistency
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 4d80c36 in 20 seconds
More details
- Looked at
76
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. frontend/src/container/InfraMonitoringK8s/InfraMonitoringK8s.tsx:117
- Draft comment:
The PR description mentions adding a documentation link to quick filters, but the code changes do not reflect this. The changes only modify thesource
property ofQuickFilters
components. This does not resolve the issue described in the PR. - Reason this comment was not posted:
Comment did not seem useful.
Workflow ID: wflow_7pl7eUAd5HiFYCJ1
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
<EmptyQuickFilterIcon /> | ||
</div> | ||
<div className="go-to-docs__container-message"> | ||
{`You'd need to parse out this attribute to start getting them as a fast |
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.
Maybe remove the back ticks if it's a simple string?
Summary
Related Issues / PR's
close #6846
Screenshots
2025-01-20.13-23-32.mov
Updated recording: #6854 (comment)
Affected Areas and Manually Tested Areas
Important
Adds documentation links for quick filters in logs explorer with new empty state visuals and source differentiation.
QuickFilterEmptyState
component.QuickFilterEmptyState
opens relevant documentation section based onattributeKey
.EmptyQuickFilterIcon
inEmptyQuickFilterIcon.tsx
for empty state visuals.QuickFilterEmptyState
component inQuickFilterEmptyState.tsx
.Checkbox.styles.scss
to include styles for the new documentation link section.QuickFiltersSource
enum inQuickFilters.tsx
to differentiate between sources likeLOGS_EXPLORER
andINFRA_MONITORING
.This description was created by for 4d80c36. It will automatically update as commits are pushed.