Skip to content

Commit abe5dc4

Browse files
committed
more updates on the UI for the chat
1 parent 3497c8a commit abe5dc4

5 files changed

Lines changed: 58 additions & 37 deletions

File tree

frontend/src/App.css

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,6 @@ Error message. Please see ErrorMessages.tsx under components folder
264264

265265
.thinking {
266266

267-
font-size: 16px;
268-
269267
animation: ellipsis 1.5s infinite;
270268
}
271269

frontend/src/pages/DrugSummary/DrugSummaryForm.tsx

Lines changed: 43 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -188,17 +188,26 @@ const DrugSummaryForm = () => {
188188
</div>
189189
) : (
190190
chatLog.map((message, index) => (
191-
<div key={index} className="flex flex-col gap-4 p-3">
191+
<div key={index} className="flex flex-col gap-4 p-2">
192+
{message.type === "user" ? null : (
193+
<div className=" flex items-center justify-between">
194+
<div className="flex items-center">
195+
<span className="font-bold text-sm font-quicksand text-sky-950">
196+
Balancer
197+
</span>
198+
</div>
199+
</div>
200+
)}
192201
<div
193-
className={`${
202+
className={`flex ${
194203
message.type === "user" ? "justify-end" : "justify-start"
195-
} `}
204+
}`}
196205
>
197206
<div
198207
className={`${
199208
message.type === "user"
200-
? "border border-black text-sm font-quicksand"
201-
: "border bg-blue-50 bg-opacity-50 border-sky-400 text-sm font-quicksand "
209+
? "border border-black text-sm font-quicksand shadow-md"
210+
: "border bg-blue-50 bg-opacity-50 border-sky-400 text-sm font-quicksand shadow-md"
202211
} rounded-lg p-2 relative`}
203212
>
204213
{typeof message.message === "string" ? (
@@ -215,7 +224,9 @@ const DrugSummaryForm = () => {
215224
message.message.llm_response.length === 0 && (
216225
<div className="flex justify-start">
217226
<div className="items-center justify-center p-1">
218-
<span className="thinking">Let me think</span>
227+
<span className="thinking bg-blue-50 bg-opacity-50 text-sm font-quicksand">
228+
Let me think
229+
</span>
219230
</div>
220231
</div>
221232
)}
@@ -243,26 +254,33 @@ const DrugSummaryForm = () => {
243254
))
244255
)}
245256
</div>
246-
<form onSubmit={handleSubmit} className="p-3 font-quicksand mt-8">
247-
<div className="relative flex items-center border border-sky-400 rounded-lg bg-white shadow-sm px-3 py-2">
248-
<textarea
249-
ref={textareaRef}
250-
placeholder="Ask the document a question..."
251-
className="w-full resize-none bg-transparent outline-none text-gray-700 placeholder-gray-400"
252-
rows={1}
253-
value={inputValue}
254-
onChange={handleInputChange}
255-
onKeyDown={handleKeyDown}
256-
disabled={isStreaming}
257-
style={{ height: `${inputHeight}px`, maxHeight: "150px" }}
258-
/>
259-
<div className="absolute left-3 bottom-full mb-1 text-xs text-gray-500 flex items-center gap-2">
260-
<span>Balancer 1.0</span>
261-
<span></span>
262-
<span>{inputValue.trim().split(/\s+/).length} words</span>
257+
<div className="p-3 font-quicksand mt-8 bg-gray-100 rounded-2xl shadow-inner">
258+
<form onSubmit={handleSubmit} className="space-y-2">
259+
<div className="relative flex items-center border border-gray-300 rounded-xl bg-white shadow-sm px-4 py-3">
260+
<textarea
261+
ref={textareaRef}
262+
placeholder="Ask the document a question..."
263+
className="w-full resize-none bg-transparent outline-none text-sm font-quicksand placeholder-gray-500"
264+
rows={1}
265+
value={inputValue}
266+
onChange={handleInputChange}
267+
onKeyDown={handleKeyDown}
268+
disabled={isStreaming}
269+
style={{ height: `${inputHeight}px`, maxHeight: "150px" }}
270+
/>
263271
</div>
264-
</div>
265-
</form>
272+
273+
<div className="text-xs text-gray-500 flex items-center justify-between px-1">
274+
<div className="flex items-center gap-2">
275+
<span>Balancer 1.0</span>
276+
<span></span>
277+
<span>
278+
{inputValue.trim().split(/\s+/).filter(Boolean).length} words
279+
</span>
280+
</div>
281+
</div>
282+
</form>
283+
</div>
266284
</div>
267285
</div>
268286
);

frontend/src/pages/DrugSummary/PDFViewer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ const PDFViewer = () => {
215215
return (
216216
<div
217217
ref={containerRef}
218-
className="w-full h-full flex flex-col bg-white border-r border-gray-30"
218+
className="w-full h-full flex flex-col bg-white border-r border-blue-200"
219219
>
220220
<div
221221
ref={headerRef}

frontend/src/pages/Layout/Layout_V2_Header.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,24 +32,27 @@ const Header: React.FC<LoginFormProps> = ({ isAuthenticated }) => {
3232
useAuth();
3333

3434
return (
35-
<header className="flex h-20 w-full items-center justify-between border-b border-gray-300 bg-white px-4 lg:px-8">
36-
<nav className="flex flex-grow justify-center space-x-6 font-quicksand text-base text-lg font-semibold text-gray-500">
35+
<header
36+
className="flex w-full items-center justify-between border-b border-blue-300 bg-white p-4 lg:px-8"
37+
style={{ height: "43px", minHeight: "43px", maxHeight: "43px" }}
38+
>
39+
<div className="flex-grow"></div>
40+
<nav className="flex items-center space-x-2 font-quicksand text-sm font-medium">
3741
<div className=" hover:border-emerald-600 hover:text-emerald-600 hover:no-underline space-x-4">
3842
<Link
3943
to="/"
40-
className="text-black hover:border-blue-600 hover:text-blue-600 hover:no-underline"
44+
className="px-3 py-1.5 text-gray-700 bg-sky-100 rounded-md hover:bg-gray-200 hover:text-gray-900 transition-colors duration-200"
4145
>
4246
Home
4347
</Link>
4448
<Link
4549
to="/AdminPortal"
46-
className="text-black hover:border-blue-600 hover:text-blue-600 hover:no-underline"
50+
className="px-3 py-1.5 text-gray-700 bg-sky-100 rounded-md hover:bg-gray-200 hover:text-gray-900 transition-colors duration-200"
4751
>
4852
Admin Portal
4953
</Link>
5054
</div>
5155
</nav>
52-
{/* Add login menu logic here */}
5356
{!isAuthenticated && showLoginMenu && (
5457
<div className="flex w-1/6 flex-none justify-end">
5558
<LoginMenuDropDown

frontend/src/pages/Layout/Layout_V2_Sidebar.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,21 @@ const Sidebar: React.FC = () => {
4646
const handleFileClick = (guid: string) => {
4747
const params = new URLSearchParams(location.search);
4848
const currentGuid = params.get("guid");
49-
49+
5050
if (guid !== currentGuid) {
5151
navigate(`/drugsummary?guid=${guid}&page=1`);
5252
} else {
53-
navigate(`/drugsummary?guid=${guid}${params.has("page") ? `&page=${params.get("page")}` : ""}`);
53+
navigate(
54+
`/drugsummary?guid=${guid}${params.has("page") ? `&page=${params.get("page")}` : ""}`
55+
);
5456
}
5557
};
5658

5759
return (
5860
<div
5961
className={`z-10 h-screen ${
6062
sidebarCollapsed ? "w-16" : "w-60"
61-
} flex flex-col border-r border-gray-200 bg-white transition-all duration-300 ease-in-out`}
63+
} flex flex-col border-r border-blue-200 bg-white transition-all duration-300 ease-in-out`}
6264
>
6365
<div className="flex h-16 w-full items-center justify-between px-4">
6466
{!sidebarCollapsed && (
@@ -112,4 +114,4 @@ const Sidebar: React.FC = () => {
112114
);
113115
};
114116

115-
export default Sidebar;
117+
export default Sidebar;

0 commit comments

Comments
 (0)