From 2d2f6001ffa6a42e75a345dec0f42a0d51c91119 Mon Sep 17 00:00:00 2001 From: "ryunosuke.ito" Date: Sun, 1 Mar 2026 16:12:35 +0900 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=E3=83=89=E3=83=A9=E3=83=83?= =?UTF-8?q?=E3=82=B0=E3=81=A7=E6=9C=80=E5=B0=8F=E5=B9=85=E3=82=92=E4=B8=8B?= =?UTF-8?q?=E5=9B=9E=E3=81=A3=E3=81=9F=E3=82=89=E3=82=B5=E3=82=A4=E3=83=89?= =?UTF-8?q?=E3=83=90=E3=83=BC=E3=82=92=E8=87=AA=E5=8B=95=E3=81=A7=E9=96=89?= =?UTF-8?q?=E3=81=98=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit リサイズ中にMIN_SIDEBAR_WIDTH未満になった時点でサイドバーを collapsed状態に切り替える。 Co-Authored-By: Claude Opus 4.6 --- src/components/Layout.tsx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx index 5e3dd55..3e520e2 100644 --- a/src/components/Layout.tsx +++ b/src/components/Layout.tsx @@ -51,11 +51,17 @@ export default function Layout({ sidebar, editor }: Props) { const handleMouseMove = (e: MouseEvent) => { const delta = e.clientX - startX.current; - const newWidth = Math.min( - MAX_SIDEBAR_WIDTH, - Math.max(MIN_SIDEBAR_WIDTH, startWidth.current + delta), + const rawWidth = startWidth.current + delta; + if (rawWidth < MIN_SIDEBAR_WIDTH) { + setSidebarOpen(false); + setIsResizing(false); + document.body.style.cursor = ""; + document.body.style.userSelect = ""; + return; + } + setSidebarWidth( + Math.min(MAX_SIDEBAR_WIDTH, Math.max(MIN_SIDEBAR_WIDTH, rawWidth)), ); - setSidebarWidth(newWidth); }; const handleMouseUp = () => { From ab4aac64382289bbfa1708642a5a8b3e87b34f1b Mon Sep 17 00:00:00 2001 From: "ryunosuke.ito" Date: Sun, 1 Mar 2026 16:16:41 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E3=82=B5=E3=82=A4=E3=83=89=E3=83=90?= =?UTF-8?q?=E3=83=BC=E8=87=AA=E5=8B=95=E9=96=89=E3=81=98=E3=81=AE=E3=81=97?= =?UTF-8?q?=E3=81=8D=E3=81=84=E5=80=A4=E3=82=92120px=E3=81=AB=E8=A8=AD?= =?UTF-8?q?=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 最小幅(180px)から少し動いただけで閉じてしまう問題を修正。 120px未満まで縮めた時に閉じるようにした。 Co-Authored-By: Claude Opus 4.6 --- src/components/Layout.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx index 3e520e2..cc83382 100644 --- a/src/components/Layout.tsx +++ b/src/components/Layout.tsx @@ -10,6 +10,7 @@ import TitleBar from "./TitleBar"; const MIN_SIDEBAR_WIDTH = 180; const MAX_SIDEBAR_WIDTH = 400; const DEFAULT_SIDEBAR_WIDTH = 260; +const COLLAPSE_THRESHOLD = 120; interface Props { sidebar: ReactNode; @@ -52,7 +53,7 @@ export default function Layout({ sidebar, editor }: Props) { const handleMouseMove = (e: MouseEvent) => { const delta = e.clientX - startX.current; const rawWidth = startWidth.current + delta; - if (rawWidth < MIN_SIDEBAR_WIDTH) { + if (rawWidth < COLLAPSE_THRESHOLD) { setSidebarOpen(false); setIsResizing(false); document.body.style.cursor = "";