Skip to content

Commit 7d46ee2

Browse files
jasonczcclaude
andcommitted
style(web): animated sidebar collapse + chevron + hide hover icon
- Sidebar: animate width 210→0 (220ms) instead of display:none, so the toggle button produces a smooth slide-in/out - Group chevron: rotate -90deg when collapsed (▼ → ›) - Group content: grid-template-rows transition keeps collapse smooth - Force action icon opacity:0 when not hovered (add !important so it doesn't leak out in idle state) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent ccd8da7 commit 7d46ee2

2 files changed

Lines changed: 27 additions & 2 deletions

File tree

web/src/cursor-theme.css

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1058,6 +1058,10 @@ body {
10581058
.cursor-theme .section-title .section-chevron {
10591059
color: #BDBDBD;
10601060
flex-shrink: 0;
1061+
transition: transform 180ms cubic-bezier(0.2, 0, 0, 1);
1062+
}
1063+
.cursor-theme .sidebar-section.collapsed .section-title .section-chevron {
1064+
transform: rotate(-90deg);
10611065
}
10621066
.cursor-theme .sidebar-section-header { cursor: pointer !important; }
10631067
.cursor-theme .sidebar-section-header:hover .section-title {
@@ -1069,7 +1073,7 @@ body {
10691073
}
10701074
.cursor-theme .sidebar-section-header .section-action-btn {
10711075
display: flex !important;
1072-
opacity: 0;
1076+
opacity: 0 !important;
10731077
transition: opacity 0.12s ease, background-color 0.12s ease;
10741078
padding: 3px;
10751079
border-radius: 5px;
@@ -1082,6 +1086,18 @@ body {
10821086
background: #F0F0F0;
10831087
color: #1F1F1F;
10841088
}
1089+
1090+
/* Section content collapse animation (grid-template-rows trick).
1091+
Base rule already exists in cursor-theme.css but ensure smooth timing. */
1092+
.cursor-theme .section-content {
1093+
display: grid;
1094+
grid-template-rows: 1fr;
1095+
transition: grid-template-rows 220ms cubic-bezier(0.2, 0, 0, 1);
1096+
}
1097+
.cursor-theme .sidebar-section.collapsed .section-content {
1098+
grid-template-rows: 0fr;
1099+
}
1100+
.cursor-theme .section-content-inner { overflow: hidden; }
10851101
.cursor-theme .section-title.lowercase-title { text-transform: none !important; }
10861102
.cursor-theme .sidebar-section { margin-bottom: 14px; }
10871103
.cursor-theme .sidebar-section-header { height: 22px; padding-right: 6px; margin-bottom: 2px; cursor: default; }
@@ -1097,7 +1113,16 @@ body {
10971113
border-right: 1px solid #EAEAEA !important;
10981114
border-radius: 0 !important;
10991115
box-shadow: none !important;
1116+
transition: width 220ms cubic-bezier(0.2, 0, 0, 1), min-width 220ms cubic-bezier(0.2, 0, 0, 1);
1117+
overflow: hidden;
1118+
}
1119+
.cursor-theme .sidebar.sidebar-collapsed {
1120+
width: 0 !important;
1121+
min-width: 0 !important;
1122+
border-right-width: 0 !important;
11001123
}
1124+
.cursor-theme .sidebar.sidebar-collapsed > * { opacity: 0; transition: opacity 120ms ease-out; }
1125+
.cursor-theme .sidebar > * { transition: opacity 160ms ease-in 60ms; }
11011126
.cursor-theme .sidebar-header {
11021127
padding: 14px 12px 8px !important;
11031128
display: flex !important;

web/src/router.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,7 @@ function SessionsPage() {
812812
<SessionsLayoutContext.Provider value={{ toggleSidebarFromHeader, showDesktopSidebar, density }}>
813813
<div className="app-container cursor-theme">
814814
<div
815-
className={`sidebar ${isSessionsIndex ? 'flex' : showDesktopSidebar ? 'hidden lg:flex' : 'hidden'}`}
815+
className={`sidebar flex ${showDesktopSidebar ? '' : 'sidebar-collapsed'}`}
816816
style={sidebarStyle}
817817
>
818818
<div className="sidebar-resizer" onMouseDown={startSidebarResize} />

0 commit comments

Comments
 (0)