Skip to content

Commit 1d3666f

Browse files
authored
fix: code snippets UI enhancements (#3798)
1 parent e2faa7d commit 1d3666f

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

src/app/views/common/monaco/Monaco.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ const Monaco = ({ body, onChange, language, readOnly, height, extraInfoElement,
7272
{extraInfoElement}
7373
<Editor
7474
language={language || 'json'}
75-
width=' 100%'
76-
height=' 100%'
75+
width='100%'
76+
height='100%'
7777
value={formattedBody}
7878
options={editorOptions}
7979
onChange={onChange}

src/app/views/query-response/pivot-items/pivot-item.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ const useStyles = makeStyles({
6363
backgroundColor: tokens.colorNeutralBackground1,
6464
height: '100%',
6565
minHeight: '600px',
66-
overflow: 'auto'
66+
overflow: 'hidden'
6767
}
6868
});
6969

src/app/views/query-response/snippets/Snippets.tsx

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,10 @@ const supportedLanguages: LanguageSnippet = {
6565
const useSnippetStyles = makeStyles({
6666
container: {
6767
margin: '0 auto',
68+
paddingTop: '5px',
69+
paddingLeft: '5px',
6870
maxHeight: '100vh',
69-
overflowY: 'auto',
71+
overflowY: 'hidden',
7072
display: 'flex',
7173
flexDirection: 'column'
7274
},
@@ -78,16 +80,15 @@ const useSnippetStyles = makeStyles({
7880
display: 'flex',
7981
flexDirection: 'column',
8082
flex: '1 1 auto',
81-
height: '30vh',
82-
overflowY: 'auto'
83+
height: '60vh'
8384
},
8485
copyButton: {
8586
marginLeft: 'auto'
8687
},
8788
snippetContent: {
8889
display: 'flex',
8990
flexDirection: 'column',
90-
overflowY: 'auto',
91+
overflowY: 'hidden',
9192
maxHeight: 'calc(100vh-120px)'
9293
}
9394
});
@@ -201,11 +202,14 @@ const RenderSnippets = () => {
201202
return (
202203
<div id='snippets-tablist' className={styles.container}>
203204
<TabList selectedValue={selectedLanguage} onTabSelect={onTabSelect}>
204-
{Object.keys(supportedLanguages).map((language: string) => (
205-
<Tab key={language} value={language}>
206-
{language === 'CSharp' ? 'C#' : language}
207-
</Tab>
208-
))}
205+
<Tab key='CSharp' value='CSharp'>C#</Tab>
206+
{/*The rest should be sorted in alphabetical order to match docs */}
207+
{Object.keys(supportedLanguages)
208+
.filter(lang => lang !== 'CSharp')
209+
.sort((a, b) => a.localeCompare(b))
210+
.map(language => (
211+
<Tab key={language} value={language}>{language}</Tab>
212+
))}
209213
</TabList>
210214
<div id='snippet-content'>
211215
<SnippetContent language={selectedLanguage as string} />

0 commit comments

Comments
 (0)