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

Commit 6c06b2d

Browse files
committed
fix(plugins/plugin-client-common): opening a guidebook from sidebar shows internal command execution
i don't think the users will ever care about the `replay /odd/path.md` being echo'd anywhere
1 parent 3e76327 commit 6c06b2d

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

plugins/plugin-client-common/src/components/Client/Sidebar.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import React from 'react'
1818
import { encodeComponent, i18n, pexecInCurrentTab } from '@kui-shell/core'
1919
import { PageSidebar } from '@patternfly/react-core'
2020

21+
import CommonProps from './props/Common'
2122
import BrandingProps from './props/Branding'
2223
import GuidebookProps, { isGuidebook, isMenu, MenuItem } from './props/Guidebooks'
2324

@@ -30,7 +31,8 @@ const NavExpandable = React.lazy(() => import('@patternfly/react-core').then(_ =
3031

3132
const strings = i18n('plugin-client-common')
3233

33-
type Props = BrandingProps &
34+
type Props = Pick<CommonProps, 'noTopTabs'> &
35+
BrandingProps &
3436
GuidebookProps & {
3537
/** unfurled? */
3638
isOpen: boolean
@@ -92,7 +94,12 @@ export default class Sidebar extends React.PureComponent<Props, State> {
9294
className="kui--sidebar-nav-item"
9395
isActive={this.props.indicateActiveItem && (_.notebook === this.currentGuidebook || thisIsTheFirstNavItem)}
9496
onClick={() => {
95-
pexecInCurrentTab(`${this.props.guidebooksCommand || 'replay'} ${encodeComponent(_.filepath)}`)
97+
const quiet = !this.props.noTopTabs
98+
pexecInCurrentTab(
99+
`${this.props.guidebooksCommand || 'replay'} ${encodeComponent(_.filepath)}`,
100+
undefined,
101+
quiet
102+
)
96103
this.setState({ currentGuidebook: _.notebook })
97104
}}
98105
>

plugins/plugin-client-common/src/components/Client/TabContainer.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ export default class TabContainer extends React.PureComponent<Props, State> {
351351
version={this.props.version}
352352
isOpen={this.state.isSidebarOpen}
353353
toggleOpen={this.toggleSidebar}
354+
noTopTabs={this.props.noTopTabs}
354355
guidebooks={this.props.guidebooks}
355356
productName={this.props.productName}
356357
indicateActiveItem={!!this.props.noTopTabs}

0 commit comments

Comments
 (0)