Skip to content
This repository was archived by the owner on Jul 30, 2025. It is now read-only.

Commit 453bc86

Browse files
committed
fix: In narrower windows, there is too much content in the StatusStripe
Fixes #6570
1 parent 8477386 commit 453bc86

File tree

8 files changed

+64
-10
lines changed

8 files changed

+64
-10
lines changed

plugins/plugin-client-common/src/components/Client/StatusStripe/MeterWidgets.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,16 @@
1919

2020
import React from 'react'
2121

22-
export default class MeterWidgets extends React.PureComponent {
22+
interface Props {
23+
className?: string
24+
}
25+
26+
export default class MeterWidgets extends React.PureComponent<Props> {
27+
private className() {
28+
return 'kui--status-stripe-meter ' + (this.props.className || '')
29+
}
30+
2331
public render() {
24-
return <div className="kui--status-stripe-meter">{this.props.children}</div>
32+
return <div className={this.className()}>{this.props.children}</div>
2533
}
2634
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright 2020 IBM Corporation
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
import React from 'react'
18+
19+
/**
20+
* This components can be used as a space filler in your StatusStripe.
21+
*
22+
*/
23+
export default function SpaceFiller() {
24+
return <div className="flex-fill" />
25+
}

plugins/plugin-client-common/src/components/Client/StatusStripe/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export default class StatusStripe extends React.PureComponent<Props, State> {
114114
{this.message()}
115115
{this.widgets()}
116116

117-
<MeterWidgets>
117+
<MeterWidgets className="kui--hide-in-narrower-windows">
118118
<Settings />
119119
</MeterWidgets>
120120

plugins/plugin-client-common/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export { default as TabContent } from './components/Client/TabContent'
3434
export { default as TabModel, uuid as allocateTabUUID } from './components/Client/TabModel'
3535
export { default as StatusStripe } from './components/Client/StatusStripe'
3636
export { default as CurrentWorkingDirectory } from './components/Client/StatusStripe/CurrentWorkingDirectory'
37+
export { default as SpaceFiller } from './components/Client/StatusStripe/SpaceFiller'
3738
export { default as MeterWidgets } from './components/Client/StatusStripe/MeterWidgets'
3839
export { default as ContextWidgets } from './components/Client/StatusStripe/ContextWidgets'
3940
export { ViewLevel, default as TextWithIconWidget } from './components/Client/StatusStripe/TextWithIconWidget'

plugins/plugin-client-common/web/scss/components/StatusStripe/StatusStripe.scss

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
@import 'mixins';
1818
@import '../DropDown/mixins';
19+
@import '../common/narrow-window';
1920

2021
$font-size: 0.75rem;
2122

@@ -133,8 +134,8 @@ $element-padding: 1rem;
133134
}
134135

135136
.kui--status-stripe-context {
136-
flex: 1;
137137
font-size: $font-size;
138+
border-right: $element-border;
138139

139140
.kui--status-stripe-element {
140141
padding-left: calc(#{$element-padding} * 0.875 / 0.75);
@@ -144,10 +145,6 @@ $element-padding: 1rem;
144145
.kui--status-stripe-element:not(:first-child) {
145146
border-left: $element-border;
146147
}
147-
.kui--status-stripe-element-wrapper:last-child,
148-
.kui--status-stripe-element:last-child {
149-
border-right: $element-border;
150-
}
151148
.kui--status-stripe-element:not(:first-child):not([data-padding='none']) {
152149
padding-left: $element-padding;
153150
}
@@ -253,4 +250,6 @@ $element-padding: 1rem;
253250
border-radius: 4px 4px 0px 0px;
254251
}
255252
}
253+
254+
@include HideInNarrowWindows;
256255
}

plugins/plugin-client-common/web/scss/components/common/_narrow-window.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,11 @@ $medium-width-upper-bound: 68rem;
5353
@content;
5454
}
5555
}
56+
57+
@mixin HideInNarrowWindows {
58+
@include narrow-window {
59+
.kui--hide-in-narrower-windows {
60+
display: none;
61+
}
62+
}
63+
}

plugins/plugin-client-default/src/index.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,14 @@
1717
import React from 'react'
1818

1919
import { i18n, inBrowser, isPopup } from '@kui-shell/core'
20-
import { Kui, KuiProps, ContextWidgets, MeterWidgets, CurrentWorkingDirectory } from '@kui-shell/plugin-client-common'
20+
import {
21+
Kui,
22+
KuiProps,
23+
ContextWidgets,
24+
MeterWidgets,
25+
CurrentWorkingDirectory,
26+
SpaceFiller
27+
} from '@kui-shell/plugin-client-common'
2128

2229
import { CurrentGitBranch } from '@kui-shell/plugin-git'
2330
import { CurrentContext, CurrentNamespace } from '@kui-shell/plugin-kubectl/components'
@@ -83,7 +90,9 @@ export default function renderMain(props: KuiProps) {
8390
<CurrentGitBranch className="kui--hide-in-narrower-windows" />
8491
</ContextWidgets>
8592

86-
<MeterWidgets>
93+
<SpaceFiller />
94+
95+
<MeterWidgets className="kui--hide-in-narrower-windows">
8796
{/* <ClusterUtilization /> */}
8897
{/* !isPopup() && <OpenWhiskGridWidget /> */}
8998
{inBrowser() && <ProxyOfflineIndicator />}

plugins/plugin-electron-components/src/components/UpdateChecker.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ interface Props {
5252

5353
/** periodically check for updates with this interval (millis) */
5454
interval?: number
55+
56+
/** Additional css classes */
57+
className?: string
5558
}
5659

5760
interface State {
@@ -213,6 +216,7 @@ export default class UpdateChecker extends React.PureComponent<Props, State> {
213216
return (
214217
<Widget
215218
id="kui--plugin-core-support--update-checker"
219+
className={this.props.className}
216220
viewLevel="info"
217221
text={this.text()}
218222
title={strings(

0 commit comments

Comments
 (0)