{{ error }}
+ { diff --git a/web/src/components/ObjBrowser.vue b/web/src/components/ObjBrowser.vue new file mode 100644 index 0000000..3097108 --- /dev/null +++ b/web/src/components/ObjBrowser.vue @@ -0,0 +1,348 @@ + + + + + diff --git a/web/src/components/Sidebar.vue b/web/src/components/Sidebar.vue index 4178057..93339e6 100644 --- a/web/src/components/Sidebar.vue +++ b/web/src/components/Sidebar.vue @@ -2,12 +2,14 @@ import { ref } from 'vue' import type { Project, KbArticleSummary } from '../types' -defineProps<{ +const props = defineProps<{ projects: Project[] selectedId: string kbMode: boolean + objMode: boolean kbArticles: KbArticleSummary[] selectedArticleId: string + appTitle?: string }>() const emit = defineEmits<{ @@ -16,12 +18,30 @@ const emit = defineEmits<{ delete: [id: string] openKb: [] closeKb: [] + openObj: [] + closeObj: [] selectArticle: [id: string] createArticle: [] deleteArticle: [id: string] + updateAppTitle: [title: string] }>() const showSettings = ref(false) +const editingTitle = ref(false) +const titleInput = ref('') + +function onEditTitle() { + titleInput.value = props.appTitle || 'Tori' + editingTitle.value = true +} + +function onSaveTitle() { + const val = titleInput.value.trim() + if (val && val !== props.appTitle) { + emit('updateAppTitle', val) + } + editingTitle.value = false +} function onDelete(e: Event, id: string) { e.stopPropagation() @@ -41,12 +61,25 @@ function onOpenKb() { showSettings.value = false emit('openKb') } + +function onOpenObj() { + showSettings.value = false + emit('openObj') +}