Skip to content

Commit 1cc055c

Browse files
committed
frontend: quick actions redesign; collapsible wrapper
1 parent 5f235f7 commit 1cc055c

6 files changed

Lines changed: 282 additions & 186 deletions

File tree

webui/components/sidebar/left-sidebar.html

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,30 @@
1010
<body>
1111
<div x-data>
1212
<template x-if="$store.sidebar">
13-
<div id="left-panel" class="panel" x-data :class="{'hidden': !$store.sidebar.isOpen}">
14-
<x-extension id="sidebar-start"></x-extension>
15-
<!--Sidebar upper elements-->
16-
<div class="left-panel-top no-scrollbar">
17-
<!-- Top Section: Header Icons + Quick Actions -->
18-
<x-component path="sidebar/top-section/sidebar-top.html"></x-component>
19-
<!-- Chats List -->
20-
<div class="config-section" id="chats-section">
21-
<x-component path="sidebar/chats/chats-list.html"></x-component>
13+
<div class="sidebar-shell">
14+
<x-component path="sidebar/top-section/header-icons.html"></x-component>
15+
<div id="left-panel" class="panel" x-data :class="{'hidden': !$store.sidebar.isOpen}">
16+
<x-extension id="sidebar-start"></x-extension>
17+
<!--Sidebar upper elements-->
18+
<div class="left-panel-top no-scrollbar">
19+
<!-- Top Section: Quick Actions -->
20+
<x-component path="sidebar/top-section/sidebar-top.html"></x-component>
21+
<!-- Chats List -->
22+
<div class="config-section" id="chats-section">
23+
<x-component path="sidebar/chats/chats-list.html"></x-component>
24+
</div>
25+
26+
<!-- Tasks List -->
27+
<div class="config-section" id="tasks-section">
28+
<x-component path="sidebar/tasks/tasks-list.html"></x-component>
29+
</div>
2230
</div>
23-
24-
<!-- Tasks List -->
25-
<div class="config-section" id="tasks-section">
26-
<x-component path="sidebar/tasks/tasks-list.html"></x-component>
31+
<!--Sidebar lower elements-->
32+
<div class="left-panel-bottom">
33+
<x-component path="sidebar/bottom/sidebar-bottom.html"></x-component>
2734
</div>
35+
<x-extension id="sidebar-end"></x-extension>
2836
</div>
29-
<!--Sidebar lower elements-->
30-
<div class="left-panel-bottom">
31-
<x-component path="sidebar/bottom/sidebar-bottom.html"></x-component>
32-
</div>
33-
<x-extension id="sidebar-end"></x-extension>
3437
</div>
3538
</template>
3639
</div>
@@ -85,7 +88,7 @@
8588
/* Critical for allowing flex children to shrink */
8689
overflow: hidden;
8790
justify-content: space-between;
88-
margin-top: 6rem;
91+
margin-top: 6.5rem;
8992
padding: var(--spacing-md) var(--spacing-md) 0 var(--spacing-md);
9093
}
9194

webui/components/sidebar/sidebar-store.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,16 @@ const model = {
9393
updateDropdownPosition(triggerElement) {
9494
if (!triggerElement) return;
9595
const rect = triggerElement.getBoundingClientRect();
96+
const menuWidth = Math.max(rect.width, 180);
97+
const viewportPadding = 8;
98+
const maxLeft = Math.max(
99+
viewportPadding,
100+
window.innerWidth - menuWidth - viewportPadding,
101+
);
96102
this.dropdownStyle = {
97103
top: `${rect.bottom + 8}px`,
98-
left: `${rect.left}px`,
99-
width: `${rect.width}px`
104+
left: `${Math.min(Math.max(rect.left, viewportPadding), maxLeft)}px`,
105+
width: `${menuWidth}px`
100106
};
101107
},
102108
};

0 commit comments

Comments
 (0)