Skip to content

Commit

Permalink
fixup! fixup! feat: pos-tlaunch qa updates
Browse files Browse the repository at this point in the history
  • Loading branch information
PetrBulanek committed Dec 18, 2024
1 parent 697c6eb commit 2556988
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 59 deletions.
1 change: 0 additions & 1 deletion src/layout/shell/CollapsibleGroup.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
.root {
display: flex;
flex-direction: column;
min-block-size: 0;
}

.header {
Expand Down
16 changes: 10 additions & 6 deletions src/layout/shell/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,16 @@ export function Navbar({ sidebarId, sidebarOpen }: Props) {
]
);
case 'chat':
return [
{
title: navbarProps.assistant?.name ?? '',
icon: <AssistantIcon assistant={navbarProps.assistant ?? null} />,
},
];
return navbarProps.assistant
? [
{
title: navbarProps.assistant.name ?? '',
icon: (
<AssistantIcon assistant={navbarProps.assistant ?? null} />
),
},
]
: undefined;
default:
return title ? [{ title }] : undefined;
}
Expand Down
35 changes: 9 additions & 26 deletions src/layout/shell/Sidebar.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -75,35 +75,18 @@ $width: var(--sidebar-width);
}
}

.content {
display: flex;
flex-direction: column;
row-gap: $spacing-05;
flex-grow: 1;
min-block-size: 0;
}

.agents,
.history {
> div {
margin-inline: -$padding-x;
}
}

.agents {
flex-shrink: 0;
max-block-size: calc(50% - $spacing-05);
}

.history {
flex-grow: 1;
}

.scrollSection {
.scroll {
@include scrollbar();
overflow-y: auto;
scrollbar-gutter: stable;
padding-inline: $padding-x;
max-block-size: 100%;
margin-inline: -$padding-x;
flex-grow: 1;
display: flex;
flex-direction: column;
row-gap: $spacing-05;
margin-block-end: -$spacing-05;
padding-block-end: $spacing-05;
}

.userNav {
Expand Down
20 changes: 6 additions & 14 deletions src/layout/shell/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,25 +49,17 @@ export function Sidebar({ id, isOpen }: SidebarProps) {
/>

<div id={id} aria-hidden={!isOpen} className={classes.panel}>
<MainNav />
<div className={classes.scroll}>
<MainNav />

<hr />
<hr />

<div className={classes.content}>
<div className={classes.agents}>
<AssistantsNav
className={classes.scrollSection}
enableFetch={Boolean(isOpen)}
/>
</div>
<AssistantsNav enableFetch={Boolean(isOpen)} />

<hr />

<CollapsibleGroup heading="Sessions" className={classes.history}>
<ThreadsHistory
enableFetch={Boolean(isOpen)}
className={classes.scrollSection}
/>
<CollapsibleGroup heading="Sessions">
<ThreadsHistory enableFetch={Boolean(isOpen)} />
</CollapsibleGroup>
</div>

Expand Down
4 changes: 1 addition & 3 deletions src/modules/assistants/AssistantsNav.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,16 @@
}

.root {
min-block-size: 0;
display: flex;
flex-direction: column;
max-block-size: 100%;
}

.header {
display: flex;
align-items: center;
justify-content: space-between;
column-gap: $spacing-03;
padding-inline: $spacing-06;
padding-inline: $spacing-03;
margin-block-end: $spacing-03;
}

Expand Down
2 changes: 1 addition & 1 deletion src/modules/assistants/AssistantsNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ function NewButton() {
<IconButton
kind="tertiary"
label="New agent"
align="right"
align="left"
onClick={() =>
openModal((props) => (
<ProjectProvider project={project} organization={organization}>
Expand Down
7 changes: 0 additions & 7 deletions src/modules/chat/ConversationHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,10 @@
*/

import { Container } from '@/components/Container/Container';
import { useAppContext } from '@/layout/providers/AppProvider';
import { NewSessionButton } from '@/layout/shell/NewSessionButton';
import classes from './ConversationHeader.module.scss';
import { useChat } from './providers/ChatProvider';

export function ConversationHeader() {
const { assistant: appAssistant } = useAppContext();
const { assistant: threadAssistant } = useChat();

const assistant = threadAssistant.data ?? appAssistant;

return (
<div className={classes.root}>
<div className={classes.holder}>
Expand Down
4 changes: 3 additions & 1 deletion src/modules/chat/ConversationView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ export const ConversationView = memo(function ConversationView({
initialAssistantMessage,
} = useChat();

const showTopBar = topBarEnabled && !assistant.isDeleted;

const scrollToBottom = useCallback(() => {
const scrollElement = scrollRef.current;

Expand Down Expand Up @@ -100,7 +102,7 @@ export const ConversationView = memo(function ConversationView({

return (
<div {...(dropzone ? dropzone.getRootProps({ className }) : { className })}>
{topBarEnabled && <ConversationHeader />}
{showTopBar && <ConversationHeader />}

<div className={classes.content} ref={scrollRef}>
<div ref={bottomRef} />
Expand Down

0 comments on commit 2556988

Please sign in to comment.