Skip to content

Commit ebbed12

Browse files
committed
refactor: remove right sidebar mini-mode, change left sidebar tabs from vertical to horizontal
- Remove three-state right sidebar toggle (expanded → mini → hidden), revert to simple show/hide - Remove rightMiniMode ref and related state management from PageLayout - Remove right-sidebar-mini slot and quick action buttons from PageEditorView - Change PageEditorLeftSidebar tab strip from vertical (40px left border) to horizontal (top border) - Update PageLayout tests to reflect simplified two-state
1 parent da12c77 commit ebbed12

4 files changed

Lines changed: 12 additions & 86 deletions

File tree

new-deepnotes/apps/web/src/features/pages/PageEditorLeftSidebar.vue

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,10 @@ const tabs = [
1616
</script>
1717

1818
<template>
19-
<div class="flex h-full w-full overflow-hidden">
20-
<!-- Vertical tab strip -->
19+
<div class="flex flex-col h-full w-full overflow-hidden">
20+
<!-- Horizontal tab strip -->
2121
<div
22-
class="border-border/40 bg-muted/30 flex flex-col items-center gap-1 border-r py-2"
23-
style="width: 40px; min-width: 40px"
22+
class="border-border/40 bg-muted/30 flex flex-row items-center gap-1 border-b px-2 py-1"
2423
>
2524
<button
2625
v-for="tab in tabs"

new-deepnotes/apps/web/src/features/pages/PageEditorView.vue

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ import PageStateScreens from "./screens/PageStateScreens.vue";
3939
import { usePageStatus } from "./usePageStatus";
4040
import { useUserPageLists } from "./useUserPageLists";
4141
import { cursorColorForUserId } from "./page-awareness-utils";
42-
import { FilePlus, ArrowUpDown, Copy } from "lucide-vue-next";
4342
4443
import type { SnapshotRow } from "./page-snapshot-list";
4544
@@ -624,61 +623,6 @@ onMounted(() => {
624623
</div>
625624
</template>
626625

627-
<!-- === Right sidebar mini mode === -->
628-
<template #right-sidebar-mini>
629-
<div class="flex flex-col items-center gap-2">
630-
<!-- Note mini actions -->
631-
<template v-if="selectedNoteId">
632-
<Button
633-
variant="ghost"
634-
size="icon"
635-
class="h-8 w-8"
636-
title="Create new page"
637-
:disabled="cryptoError !== null"
638-
@click="handleCreateNewPage"
639-
>
640-
<FilePlus class="h-4 w-4" />
641-
</Button>
642-
<Button
643-
variant="ghost"
644-
size="icon"
645-
class="h-8 w-8"
646-
title="Swap head and body"
647-
:disabled="cryptoError !== null"
648-
@click="handleSwapHeadBody"
649-
>
650-
<ArrowUpDown class="h-4 w-4" />
651-
</Button>
652-
</template>
653-
654-
<!-- Arrow mini actions -->
655-
<template v-if="selectedArrowId">
656-
<Button
657-
variant="ghost"
658-
size="icon"
659-
class="h-8 w-8"
660-
title="Swap arrowheads"
661-
:disabled="cryptoError !== null"
662-
@click="handleSwapArrowheads"
663-
>
664-
<ArrowUpDown class="h-4 w-4" />
665-
</Button>
666-
</template>
667-
668-
<!-- Common: copy link -->
669-
<Button
670-
v-if="selectedNoteId || selectedArrowId"
671-
variant="ghost"
672-
size="icon"
673-
class="h-8 w-8"
674-
title="Copy link"
675-
@click="selectedNoteId ? handleCopyNoteLink() : handleCopyArrowLink()"
676-
>
677-
<Copy class="h-4 w-4" />
678-
</Button>
679-
</div>
680-
</template>
681-
682626
<!-- === Floating overlay === -->
683627
<template #floating-overlay>
684628
<!-- Bottom-right info -->

new-deepnotes/apps/web/src/layouts/PageLayout.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,25 +68,25 @@ describe("PageLayout", () => {
6868
expect(style).not.toContain("display: none");
6969
});
7070

71-
it("switches right sidebar to mini mode on first toggle", async () => {
71+
it("hides right sidebar on first toggle", async () => {
7272
wrapper = mount(PageLayout);
7373
const toolbar = wrapper.findComponent({ name: "MainToolbarMock" });
7474
await toolbar.vm.$emit("toggle-right");
7575
await wrapper.vm.$nextTick();
7676
const aside = wrapper.findAll("aside");
77-
const style = aside[1]!.attributes("style") ?? "";
78-
expect(style).not.toContain("display: none");
79-
expect(style).toContain("48px");
77+
expect(aside[1]!.attributes("style")).toContain("display: none");
8078
});
8179

82-
it("hides right sidebar on second toggle", async () => {
80+
it("shows right sidebar on second toggle", async () => {
8381
wrapper = mount(PageLayout);
8482
const toolbar = wrapper.findComponent({ name: "MainToolbarMock" });
8583
await toolbar.vm.$emit("toggle-right");
8684
await toolbar.vm.$emit("toggle-right");
8785
await wrapper.vm.$nextTick();
8886
const aside = wrapper.findAll("aside");
89-
expect(aside[1]!.attributes("style")).toContain("display: none");
87+
const style = aside[1]!.attributes("style") ?? "";
88+
expect(style).not.toContain("display: none");
89+
expect(style).toContain("300px");
9090
});
9191

9292
it("renders default slot in main canvas area", () => {

new-deepnotes/apps/web/src/layouts/PageLayout.vue

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,13 @@ import MainToolbar from "@/features/spatial/MainToolbar.vue";
66
// --- sidebar state ---
77
const leftExpanded = ref(true);
88
const rightExpanded = ref(true);
9-
const rightMiniMode = ref(false);
109
const leftWidth = ref(240);
1110
1211
function toggleLeft() {
1312
leftExpanded.value = !leftExpanded.value;
1413
}
1514
function toggleRight() {
16-
if (rightExpanded.value && !rightMiniMode.value) {
17-
// expanded -> mini
18-
rightMiniMode.value = true;
19-
} else if (rightExpanded.value && rightMiniMode.value) {
20-
// mini -> hidden
21-
rightExpanded.value = false;
22-
rightMiniMode.value = false;
23-
} else {
24-
// hidden -> expanded
25-
rightExpanded.value = true;
26-
rightMiniMode.value = false;
27-
}
15+
rightExpanded.value = !rightExpanded.value;
2816
}
2917
function resetLeftWidth() {
3018
leftWidth.value = 240;
@@ -34,7 +22,6 @@ function resetLeftWidth() {
3422
provide("pageLayout", {
3523
leftExpanded,
3624
rightExpanded,
37-
rightMiniMode,
3825
leftWidth,
3926
toggleLeft,
4027
toggleRight,
@@ -116,13 +103,9 @@ function onResizePointerUp(e: PointerEvent) {
116103
<aside
117104
v-show="rightExpanded"
118105
class="border-border/40 bg-muted/30 flex flex-col overflow-y-auto border-l"
119-
:class="rightMiniMode ? 'items-center' : ''"
120-
:style="{ width: rightMiniMode ? '48px' : '300px', minWidth: rightMiniMode ? '48px' : '300px' }"
106+
style="width: 300px; min-width: 300px"
121107
>
122-
<div v-if="rightMiniMode" class="flex flex-col items-center gap-1 py-2">
123-
<slot name="right-sidebar-mini" />
124-
</div>
125-
<div v-else class="p-2">
108+
<div class="p-2">
126109
<slot name="right-sidebar" />
127110
</div>
128111
</aside>

0 commit comments

Comments
 (0)