Skip to content

Commit 7f01558

Browse files
authored
Merge pull request #846 from quoid/editor-sidebar-resize
fix: optimize several issues and experiences
2 parents 83eef5c + 6bcab18 commit 7f01558

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

src/ext/extension-page/App.svelte

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@
6666
const editorMinWidth = "20rem";
6767
6868
function sidebarSwitch() {
69+
if (!sidebarHidden && !$items.find((i) => i.active)) {
70+
log.add("Please select or create a new item first.", "info", true);
71+
return;
72+
}
6973
sidebarHidden = !sidebarHidden;
7074
}
7175
@@ -168,7 +172,7 @@
168172
cursor: col-resize;
169173
position: fixed;
170174
inset: 0;
171-
z-index: 200;
175+
z-index: 20;
172176
}
173177
174178
.splitter {
@@ -182,7 +186,7 @@
182186
left: calc(var(--sidebar-fixed-width) - var(--splitter-offset));
183187
width: var(--splitter-width);
184188
height: 100svh;
185-
z-index: 201;
189+
z-index: 21;
186190
transition: background-color 0.2s ease-in-out;
187191
188192
&:hover,

src/ext/extension-page/Components/Sidebar/Sidebar.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@
8181
}
8282
8383
async function activate(item) {
84-
// if not in ready state or the item is already active
85-
if (!$v4state.includes("ready") || item.active) return;
84+
// if item is empty or already active
85+
if (!item || item.active) return;
8686
8787
// check if there's a temp item and it's not the item to be activated
8888
// can occur when user clicks a non-temp item while a temp item exists
@@ -228,7 +228,7 @@
228228
title="Open settings"
229229
{disabled}
230230
/>
231-
<Dropdown icon={iconPlus} title="New item" {disabled} right>
231+
<Dropdown icon={iconPlus} title="New item" {disabled}>
232232
<button on:click={() => newItem("js")}>New JS</button>
233233
<button on:click={() => newItem("css")}>New CSS</button>
234234
<button on:click={newRemote}>New Remote</button>

0 commit comments

Comments
 (0)