Skip to content

Commit

Permalink
fix(playground): remove cascade of padding on prompts (#5556)
Browse files Browse the repository at this point in the history
* restore scrollbar on prompts section

* cleanup

* remove cascade

* fix(playground): remove cascade of padding

* cleanup
  • Loading branch information
mikeldking authored Nov 26, 2024
1 parent b121fe2 commit 0eb1277
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 21 deletions.
26 changes: 11 additions & 15 deletions app/src/pages/playground/Playground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,23 +191,20 @@ const playgroundPromptPanelContentCSS = css`
height: 100%;
overflow: hidden;
flex: 1 1 auto;
& > .ac-view {
// add scrollbar gutter to the right of the accordion item
scrollbar-gutter: stable;
// if scrollbar-gutter is not supported, add padding to the right of the accordion item
@supports not (scrollbar-gutter: stable) {
padding-right: 16px;
}
height: 100%;
flex: 1 1 auto;
overflow: auto;
box-sizing: border-box;
}
}
}
}
`;

const promptsWrapCSS = css`
padding: var(--ac-global-dimension-size-200);
scrollbar-gutter: stable;
height: 100%;
flex: 1 1 auto;
overflow: auto;
box-sizing: border-box;
`;

const playgroundInputOutputPanelContentCSS = css`
height: 100%;
overflow: auto;
Expand Down Expand Up @@ -277,8 +274,7 @@ function PlaygroundContent() {
</Flex>
}
>
{/* No padding on the right of the accordion item, it is handled by the stable scrollbar gutter */}
<View height="100%" paddingY="size-200" paddingStart="size-200">
<div css={promptsWrapCSS}>
<Flex direction="row" gap="size-200" maxWidth="100%">
{instances.map((instance) => (
<View
Expand All @@ -293,7 +289,7 @@ function PlaygroundContent() {
</View>
))}
</Flex>
</View>
</div>
</AccordionItem>
</Accordion>
</div>
Expand Down
7 changes: 1 addition & 6 deletions app/src/pages/playground/PlaygroundResponseFormat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
Flex,
Icon,
Icons,
Text,
View,
} from "@arizeai/components";

Expand Down Expand Up @@ -92,11 +91,7 @@ export function PlaygroundResponseFormat({
<View padding="size-200">
<Card
variant="compact"
title={
<Flex direction="row" gap="size-100">
<Text>Schema</Text>
</Flex>
}
title="Schema"
bodyStyle={{ padding: 0 }}
extra={
<Flex direction="row" gap="size-100">
Expand Down

0 comments on commit 0eb1277

Please sign in to comment.