This commit is contained in:
Yaowei Zou 2025-04-20 19:41:17 +02:00 committed by GitHub
commit ab3115814c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 24 deletions

View File

@ -52,13 +52,10 @@
.sidebar-header-bar { .sidebar-header-bar {
display: flex; display: flex;
margin-bottom: 20px; margin-bottom: 20px;
gap: 10px;
.sidebar-bar-button { .sidebar-bar-button {
flex-grow: 1; flex-grow: 1;
&:not(:last-child) {
margin-right: 10px;
}
} }
} }
@ -252,13 +249,6 @@
.sidebar-header-bar { .sidebar-header-bar {
flex-direction: column; flex-direction: column;
.sidebar-bar-button {
&:not(:last-child) {
margin-right: 0;
margin-bottom: 10px;
}
}
} }
.chat-item { .chat-item {
@ -308,15 +298,10 @@
.sidebar-tail { .sidebar-tail {
flex-direction: column-reverse; flex-direction: column-reverse;
align-items: center; align-items: center;
gap: 15px;
.sidebar-actions { .sidebar-actions {
flex-direction: column-reverse; display: contents;
align-items: center;
.sidebar-action {
margin-right: 0;
margin-top: 15px;
}
} }
} }
} }
@ -329,10 +314,7 @@
.sidebar-actions { .sidebar-actions {
display: inline-flex; display: inline-flex;
} gap: 15px;
.sidebar-action:not(:last-child) {
margin-right: 15px;
} }
.loading-content { .loading-content {
@ -346,4 +328,9 @@
.rtl-screen { .rtl-screen {
direction: rtl; direction: rtl;
.sidebar-drag {
right: unset;
left: 0;
}
} }

View File

@ -13,7 +13,7 @@ import McpIcon from "../icons/mcp.svg";
import DragIcon from "../icons/drag.svg"; import DragIcon from "../icons/drag.svg";
import DiscoveryIcon from "../icons/discovery.svg"; import DiscoveryIcon from "../icons/discovery.svg";
import Locale from "../locales"; import Locale, { getLang } from "../locales";
import { useAppConfig, useChatStore } from "../store"; import { useAppConfig, useChatStore } from "../store";
@ -91,7 +91,11 @@ export function useDragSideBar() {
return; return;
} }
lastUpdateTime.current = Date.now(); lastUpdateTime.current = Date.now();
const d = e.clientX - startX.current; let d = e.clientX - startX.current;
// If text and other elements go from right to left
if (getLang() === "ar") {
d = -1 * d;
}
const nextWidth = limit(startDragWidth.current + d); const nextWidth = limit(startDragWidth.current + d);
config.update((config) => { config.update((config) => {
if (nextWidth < MIN_SIDEBAR_WIDTH) { if (nextWidth < MIN_SIDEBAR_WIDTH) {