Skip to content

Commit

Permalink
fix(styles): make prompt section scrollable to the bottom (#5173)
Browse files Browse the repository at this point in the history
* fix(styles): make prompt section scrollable to the bottom

* fix: add gap 200 between tool calls

* update css
  • Loading branch information
Parker-Stafford authored Oct 24, 2024
1 parent 2eae8c5 commit 99a3d1c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 15 deletions.
17 changes: 13 additions & 4 deletions app/src/pages/playground/Playground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,18 @@ import { PlaygroundStreamToggle } from "./PlaygroundStreamToggle";
import { PlaygroundTemplate } from "./PlaygroundTemplate";
import { TemplateLanguageRadioGroup } from "./TemplateLanguageRadioGroup";

const playgroundWrapCSS = css`
display: flex;
overflow: hidden;
flex-direction: column;
height: 100%;
`;

export function Playground(props: InitialPlaygroundState) {
const showStreamToggle = useFeatureFlag("playgroundNonStreaming");
return (
<PlaygroundProvider {...props}>
<Flex direction="column" height="100%">
<div css={playgroundWrapCSS}>
<View
borderBottomColor="dark"
borderBottomWidth="thin"
Expand All @@ -56,7 +63,7 @@ export function Playground(props: InitialPlaygroundState) {
</Flex>
</View>
<PlaygroundContent />
</Flex>
</div>
</PlaygroundProvider>
);
}
Expand Down Expand Up @@ -100,6 +107,8 @@ const playgroundPromptPanelContentCSS = css`
flex: 1 1 auto;
& > .ac-accordion-item {
height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;
flex: 1 1 auto;
.ac-accordion-itemContent {
Expand All @@ -121,7 +130,7 @@ const playgroundInputOutputPanelContentCSS = css`
display: flex;
flex-direction: column;
height: 100%;
overflow: auto;
flex: 1 1 auto;
`;

function PlaygroundContent() {
Expand Down Expand Up @@ -152,7 +161,7 @@ function PlaygroundContent() {
</Flex>
}
>
<View height="100%" padding="size-200" paddingBottom="size-900">
<View height="100%" padding="size-200">
<Flex direction="row" gap="size-200">
{instances.map((instance) => (
<View key={instance.id} flex="1 1 0px">
Expand Down
22 changes: 12 additions & 10 deletions app/src/pages/playground/PlaygroundTools.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,18 @@ export function PlaygroundTools(props: PlaygroundToolsProps) {
toolNames={toolNames}
/>
</Form>
{tools.map((tool) => {
return (
<PlaygroundTool
key={tool.id}
playgroundInstanceId={instanceId}
tool={tool}
instanceTools={instance.tools}
/>
);
})}
<Flex direction={"column"} gap={"size-200"}>
{tools.map((tool) => {
return (
<PlaygroundTool
key={tool.id}
playgroundInstanceId={instanceId}
tool={tool}
instanceTools={instance.tools}
/>
);
})}
</Flex>
</Flex>
</View>
</AccordionItem>
Expand Down
2 changes: 1 addition & 1 deletion app/src/pages/playground/SpanPlaygroundPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function SpanPlaygroundPage() {
);

return (
<Flex direction="column" height="100%">
<Flex direction="column" height={"100%"}>
<SpanPlaygroundBanners span={span} parsingErrors={parsingErrors} />
<Playground instances={[playgroundInstance]} />
</Flex>
Expand Down

0 comments on commit 99a3d1c

Please sign in to comment.