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

Commit 51a2aad

Browse files
committed
fix: Switching Carbon tabs can cause content to scroll off-viewport
Fixes #6014
1 parent 1ad0af8 commit 51a2aad

File tree

13 files changed

+123
-138
lines changed

13 files changed

+123
-138
lines changed

package-lock.json

Lines changed: 83 additions & 85 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"pty:nodejs": "npm run pty:rebuild node",
4747
"link": "bash -c \"if [ $OSTYPE != msys ]; then CLIENT=${CLIENT-default}; CLIENT_HOME=$(cd ./node_modules/@kui-shell/client && pwd) ./packages/builder/bin/seticon.js; fi\"",
4848
"update": "ncu -u -x \"@types/yargs-parser,husky,electron,spectron,@types/webdriverio\" && for i in plugins/*; do (cd $i && ncu -u -x electron,spectron,@types/webdriverio,chokidar,d3,elkjs,xtermjs,strip-ansi && rm -rf node_modules); done && rm -rf node_modules/ package-lock.json && npm install",
49-
"postinstall": "npm rebuild node-sass && npm run compile && npx kui-hack-carbon",
49+
"postinstall": "npm rebuild node-sass && npm run compile",
5050
"open": "electron . shell",
5151
"start": "WATCH_ARGS='open' npm run watch"
5252
},

packages/builder/bin/hackCarbon.sh

Lines changed: 0 additions & 19 deletions
This file was deleted.

packages/builder/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
"url": "git+https://github.com/IBM/kui.git"
1313
},
1414
"bin": {
15-
"kui-hack-carbon": "./bin/hackCarbon.sh",
1615
"kui-pty-rebuild": "./bin/pty-rebuild.sh",
1716
"kui-build-headless": "./dist/headless/build.sh",
1817
"kui-build-electron": "./dist/electron/build.sh",

packages/react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"url": "git+https://github.com/IBM/kui.git"
1616
},
1717
"dependencies": {
18-
"@types/carbon__icons-react": "10.17.1",
18+
"@types/carbon__icons-react": "10.20.0",
1919
"react": "16.13.1",
2020
"react-dom": "16.13.1"
2121
},

