Skip to content

Commit 76babb0

Browse files
committed
fix: improve scrolling ui in detail (sidecar) view
Previously, the whole detail panel would scroll, including header and tabs. With this, only the tab content scrolls. Signed-off-by: Nick Mitchell <[email protected]>
1 parent fe30c65 commit 76babb0

File tree

5 files changed

+29
-4
lines changed

5 files changed

+29
-4
lines changed

pdl-live-react/src/view/code/PreviewLight.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ type Props = {
1919
wrap?: boolean
2020
}
2121

22-
export default function PreviewLight({ language, value, wrap = true }: Props) {
22+
export default function PreviewLight({
23+
language,
24+
value,
25+
showLineNumbers = false,
26+
wrap = true,
27+
}: Props) {
2328
useEffect(() => {
2429
SyntaxHighlighter.registerLanguage("json", json)
2530
SyntaxHighlighter.registerLanguage("yaml", yaml)
@@ -33,6 +38,7 @@ export default function PreviewLight({ language, value, wrap = true }: Props) {
3338
style={style}
3439
language={language}
3540
wrapLongLines={wrap}
41+
showLineNumbers={showLineNumbers}
3642
>
3743
{value}
3844
</SyntaxHighlighter>

pdl-live-react/src/view/detail/DrawerContent.css

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,23 @@
66
margin-left: 1em;
77
}
88
}
9+
10+
.pf-v6-c-card__body {
11+
display: flex;
12+
flex-direction: column;
13+
overflow: hidden;
14+
}
15+
16+
.pf-v6-c-tab-content {
17+
flex: 1;
18+
overflow: auto;
19+
20+
& > pre {
21+
overflow-x: unset !important;
22+
23+
& > code {
24+
white-space: pre-wrap !important;
25+
}
26+
}
27+
}
928
}

pdl-live-react/src/view/detail/DrawerContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export default function DrawerContent({ value }: Props) {
9999
}
100100

101101
return (
102-
<Card isPlain isLarge isFullHeight className="pdl-drawer-content">
102+
<Card isPlain isLarge className="pdl-drawer-content">
103103
<CardHeader actions={actions}>
104104
<CardTitle>{header(objectType)}</CardTitle>
105105
{block && description(block)}

pdl-live-react/src/view/detail/RawTraceTabContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ import Code from "../code/Code"
22
import { type NonScalarPdlBlock as Model } from "../../helpers"
33

44
export default function RawTraceTabContent({ block }: { block: Model }) {
5-
return <Code block={block} showLineNumbers raw wrap={false} />
5+
return <Code block={block} raw />
66
}

pdl-live-react/src/view/detail/SourceTabContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ import Code from "../code/Code"
22
import { type NonScalarPdlBlock as Model } from "../../helpers"
33

44
export default function SourceTabContent({ block }: { block: Model }) {
5-
return <Code block={block} showLineNumbers wrap={false} />
5+
return <Code block={block} />
66
}

0 commit comments

Comments
 (0)