@@ -36,8 +37,7 @@ export function GHESReleaseNotePatch({
{patch.release_candidate && (
Release Candidate
diff --git a/src/release-notes/components/PatchNotes.module.scss b/src/release-notes/components/PatchNotes.module.scss
index 753442dfef..eb32ff8c75 100644
--- a/src/release-notes/components/PatchNotes.module.scss
+++ b/src/release-notes/components/PatchNotes.module.scss
@@ -14,3 +14,12 @@
top: 65px;
}
}
+
+.patchHeader {
+ z-index: 1;
+ margin-top: -1px;
+}
+
+.releaseLabel {
+ white-space: pre;
+}
diff --git a/src/rest/components/RestCodeSamples.module.scss b/src/rest/components/RestCodeSamples.module.scss
index 7c52e77194..fd0bf5215c 100644
--- a/src/rest/components/RestCodeSamples.module.scss
+++ b/src/rest/components/RestCodeSamples.module.scss
@@ -30,6 +30,7 @@
.responseCodeBlock {
min-height: 120px;
+ max-height: 60vh;
}
.segmentedControl {
diff --git a/src/rest/components/RestCodeSamples.tsx b/src/rest/components/RestCodeSamples.tsx
index 7488919d28..b03338fbbd 100644
--- a/src/rest/components/RestCodeSamples.tsx
+++ b/src/rest/components/RestCodeSamples.tsx
@@ -100,7 +100,6 @@ export function RestCodeSamples({ operation, slug, heading }: Props) {
const [selectedLanguage, setSelectedLanguage] = useState(languageSelectOptions[0])
const [selectedExample, setSelectedExample] = useState(exampleSelectOptions[0])
const [selectedResponse, setSelectedResponse] = useState(responseSelectOptions[0])
- const [responseMaxHeight, setResponseMaxHeight] = useState(0)
const isSingleExample = languageExamples.length === 1
const displayedExample: ExampleT = languageExamples[selectedExample.languageIndex]
@@ -118,19 +117,6 @@ export function RestCodeSamples({ operation, slug, heading }: Props) {
Cookies.set('codeSampleLanguagePreferred', languageKey)
}
- const handleResponseResize = () => {
- if (requestCodeExample.current) {
- const requestCodeHeight = requestCodeExample.current.clientHeight || 0
- const { innerHeight: height } = window
- if (responseCodeExample) {
- // 520 pixels roughly accounts for the space taken up by the
- // nav bar, headers, language picker, method section, and response
- // picker
- setResponseMaxHeight(height - requestCodeHeight - 520)
- }
- }
- }
-
// Change the language based on cookies
useEffect(() => {
// If the user previously selected a language preference and the language
@@ -152,7 +138,6 @@ export function RestCodeSamples({ operation, slug, heading }: Props) {
// (ClientSideHighlightJS) will have already handled highlighting
if (reqElem && !firstRender.current) {
highlightElement(reqElem)
- handleResponseResize()
}
}, [selectedLanguage])
@@ -196,15 +181,6 @@ export function RestCodeSamples({ operation, slug, heading }: Props) {
}
}, [])
- // Handle the resizing of the response section when the window is resized
- useEffect(() => {
- handleResponseResize()
- window.addEventListener('resize', handleResponseResize)
- return () => {
- window.removeEventListener('resize', handleResponseResize)
- }
- })
-
const [isCopied, setCopied] = useClipboard(displayedExample[selectedLanguage] as string, {
successDuration: 1400,
})
@@ -360,7 +336,6 @@ export function RestCodeSamples({ operation, slug, heading }: Props) {
'border-top rounded-1 my-0',
)}
data-highlight={'json'}
- style={{ maxHeight: responseMaxHeight }}
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
tabIndex={0}
>
diff --git a/src/rest/components/RestOperation.module.scss b/src/rest/components/RestOperation.module.scss
index 6e15d731e0..6aeee94898 100644
--- a/src/rest/components/RestOperation.module.scss
+++ b/src/rest/components/RestOperation.module.scss
@@ -5,3 +5,7 @@
.codeBlock code:not(td *) {
word-break: break-word;
}
+
+.stickyCodeColumn {
+ top: 6.5em;
+}
diff --git a/src/rest/components/RestOperation.tsx b/src/rest/components/RestOperation.tsx
index 409fb55ee3..cae9e76497 100644
--- a/src/rest/components/RestOperation.tsx
+++ b/src/rest/components/RestOperation.tsx
@@ -102,8 +102,10 @@ export function RestOperation({ operation }: Props) {
)}
{hasCodeSamples && (
{renderItem ? renderItem(item) : item.text}
diff --git a/src/tools/components/Picker.module.scss b/src/tools/components/Picker.module.scss
new file mode 100644
index 0000000000..71aca9ada9
--- /dev/null
+++ b/src/tools/components/Picker.module.scss
@@ -0,0 +1,12 @@
+.menuButton {
+ height: auto;
+ text-align: left;
+
+ span:first-child {
+ display: inline;
+ }
+}
+
+.pickerLabel {
+ white-space: pre-wrap;
+}
diff --git a/src/tools/components/Picker.tsx b/src/tools/components/Picker.tsx
index c92bfd750a..679e91b954 100644
--- a/src/tools/components/Picker.tsx
+++ b/src/tools/components/Picker.tsx
@@ -4,6 +4,7 @@ import { ActionMenu } from '@primer/react'
import { AnchorAlignment } from '@primer/behaviors'
import { Fields } from './Fields'
+import styles from './Picker.module.scss'
interface Props {
items: PickerItem[]
@@ -47,14 +48,9 @@ export const Picker = ({
- {pickerLabel && {`${pickerLabel}`}}
+ {pickerLabel && {`${pickerLabel}`}}
{t('action_type_switch_error')}
-
- {error.toString()}
-
+ {error.toString()}
)}
diff --git a/src/webhooks/components/WebhookPayloadExample.module.scss b/src/webhooks/components/WebhookPayloadExample.module.scss
index cbadfb1781..7260ae4ec0 100644
--- a/src/webhooks/components/WebhookPayloadExample.module.scss
+++ b/src/webhooks/components/WebhookPayloadExample.module.scss
@@ -12,3 +12,7 @@
padding: 8px 8px 16px;
}
}
+
+.errorCode {
+ background: none;
+}