packages/test/src/api/selectors.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export const TERMINAL_SIDECAR_WATCHER_BUTTON = `${TOP_TAB_BUTTONS} [data-mode="s
6363

6464
// sidecar toolbar
6565
export const SIDECAR_TOOLBAR = (N: number) =>
66-
`${SIDECAR(N)} .bx--tab-content[aria-hidden="false"] .sidecar-bottom-stripe-toolbar`
66+
`${SIDECAR(N)} .bx--tab-content:not([hidden]) .sidecar-bottom-stripe-toolbar`
6767
export const SIDECAR_TOOLBAR_TEXT = (N: number, type: string) =>
6868
`${SIDECAR_TOOLBAR(N)} .sidecar-toolbar-text[data-type="${type}"] .sidecar-toolbar-text-content`
6969
export const SIDECAR_TOOLBAR_BUTTON = (N: number, mode: string) =>
@@ -73,20 +73,20 @@ export const SIDECAR_TOOLBAR_BUTTON = (N: number, mode: string) =>
7373

7474
// sidecar alert
7575
export const SIDECAR_ALERT = (N: number, type: string) =>
76-
`${SIDECAR(N)} .bx--tab-content[aria-hidden="false"] .kui--toolbar-alert[data-type="${type}"]`
76+
`${SIDECAR(N)} .bx--tab-content:not([hidden]) .kui--toolbar-alert[data-type="${type}"]`
7777

7878
// terminal alert
7979
export const TERMINAL_ALERT = (type: string) => `.kui--terminal-alert[data-type="${type}"]`
8080

8181
// sidecar tab content, for visible tab
82-
export const SIDECAR_TAB_CONTENT = (N: number) => `${SIDECAR(N)} .bx--tab-content[aria-hidden="false"] .custom-content`
82+
export const SIDECAR_TAB_CONTENT = (N: number) => `${SIDECAR(N)} .bx--tab-content:not([hidden]) .custom-content`
8383
export const SIDECAR_CUSTOM_CONTENT = (N: number) => `${SIDECAR_TAB_CONTENT(N)} .code-highlighting`
8484

8585
// top nav sidecar
8686
export const SIDECAR_MODE_BUTTONS = (N: number) =>
8787
`${SIDECAR(N)} .sidecar-bottom-stripe-mode-bits .sidecar-bottom-stripe-button` // all mode buttons in the bottom stripe
8888
export const _SIDECAR_MODE_BUTTON = (N: number, mode: string) => `${SIDECAR_MODE_BUTTONS(N)}[data-mode="${mode}"]` // specific mode button in the bottom stripe
89-
export const SIDECAR_MODE_BUTTON = (N: number, mode: string) => `${_SIDECAR_MODE_BUTTON(N, mode)} > a` // clickable part of mode button
89+
export const SIDECAR_MODE_BUTTON = (N: number, mode: string) => `${_SIDECAR_MODE_BUTTON(N, mode)} > button` // clickable part of mode button
9090
export const SIDECAR_MODE_BUTTON_SELECTED = (N: number, mode: string) =>
9191
`${_SIDECAR_MODE_BUTTON(N, mode)}.bx--tabs--scrollable__nav-item--selected`
9292

@@ -288,7 +288,7 @@ export const COMMENTARY_EDITOR_BUTTON_REVERT =
288288
export const COMMENTARY_EDITOR = '.kui--commentary .kui--source-ref-editor'
289289

290290
export const SIDECAR_LAST = `${OUTPUT_LAST} .kui--sidecar.visible:not(.minimized)`
291-
export const SIDECAR_TOOLBAR_LAST = `${SIDECAR_LAST} .bx--tab-content[aria-hidden="false"] .sidecar-bottom-stripe-toolbar`
291+
export const SIDECAR_TOOLBAR_LAST = `${SIDECAR_LAST} .bx--tab-content:not([hidden]) .sidecar-bottom-stripe-toolbar`
292292
export const SIDECAR_TOOLBAR_TEXT_LAST = (type: string) =>
293293
`${SIDECAR_TOOLBAR_LAST} .sidecar-toolbar-text[data-type="${type}"] .sidecar-toolbar-text-content`
294294
export const SIDECAR_TOOLBAR_BUTTON_LAST = (mode: string) =>

packages/test/src/api/util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ export const expectArray = (expected: Array<string>, failFast = true, subset = f
173173
/** get the monaco editor text */
174174
export const getValueFromMonaco = async (
175175
res: AppAndCount,
176-
container = `${Selectors.PROMPT_BLOCK_N(res.count)} .bx--tab-content[aria-hidden="false"]`
176+
container = `${Selectors.PROMPT_BLOCK_N(res.count)} .bx--tab-content:not([hidden])`
177177
) => {
178178
const selector = `${container} .monaco-editor-wrapper`
179179
try {

plugins/plugin-client-common/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@
2020
"module": "mdist/index.js",
2121
"types": "mdist/index.d.ts",
2222
"dependencies": {
23-
"@carbon/icons-react": "10.19.0",
23+
"@carbon/icons-react": "10.20.0",
2424
"@patternfly/react-core": "4.50.2",
25-
"carbon-components": "10.22.0",
26-
"carbon-components-react": "7.22.0",
25+
"carbon-components": "10.23.2",
26+
"carbon-components-react": "7.23.2",
2727
"carbon-icons": "7.0.7",
28-
"cli-spinners": "^2.4.0",
28+
"cli-spinners": "2.5.0",
2929
"monaco-editor": "0.21.2",
3030
"monaco-editor-webpack-plugin": "2.0.0",
31-
"react-markdown": "5.0.1",
31+
"react-markdown": "5.0.2",
3232
"tmp": "0.2.1"
3333
},
3434
"kui": {

plugins/plugin-client-common/src/components/Views/Sidecar/ToolbarButton.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ export default class ToolbarButton<T extends ResourceWithMetadata = ResourceWith
8181
}
8282
data-mode={button.mode}
8383
>
84-
<a role="presentation" href="#" onClick={this._buttonOnclick}>
84+
<button role="presentation" onClick={this._buttonOnclick}>
8585
<span role="tab" title={button.label || button.mode}>
8686
{button.icon ? button.icon : button.label || button.mode}
8787
</span>
88-
</a>
88+
</button>
8989
</span>
9090
)
9191
}

plugins/plugin-client-common/src/components/Views/Sidecar/TopNavSidecarV2.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ export default class TopNavSidecar extends BaseSidecar<MultiModalResponse, Histo
194194
>
195195
{this.current.tabs.map((mode: MultiModalMode, idx: number) => (
196196
<Tab
197-
href="#"
198197
key={mode.mode}
199198
id={mode.mode}
200199
className="sidecar-bottom-stripe-button"

0 commit comments

Comments
 (0)