Skip to content

πŸ“š The open-source, offline-first Notion, Obsidian & Confluence alternative. Advanced Markdown, multi-tenant teams, OIDC/SSO, and local S3 backups. Deploy in one command.

Fix dock & sidebar

Smaug6739ee4733ae5940
diff --git a/frontend/components/Sidebar/Dock.vue b/frontend/components/Sidebar/Dock.vue
index 9c4ff1e0..69aa5135 100644
--- a/frontend/components/Sidebar/Dock.vue
+++ b/frontend/components/Sidebar/Dock.vue
@@ -28,7 +28,7 @@
display: flex;
flex-direction: column;
gap: 0.5rem;
- padding: 1.2rem 0.3rem;
+ padding: 0.8rem 0.3rem;
border-right: 1px solid var(--border-color);
}
a {
@@ -52,7 +52,6 @@ a.router-link-exact-active {
<script setup lang="ts">
function closeDock() {
- useSidebar().isDockOpened.value = false;
usePreferencesStore().set({ key: 'hideDock', value: false });
}
</script>
diff --git a/frontend/components/Sidebar/Sidebar.vue b/frontend/components/Sidebar/Sidebar.vue
index 5bc4dbb5..b60c1a6c 100644
--- a/frontend/components/Sidebar/Sidebar.vue
+++ b/frontend/components/Sidebar/Sidebar.vue
@@ -1,7 +1,7 @@
<template>
<div :class="{ 'sidebar-mask': isMobile() && isOpened }"></div>
<Resizable>
- <Dock v-if="!isMobile() && isDockOpened" />
+ <Dock v-if="!isMobile() && preferences.get('hideDock')" />
<div class="sidebar" :class="{ compact: preferences.get('compactMode') }">
<section class="header">
<span class="name">
@@ -43,7 +43,7 @@ import { navigationItems } from './helpers';
import NewCategoryModal from '../../pages/dashboard/categories/_modals/CreateCategoryModal.vue';
import Dock from './Dock.vue';
-const { isOpened, hasSidebar, isDockOpened } = useSidebar();
+const { isOpened, hasSidebar } = useSidebar();
const categoriesStore = useCategoriesStore();
const preferences = usePreferencesStore();
const userStore = useUserStore();
@@ -100,8 +100,6 @@ const onClick = () => {
onMounted(() => {
hasSidebar.value = true;
- isDockOpened.value = preferences.get('hideDock');
- console.log(isDockOpened.value);
if (isMobile()) return document.addEventListener('click', handleClickOutside);
// ELSE: Desktop
isOpened.value = true;
diff --git a/frontend/composables/Sidebar.ts b/frontend/composables/Sidebar.ts
index 3547306f..1f920648 100644
--- a/frontend/composables/Sidebar.ts
+++ b/frontend/composables/Sidebar.ts
@@ -1,7 +1,6 @@
const isOpened = ref(false);
-const isDockOpened = ref(true);
const hasSidebar = ref(false);
-const paneWidth = ref(isMobile() || !isDockOpened ? 350 : 380); // initial width of pane 1
+const paneWidth = ref(370); // initial width of pane 1
const isResizing = ref(false);
const workspaceId = ref<string | null>(null);
@@ -15,6 +14,5 @@ export function useSidebar() {
paneWidth,
isResizing,
workspaceId,
- isDockOpened,
};
}
diff --git a/frontend/helpers/icons.ts b/frontend/helpers/icons.ts
index 7cd0e3fc..144264cc 100644
--- a/frontend/helpers/icons.ts
+++ b/frontend/helpers/icons.ts
@@ -9,7 +9,7 @@ const icons = {
close: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"stroke-linecap="round" stroke-linejoin="round" class="h-4 w-4"><path d="M18 6 6 18"></path><path d="m6 6 12 12"></path></svg>`,
collapse: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="m480-500 160-160H320l160 160Zm280-340q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560ZM200-320v120h560v-120H200Zm560-80v-360H200v360h560Zm-560 80v120-120Z"/></svg>`,
copy: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="var(--font-color)"><path d="M360-240q-33 0-56.5-23.5T280-320v-480q0-33 23.5-56.5T360-880h360q33 0 56.5 23.5T800-800v480q0 33-23.5 56.5T720-240H360Zm0-80h360v-480H360v480ZM200-80q-33 0-56.5-23.5T120-160v-560h80v560h440v80H200Zm160-240v-480 480Z"/></svg>`,
- dashboard: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M240-200h120v-240h240v240h120v-360L480-740 240-560v360Zm-80 80v-480l320-240 320 240v480H520v-240h-80v240H160Zm320-350Z"/></svg>`,
+ dashboard: `<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#1f1f1f"><path d="M400-80q-33 0-56.5-23.5T320-160v-160H160q-33 0-56.5-23.5T80-400v-400q0-33 23.5-56.5T160-880h400q33 0 56.5 23.5T640-800v160h160q33 0 56.5 23.5T880-560v400q0 33-23.5 56.5T800-80H400Zm0-80h400v-400H560v-240H160v400h240v240Zm80-320Z"/></svg>`,
delete: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="var(--font-color)"><path d="M280-120q-33 0-56.5-23.5T200-200v-520h-40v-80h200v-40h240v40h200v80h-40v520q0 33-23.5 56.5T680-120H280Zm400-600H280v520h400v-520ZM360-280h80v-360h-80v360Zm160 0h80v-360h-80v360ZM280-720v520-520Z" /></svg>`,
draft: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path style="fill:var(--teal)" d="M240-80q-33 0-56.5-23.5T160-160v-640q0-33 23.5-56.5T240-880h320l240 240v480q0 33-23.5 56.5T720-80H240Zm280-520v-200H240v640h480v-440H520ZM240-800v200-200 640-640Z"/></svg>`,
edit: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="var(--font-color)"><path d="M200-200h57l391-391-57-57-391 391v57Zm-80 80v-170l528-527q12-11 26.5-17t30.5-6q16 0 31 6t26 18l55 56q12 11 17.5 26t5.5 30q0 16-5.5 30.5T817-647L290-120H120Zm640-584-56-56 56 56Zm-141 85-28-29 57 57-29-28Z"/></svg>`,