ui tweaks

This commit is contained in:
nicwands
2026-04-01 10:06:22 -04:00
parent 555cfd4a93
commit a0a5cde33a
8 changed files with 41 additions and 19 deletions

View File

@@ -1,7 +1,5 @@
export default class IpcAdapter {
constructor() {
this._methods = ['init', 'getAll', 'create', 'update', 'delete']
}
constructor() {}
async init() {
return await window.api.adapterCall('init')

View File

@@ -65,8 +65,6 @@ export const initializeCore = async (runtime, { plugins }) => {
if (!initPromise) {
initPromise = (async () => {
const config = await configManager.loadConfig()
let encryptionKey = config?.encryptionKey
if (!encryptionKey) {

View File

@@ -12,7 +12,7 @@
<router-link class="menu-item" to="/instructions">
Instructio
</router-link>
<button class="menu-item">Import</button>
<!-- <button class="menu-item">Import</button> -->
<button class="menu-item" @click="handleExport">Export</button>
<router-link class="menu-item" to="/preferences">
Preferences

View File

@@ -5,6 +5,8 @@
<script setup>
import useOpenNote from '@/composables/useOpenNote'
import useNotes from '@/composables/useNotes'
import { useMagicKeys } from '@vueuse/core'
import { watchEffect } from 'vue'
const props = defineProps({ category: String })
const emit = defineEmits(['noteOpened'])
@@ -22,9 +24,12 @@ const onClick = async () => {
openNote(note.id)
emit('noteOpened')
}
</script>
<style lang="scss">
.new-note {
}
</style>
// Add keyboard shortcut
const { ctrl, n } = useMagicKeys()
watchEffect(() => {
if (ctrl.value && n.value) {
onClick()
}
})
</script>

View File

@@ -62,7 +62,9 @@ const onUpdate = _debounce(async ({ editor }) => {
onMounted(async () => {
const note = await loadNote(props.id)
if (note.title !== 'Untitled') {
title.value = note.title || ''
}
editor.value = new Editor({
extensions,
@@ -76,6 +78,7 @@ onMounted(async () => {
await nextTick()
if (titleInput.value) {
titleInput.value.textContent = title.value
titleInput.value.focus()
}
})
onBeforeUnmount(() => {
@@ -101,6 +104,11 @@ const onTitleChange = (e) => {
updateTitle(title.value)
}
const onTitleKeydown = (e) => {
if (e.key === 'Enter') {
e.preventDefault()
editor.value?.commands?.focus()
}
if (title.value.length >= TITLE_CHAR_LIMIT && e.key.length === 1) {
e.preventDefault()
}

View File

@@ -11,12 +11,9 @@ Tabula = Index/Overview
Program Key Commands
cmd + s = save\
cmd + t = new capitulum\
cmd + n = new nota\
cmd + x = close window\
dbl click = change name / open nota\
paste hyperlink twice = activated url
cmd + x = close window
---
@@ -25,4 +22,9 @@ Text Markdowns
cmd + b = Bold\
cmd + u = underline\
--- = ---------- (ruled line break)\
/_text_/ = Desaturated text
\# = Heading\
\> = Blockquote\
\- = Unordered List\
\1. = Ordered List\
\` = Inline Code\
\``` = Code Block

View File

@@ -18,6 +18,6 @@
@mixin p {
font-family: var(--font-mono);
font-weight: 400;
line-height: 1;
line-height: 1.4;
font-size: 12px;
}

View File

@@ -21,14 +21,17 @@
<script setup>
import useNotes from '@/composables/useNotes'
import { onMounted, ref, watch } from 'vue'
import { onMounted, ref, watch, watchEffect } from 'vue'
import CategoryRow from '@/components/CategoryRow.vue'
import NoteRow from '@/components/NoteRow.vue'
import PageLoading from '@/components/PageLoading.vue'
import NewNote from '@/components/NewNote.vue'
import { useMagicKeys } from '@vueuse/core'
import { useRouter } from 'vue-router'
const { categories, loadCategories, loadCategoryNotes, notesChangeCount } =
useNotes()
const router = useRouter()
const notes = ref()
const loaded = ref(false)
@@ -47,6 +50,14 @@ onMounted(async () => {
watch(notesChangeCount, async () => {
await refreshNotes()
})
// New category keyboard shortcut
const { ctrl, t } = useMagicKeys()
watchEffect(() => {
if (ctrl.value && t.value) {
router.push('/category')
}
})
</script>
<style lang="scss">