Skip to content

Commit 6d966e3

Browse files
committed
enhance: fix the assistant name to the top of the chat screen
Signed-off-by: Donnie Adams <[email protected]>
1 parent 242309f commit 6d966e3

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

app/page.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ function RunFile() {
3333
>
3434
<div className="w-full h-full flex pb-10">
3535
<Threads />
36-
<div className="mx-auto w-[75%] 2xl:w-[55%] 3xl:[w-50%]">
37-
<Script enableThreads showAssistantName className="pb-10" />
38-
</div>
36+
<Script enableThreads showAssistantName className="pb-10" />
3937
</div>
4038
</div>
4139
</section>

components/script.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ const Script: React.FC<ScriptProps> = ({
106106
<>
107107
<div
108108
id="small-message"
109-
className={`px-6 pt-10 overflow-y-auto w-full items-center ${messagesHeight}`}
109+
className={`overflow-y-auto w-full items-center ${messagesHeight}`}
110110
>
111111
{showForm && hasParams ? (
112112
<ToolForm
@@ -117,9 +117,11 @@ const Script: React.FC<ScriptProps> = ({
117117
) : (
118118
<div>
119119
{showAssistantName && (
120-
<h1 className="mb-10 text-2xl font-medium truncate">
121-
{scriptDisplayName ?? ''}
122-
</h1>
120+
<div className="sticky top-0 p-4 z-50 bg-background">
121+
<h1 className="text-2xl font-medium truncate">
122+
{scriptDisplayName ?? ''}
123+
</h1>
124+
</div>
123125
)}
124126
<Messages restart={restartScript} messages={messages} />
125127
</div>

components/script/chatBar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ const ChatBar = ({ disabled = false, onMessageSent }: ChatBarProps) => {
9696
}
9797

9898
return (
99-
<div className="flex px-4 space-x-2 sw-full">
99+
<div className="flex px-4 space-x-2 sw-full mx-auto 2xl:w-[75%]">
100100
<Button
101101
isIconOnly
102102
startContent={<GoKebabHorizontal />}

components/script/messages.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ const Messages = ({
163163
noAvatar?: boolean;
164164
restart?: () => void;
165165
}) => (
166-
<div>
166+
<div className="mx-auto px-6 2xl:w-[75%]">
167167
{messages.map((message, index) => (
168168
<Message
169169
key={index}

components/threads.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const Threads: React.FC<ThreadsProps> = () => {
3434

3535
return (
3636
<div
37-
className={`relative p-4 overflow-y-auto ${isCollapsed ? 'border-none' : 'border-r-1 dark:border-r-zinc-800'}`}
37+
className={`min-w-fit relative p-4 overflow-y-auto ${isCollapsed ? 'border-none' : 'border-r-1 dark:border-r-zinc-800'}`}
3838
>
3939
<div className={`flex justify-between items-center mb-2`}>
4040
<Tooltip
@@ -57,7 +57,7 @@ const Threads: React.FC<ThreadsProps> = () => {
5757
</div>
5858
<div
5959
style={{
60-
width: isCollapsed ? '50px' : '250px',
60+
width: isCollapsed ? '50px' : 'max-w-[300px]',
6161
transition: 'width 0.3s ease-in-out',
6262
}}
6363
>

0 commit comments

Comments
 (0)