-
Notifications
You must be signed in to change notification settings - Fork 421
RI-7785 Fix Analysis tabs padding consistency #5255
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
Merged
valkirilov
merged 8 commits into
main
from
fe/bugfix/RI-7785/fix-analysis-pages-padding
Nov 28, 2025
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
67b73f4
feat(ui): create shared AnalysisPageContainer component
valkirilov 27a4d77
refactor(ui): use shared AnalysisPageContainer in Database Analysis page
valkirilov 78941e9
fix(ui): add consistent padding to Overview page using shared container
valkirilov aa10c76
refactor(ui): replace local styles with styled-components in ClusterD…
valkirilov 4cea956
fix(ui): add consistent padding to Slow Log page using shared container
valkirilov 3c3ebf7
fix(ui): integrate AnalyticsPageHeader in ClusterDetails and SlowLog …
valkirilov 5760f3c
refactor(ui): clean up styles in ClusterDetailsPage
valkirilov a7f4efb
Merge branch 'main' into fe/bugfix/RI-7785/fix-analysis-pages-padding
valkirilov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
9 changes: 5 additions & 4 deletions
9
redisinsight/ui/src/pages/cluster-details/ClusterDetailsPage.styles.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,9 @@ | ||
| import { Theme } from '@redis-ui/styles' | ||
| import styled from 'styled-components' | ||
| import { scrollbarStyles } from 'uiSrc/styles/mixins' | ||
|
|
||
| export const ClusterDetailsPageWrapper = styled.div< | ||
| React.HTMLAttributes<HTMLDivElement> | ||
| >` | ||
| export const ClusterDetailsPageWrapper = styled.div` | ||
| ${scrollbarStyles()}; | ||
| height: 100%; | ||
| padding: 0 1.6rem; | ||
| padding: 0 ${({ theme }: { theme: Theme }) => theme.core.space.space200}; | ||
| ` |
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
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
1 change: 0 additions & 1 deletion
1
...insight/ui/src/pages/cluster-details/components/cluster-details-header/styles.module.scss
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,5 @@ | ||
| .container { | ||
| background-color: var(--euiColorEmptyShade); | ||
| max-width: 960px; | ||
| } | ||
|
|
||
| .content { | ||
|
|
||
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
8 changes: 8 additions & 0 deletions
8
...ages/database-analysis/components/analysis-page-container/AnalysisPageContainer.styles.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| import styled from 'styled-components' | ||
| import { Col } from 'uiSrc/components/base/layout/flex' | ||
| import { Theme } from 'uiSrc/components/base/theme/types' | ||
|
|
||
| export const StyledAnalysisPageContainer = styled(Col)` | ||
| overflow: auto; | ||
| padding-inline: ${({ theme }: { theme: Theme }) => theme.core.space.space200}; | ||
| ` | ||
12 changes: 12 additions & 0 deletions
12
.../src/pages/database-analysis/components/analysis-page-container/AnalysisPageContainer.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import React from 'react' | ||
| import { StyledAnalysisPageContainer } from './AnalysisPageContainer.styles' | ||
| import { AnalysisPageContainerProps } from './AnalysisPageContainer.types' | ||
|
|
||
| export const AnalysisPageContainer = ({ | ||
| children, | ||
| ...rest | ||
| }: AnalysisPageContainerProps) => ( | ||
| <StyledAnalysisPageContainer {...rest}> | ||
| {children} | ||
| </StyledAnalysisPageContainer> | ||
| ) |
6 changes: 6 additions & 0 deletions
6
...pages/database-analysis/components/analysis-page-container/AnalysisPageContainer.types.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| import { ComponentPropsWithoutRef } from 'react' | ||
| import { StyledAnalysisPageContainer } from './AnalysisPageContainer.styles' | ||
|
|
||
| export type AnalysisPageContainerProps = ComponentPropsWithoutRef< | ||
| typeof StyledAnalysisPageContainer | ||
| > |
2 changes: 2 additions & 0 deletions
2
redisinsight/ui/src/pages/database-analysis/components/analysis-page-container/index.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| export { AnalysisPageContainer } from './AnalysisPageContainer' | ||
| export type { AnalysisPageContainerProps } from './AnalysisPageContainer.types' |
23 changes: 23 additions & 0 deletions
23
...rc/pages/database-analysis/components/analytics-page-header/AnalyticsPageHeader.styles.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| import styled from 'styled-components' | ||
| import { Row } from 'uiSrc/components/base/layout/flex' | ||
| import { Theme } from 'uiSrc/components/base/theme/types' | ||
|
|
||
| const getBorderColor = (theme: Theme) => | ||
| theme.name === 'dark' ? theme.color.dark600 : theme.color.dusk150 | ||
|
|
||
| export const HeaderContainer = styled.div` | ||
| width: 100%; | ||
| border-bottom: 4px solid | ||
| ${({ theme }: { theme: Theme }) => getBorderColor(theme)}; /* Mimic the tabs border width and color */ | ||
| ` | ||
|
|
||
| export const HeaderContent = styled(Row).attrs({ | ||
| align: 'center', | ||
| justify: 'between', | ||
| })` | ||
| min-height: 36px; | ||
| ` | ||
|
|
||
| export const TabsWrapper = styled.div` | ||
| margin-bottom: -14px; /* Move it so it overlaps with the border of the tabs container */ | ||
| ` | ||
26 changes: 26 additions & 0 deletions
26
...t/ui/src/pages/database-analysis/components/analytics-page-header/AnalyticsPageHeader.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| import React from 'react' | ||
| import { FlexItem } from 'uiSrc/components/base/layout/flex' | ||
| import AnalyticsTabs from 'uiSrc/components/analytics-tabs' | ||
| import { AnalyticsPageHeaderProps } from './AnalyticsPageHeader.types' | ||
| import { | ||
| HeaderContainer, | ||
| HeaderContent, | ||
| TabsWrapper, | ||
| } from './AnalyticsPageHeader.styles' | ||
|
|
||
| export const AnalyticsPageHeader = ({ | ||
| actions, | ||
| children, | ||
| }: AnalyticsPageHeaderProps) => ( | ||
| <HeaderContainer> | ||
| <HeaderContent> | ||
| <FlexItem> | ||
| <TabsWrapper> | ||
| <AnalyticsTabs /> | ||
| </TabsWrapper> | ||
| </FlexItem> | ||
| {actions && <FlexItem>{actions}</FlexItem>} | ||
| </HeaderContent> | ||
| {children} | ||
| </HeaderContainer> | ||
| ) |
6 changes: 6 additions & 0 deletions
6
...src/pages/database-analysis/components/analytics-page-header/AnalyticsPageHeader.types.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| import { ReactNode } from 'react' | ||
|
|
||
| export interface AnalyticsPageHeaderProps { | ||
| actions?: ReactNode | ||
| children?: ReactNode | ||
| } |
2 changes: 2 additions & 0 deletions
2
redisinsight/ui/src/pages/database-analysis/components/analytics-page-header/index.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| export { AnalyticsPageHeader } from './AnalyticsPageHeader' | ||
| export type { AnalyticsPageHeaderProps } from './AnalyticsPageHeader.types' |
10 changes: 9 additions & 1 deletion
10
...ht/ui/src/pages/database-analysis/components/data-nav-tabs/DatabaseAnalysisTabs.styles.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,13 @@ | ||
| import styled from 'styled-components' | ||
| import { Theme } from 'uiSrc/components/base/theme/types' | ||
| import Tabs from 'uiSrc/components/base/layout/tabs' | ||
|
|
||
| export const EmptyMessageContainer = styled.div<React.HTMLAttributes<HTMLDivElement>>` | ||
| export const EmptyMessageContainer = styled.div< | ||
| React.HTMLAttributes<HTMLDivElement> | ||
| >` | ||
| height: calc(100% - 96px); | ||
| ` | ||
|
|
||
| export const StyledTabs = styled(Tabs)` | ||
| padding-top: ${({ theme }: { theme: Theme }) => theme.core.space.space200}; | ||
| ` |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Bug: Missing height constraint on AnalysisPageContainer
The
StyledAnalysisPageContaineris missingheight: 100%which was present in the old styles for all three pages. Without a defined height, the container won't properly constrain its children, causing theoverflow: autoto not work correctly and preventing the pages from filling the available vertical space. TheColcomponent'sflex-grow: 1alone isn't sufficient without a parent height constraint.