Skip to content

Commit f39893f

Browse files
fix(code/frontend): structure tab highlight, align and collapse (#35221)
1 parent e92fc1c commit f39893f

File tree

3 files changed

+33
-25
lines changed

3 files changed

+33
-25
lines changed

x-pack/plugins/code/public/components/symbol_tree/__test__/__snapshots__/symbol_tree.test.tsx.snap

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

x-pack/plugins/code/public/components/symbol_tree/code_symbol_tree.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ const Symbol = styled.div<{ isContainer: boolean }>`
3333
align-items: center;
3434
height: 1.5rem;
3535
margin-left: ${props => (props.isContainer ? '0.75rem' : '2rem')};
36+
z-index: 2;
3637
`;
3738

3839
const Token = styled(EuiToken)`
@@ -106,7 +107,7 @@ export class CodeSymbolTree extends React.PureComponent<Props, { activePath?: st
106107
pathname: RepositoryUtils.locationToUrl(location),
107108
query: { tab: 'structure' },
108109
})}
109-
className="code-link"
110+
className="code-symbol-link"
110111
onClick={this.getClickHandler(path)}
111112
>
112113
<EuiFlexGroup gutterSize="none" alignItems="center" className="code-structure-node">
@@ -131,8 +132,10 @@ export class CodeSymbolTree extends React.PureComponent<Props, { activePath?: st
131132
onClick: () => void 0,
132133
};
133134
if (s.members) {
134-
item.items = this.symbolsToSideNavItems(s.members);
135135
item.forceOpen = !this.props.closedPaths.includes(s.path!);
136+
if (item.forceOpen) {
137+
item.items = this.symbolsToSideNavItems(s.members);
138+
}
136139
item.renderItem = this.getStructureTreeItemRenderer(
137140
s.location,
138141
s.name,

x-pack/plugins/code/public/components/symbol_tree/symbol_tree.scss

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
background: $euiColorLightShade;
99
left: 0;
1010
height: 1.5rem;
11-
z-index: -1;
1211
}
1312

1413
.euiSideNavItem__items {
@@ -18,3 +17,9 @@
1817
.codeStructureTree--icon {
1918
margin: auto 0.25rem;
2019
}
20+
21+
.code-symbol-link {
22+
&:focus {
23+
animation: none !important;
24+
}
25+
}

0 commit comments

Comments
 (0)