Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions src/containers/Cluster/Cluster.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,27 @@

width: 100%;
height: 100%;
padding: 0 var(--cluster-side-padding);

&__sticky-wrapper {
padding: 0 var(--cluster-side-padding);
}

&__dashboard {
position: sticky;
left: 0;

padding: 0 var(--cluster-side-padding);
}

&__content {
padding: 0 var(--cluster-side-padding);
}

&__header {
position: sticky;
left: 0;

padding: 20px 0;
padding: var(--g-spacing-5) var(--cluster-side-padding);
}

&__title {
Expand All @@ -32,11 +46,7 @@
z-index: 3;

margin-top: 20px;
margin-right: calc(var(--cluster-side-padding) * -2);
padding-right: calc(var(--cluster-side-padding) * 2);
padding-left: var(--cluster-side-padding);

transform: translateX(calc(var(--cluster-side-padding) * -1));
padding: 0 var(--cluster-side-padding);
@include mixins.sticky-top();
}
&__tabs {
Expand Down
104 changes: 57 additions & 47 deletions src/containers/Cluster/Cluster.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,15 @@ export function Cluster({
<AutoRefreshControl className={b('auto-refresh-control')} />
</div>
{isClusterDashboardAvailable && (
<ClusterOverview
cluster={cluster ?? {}}
groupStats={groupsStats}
loading={infoLoading}
error={clusterError || cluster?.error}
additionalClusterProps={additionalClusterProps}
/>
<div className={b('dashboard')}>
<ClusterOverview
cluster={cluster ?? {}}
groupStats={groupsStats}
loading={infoLoading}
error={clusterError || cluster?.error}
additionalClusterProps={additionalClusterProps}
/>
</div>
)}
<div className={b('tabs-sticky-wrapper')}>
<Tabs
Expand All @@ -153,46 +155,54 @@ export function Cluster({
}}
/>
</div>
<Switch>
<Route
path={
getLocationObjectFromHref(getClusterPath(clusterTabsIds.tablets)).pathname
}
>
<TabletsTable loading={infoLoading} tablets={clusterTablets} />
</Route>
<Route
path={
getLocationObjectFromHref(getClusterPath(clusterTabsIds.tenants)).pathname
}
>
<Tenants additionalTenantsProps={additionalTenantsProps} />
</Route>
<Route
path={getLocationObjectFromHref(getClusterPath(clusterTabsIds.nodes)).pathname}
>
<Nodes parentRef={container} additionalNodesProps={additionalNodesProps} />
</Route>
<Route
path={
getLocationObjectFromHref(getClusterPath(clusterTabsIds.storage)).pathname
}
>
<PaginatedStorage parentRef={container} />
</Route>
<Route
path={
getLocationObjectFromHref(getClusterPath(clusterTabsIds.versions)).pathname
}
>
<VersionsContainer cluster={cluster} loading={infoLoading} />
</Route>
<Route
render={() => (
<Redirect to={getLocationObjectFromHref(getClusterPath(activeTabId))} />
)}
/>
</Switch>
<div className={b('content')}>
<Switch>
<Route
path={
getLocationObjectFromHref(getClusterPath(clusterTabsIds.tablets))
.pathname
}
>
<TabletsTable loading={infoLoading} tablets={clusterTablets} />
</Route>
<Route
path={
getLocationObjectFromHref(getClusterPath(clusterTabsIds.tenants))
.pathname
}
>
<Tenants additionalTenantsProps={additionalTenantsProps} />
</Route>
<Route
path={
getLocationObjectFromHref(getClusterPath(clusterTabsIds.nodes)).pathname
}
>
<Nodes parentRef={container} additionalNodesProps={additionalNodesProps} />
</Route>
<Route
path={
getLocationObjectFromHref(getClusterPath(clusterTabsIds.storage))
.pathname
}
>
<PaginatedStorage parentRef={container} />
</Route>
<Route
path={
getLocationObjectFromHref(getClusterPath(clusterTabsIds.versions))
.pathname
}
>
<VersionsContainer cluster={cluster} loading={infoLoading} />
</Route>
<Route
render={() => (
<Redirect to={getLocationObjectFromHref(getClusterPath(activeTabId))} />
)}
/>
</Switch>
</div>
</div>
);
}
Expand Down
2 changes: 0 additions & 2 deletions src/containers/Cluster/ClusterOverview/ClusterOverview.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
&__overview-wrapper {
--g-button-background-color-hover: var(--g-color-base-background);
--g-button-padding: 0;
position: sticky;
left: 0;

padding: var(--g-spacing-4);

Expand Down
4 changes: 3 additions & 1 deletion src/containers/Nodes/Nodes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
}

&__groups-wrapper {
padding-right: 20px;
--nodes-side-padding: var(--g-spacing-5);
width: calc(100% + var(--nodes-side-padding));
padding-right: var(--nodes-side-padding);
Copy link
Member

@artemmufazalov artemmufazalov May 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't you just remove padding here?

Such approach (100%+ width, hidden paddings, negative margins, transforms) is cursed, it causes unexpected behavior and bugs long-term - you fix cluster controls and autorefresh layout bugs every 2-3 weeks

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really, thats time to get rid of this evil.
So, I've done it. Stand redeployed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You didn't delete groups wrapper classes

}
}
4 changes: 3 additions & 1 deletion src/containers/Storage/Storage.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
}

&__groups-wrapper {
padding-right: 20px;
--nodes-side-padding: var(--g-spacing-5);
width: calc(100% + var(--nodes-side-padding));
padding-right: var(--nodes-side-padding);
}
}
Loading