Skip to content

Commit 4f5a170

Browse files
committed
fix: improve UI
1 parent 11ff83c commit 4f5a170

7 files changed

Lines changed: 97 additions & 38 deletions

File tree

web/src/App.less

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,12 @@ img {
3636
}
3737

3838
.content-warp-card {
39-
box-shadow: 0 1px 5px 0 rgb(51 51 51 / 14%);
39+
box-shadow: 0 2px 8px 0 rgb(0 0 0 / 8%);
4040
flex: 1;
4141
align-items: stretch;
4242
margin: 0 3px 3px 3px !important;
43-
border-radius: 4px !important;
43+
border-radius: 12px !important;
44+
overflow: hidden;
4445
}
4546

4647
.content-warp-card-filetreeright {

web/src/ChatBox.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ class ChatBox extends React.Component {
340340

341341
return (
342342
<Layout style={{display: "flex", width: "100%", height: "100%", borderRadius: "6px", ...this.props.styles?.layout}}>
343-
<Card style={{display: "flex", width: "100%", height: "100%", flexDirection: "column", position: "relative", padding: "24px", ...this.props.styles?.card}}>
343+
<Card variant="borderless" style={{display: "flex", width: "100%", height: "100%", flexDirection: "column", position: "relative", padding: "0", boxShadow: "none", ...this.props.styles?.card}}>
344344
{messages.length === 0 && !hasUrlMessage && <WelcomeHeader store={this.props.store} />}
345345

346346
<MessageList

web/src/ChatMenu.js

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -271,29 +271,18 @@ class ChatMenu extends React.Component {
271271
const getNewChatButton = () => {
272272
return (
273273
<Button
274+
type="primary"
274275
icon={<PlusOutlined />}
275276
style={{
276-
width: "calc(100% - 8px)",
277-
height: "40px",
278-
margin: "4px",
279-
borderColor: "rgb(229,229,229)",
277+
width: "calc(100% - 16px)",
278+
height: "38px",
279+
margin: "8px",
280+
borderRadius: "8px",
281+
fontWeight: 500,
282+
fontSize: "14px",
283+
boxShadow: "0 1px 4px rgba(0,0,0,0.12)",
280284
}}
281285
disabled={hasEmptyChat}
282-
onMouseEnter={(e) => {
283-
e.currentTarget.style.borderColor = ThemeDefault.colorPrimary;
284-
e.currentTarget.style.opacity = 0.6;
285-
}}
286-
onMouseLeave={(e) => {
287-
e.currentTarget.style.borderColor = "rgba(0, 0, 0, 0.1)";
288-
}}
289-
onMouseDown={(e) => {
290-
e.currentTarget.style.borderColor = ThemeDefault.colorPrimary;
291-
e.currentTarget.style.opacity = 0.4;
292-
}}
293-
onMouseUp={(e) => {
294-
e.currentTarget.style.borderColor = ThemeDefault.colorPrimary;
295-
e.currentTarget.style.opacity = 0.6;
296-
}}
297286
onClick={() => {
298287
if (currentStoreName) {
299288
const currentStore = this.props.stores.find(store => store.name === currentStoreName);
@@ -323,11 +312,17 @@ class ChatMenu extends React.Component {
323312
const items = this.chatsToItems(this.props.chats, this.props.currentStoreName);
324313

325314
return (
326-
<div>
315+
<div style={{height: "100%", display: "flex", flexDirection: "column"}}>
327316
{this.renderAddChatButton(this.props.stores, this.props.currentStoreName)}
328-
<div style={{marginRight: "4px"}}>
317+
<div style={{flex: 1, overflow: "hidden", paddingRight: "4px"}}>
329318
<Menu
330-
style={{maxHeight: "calc(100vh - 140px - 40px - 8px)", overflowY: "auto"}}
319+
className="chat-sidebar-menu"
320+
style={{
321+
maxHeight: "calc(100vh - 140px - 40px - 8px)",
322+
overflowY: "auto",
323+
background: "transparent",
324+
border: "none",
325+
}}
331326
mode="inline"
332327
openKeys={this.state.openKeys}
333328
selectedKeys={this.state.selectedKeys}

web/src/ChatPage.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,14 @@ class ChatPage extends BaseListPage {
791791
}
792792
{
793793
!(Setting.isMobile() || Setting.getUrlParam("isRaw") !== null) && !this.state.chatMenuCollapsed && (
794-
<div style={{width: "250px", height: "100%", marginRight: "2px"}}>
794+
<div style={{
795+
width: "250px",
796+
height: "100%",
797+
marginRight: "0",
798+
background: "#f7f8fa",
799+
borderRight: "1px solid #ebebeb",
800+
flexShrink: 0,
801+
}}>
795802
<ChatMenu ref={this.menu} chats={chats} chatName={this.getChat()} onSelectChat={onSelectChat} onAddChat={onAddChat} onDeleteChat={onDeleteChat} onUpdateChatName={onUpdateChatName} stores={this.state.stores} currentStoreName={currentStoreName} />
796803
</div>
797804
)
@@ -804,14 +811,14 @@ class ChatPage extends BaseListPage {
804811
</Drawer>
805812
)}
806813

807-
<div style={{flex: 1, height: "100%", position: "relative", display: "flex", flexDirection: "column"}}>
814+
<div style={{flex: 1, height: "100%", position: "relative", display: "flex", flexDirection: "column", minWidth: 0}}>
808815
{this.state.chat && this.state.paneCount === 1 && (
809-
<div style={{display: "flex", alignItems: "center", marginLeft: "15px"}}>
816+
<div style={{display: "flex", alignItems: "center", borderBottom: "1px solid #f0f0f0", background: "rgba(255,255,255,0.9)", backdropFilter: "blur(8px)"}}>
810817
{Setting.isMobile() && (
811-
<Button type="text" icon={<BarsOutlined />} onClick={this.toggleChatMenu} style={{marginRight: "8px"}} />
818+
<Button type="text" icon={<BarsOutlined />} onClick={this.toggleChatMenu} style={{margin: "0 4px"}} />
812819
)}
813820
{!(Setting.isMobile() || Setting.getUrlParam("isRaw") !== null) && (
814-
<Button type="text" icon={this.state.chatMenuCollapsed ? <MenuUnfoldOutlined /> : <MenuFoldOutlined />} onClick={this.toggleChatMenuCollapse} style={{marginRight: "8px"}} />
821+
<Button type="text" icon={this.state.chatMenuCollapsed ? <MenuUnfoldOutlined /> : <MenuFoldOutlined />} onClick={this.toggleChatMenuCollapse} style={{margin: "0 4px"}} />
815822
)}
816823
<div style={{flex: 1}}>
817824
<StoreInfoTitle chat={this.state.chat} stores={this.state.stores} onChatUpdated={this.handleChatUpdate} onStoreChange={this.updateStoreAndUrl} autoRead={this.state.autoRead} onUpdateAutoRead={(checked) => this.setState({autoRead: checked})} account={this.props.account} paneCount={this.state.paneCount} onPaneCountChange={(count) => this.setState({paneCount: count})} showPaneControls={true} generationMode={this.state.generationMode} onGenerationModeChange={this.handleGenerationModeChange} />

web/src/StoreInfoTitle.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,11 +279,11 @@ const StoreInfoTitle = (props) => {
279279

280280
return (
281281
<div style={{
282-
padding: "10px 15px",
283-
borderBottom: "1px solid #e8e8e8",
282+
padding: "8px 16px",
284283
display: "flex",
285284
alignItems: "center",
286285
justifyContent: "space-between",
286+
minHeight: "48px",
287287
}}>
288288
<div style={{display: "flex", alignItems: "center"}}>
289289
{storeInfo && (

web/src/chat/WelcomeHeader.js

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,26 @@ const WelcomeHeader = ({store}) => {
2121
const avatar = (store === undefined) ? null : store.avatar || Setting.getDefaultAiAvatar();
2222

2323
return (
24-
<Welcome
25-
variant="borderless"
26-
icon={avatar}
27-
title={(store === undefined) ? null : store.welcomeTitle || i18next.t("chat:Hello, I'm OpenAgent AI Assistant")}
28-
description={(store === undefined) ? null : store.welcomeText || i18next.t("chat:I'm here to help answer your questions")}
29-
/>
24+
<div style={{
25+
display: "flex",
26+
flexDirection: "column",
27+
alignItems: "center",
28+
justifyContent: "center",
29+
padding: "48px 24px 32px",
30+
flex: 1,
31+
}}>
32+
<Welcome
33+
variant="borderless"
34+
icon={avatar}
35+
title={(store === undefined) ? null : store.welcomeTitle || i18next.t("chat:Hello, I'm OpenAgent AI Assistant")}
36+
description={(store === undefined) ? null : store.welcomeText || i18next.t("chat:I'm here to help answer your questions")}
37+
style={{textAlign: "center"}}
38+
styles={{
39+
title: {fontSize: "22px", fontWeight: 600, letterSpacing: "-0.3px"},
40+
description: {fontSize: "15px", color: "#888", marginTop: "6px"},
41+
}}
42+
/>
43+
</div>
3044
);
3145
};
3246

web/src/index.css

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,3 +282,45 @@ a[href^="mailto:"]:active {
282282
.ant-message .ant-message-custom-content span {
283283
font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif !important;
284284
}
285+
286+
/* Chat sidebar menu: transparent background, rounded items */
287+
.chat-sidebar-menu.ant-menu-inline {
288+
background: transparent !important;
289+
border-inline-end: none !important;
290+
}
291+
292+
.chat-sidebar-menu .ant-menu-submenu-title {
293+
border-radius: 6px !important;
294+
margin: 2px 4px !important;
295+
width: calc(100% - 8px) !important;
296+
color: #555 !important;
297+
font-size: 12px !important;
298+
letter-spacing: 0.03em !important;
299+
text-transform: uppercase !important;
300+
}
301+
302+
.chat-sidebar-menu .ant-menu-item {
303+
border-radius: 6px !important;
304+
margin: 2px 4px !important;
305+
width: calc(100% - 8px) !important;
306+
height: 36px !important;
307+
line-height: 36px !important;
308+
font-size: 13.5px !important;
309+
font-weight: 500 !important;
310+
transition: background 0.15s ease !important;
311+
}
312+
313+
.chat-sidebar-menu .ant-menu-item:hover {
314+
background: rgba(0, 0, 0, 0.05) !important;
315+
}
316+
317+
.chat-sidebar-menu .ant-menu-item-selected {
318+
background: rgba(0, 0, 0, 0.08) !important;
319+
color: inherit !important;
320+
font-weight: 600 !important;
321+
}
322+
323+
/* Smooth transition on collapse/expand */
324+
.ant-layout-sider {
325+
transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
326+
}

0 commit comments

Comments
 (0)