Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(styles): make prompt section scrollable to the bottom #5173

Merged
merged 3 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading