fix: Bookmarklet improvements and header layout fixes

- Fix bookmarklet URL to use absolute path with window.location.origin
- Change capture prefix from 'rec:' to 'web:' for web captures
- Add BookmarkletInstructions to header and preferences panel
- Redesign QuickAdd as dropdown popup (no header overflow)
- Move capture button and work mode to mobile menu
- Fix isOpen bug in BookmarkletInstructions dialog
This commit is contained in:
2026-03-23 00:03:45 -03:00
parent 33a4705f95
commit 0a96638681
7 changed files with 186 additions and 122 deletions

View File

@@ -51,12 +51,16 @@ export function encodeCapturePayload(payload: CapturePayload): string {
}
export function generateBookmarklet(): string {
// Get the current origin (where the app is running)
const origin = typeof window !== 'undefined' ? window.location.origin : ''
const code = `
var title = document.title;
var url = location.href;
var selection = window.getSelection().toString();
var params = new URLSearchParams({title, url, selection});
window.open('/capture?' + params.toString(), '_blank');
var base = ${JSON.stringify(origin)};
window.open(base + '/capture?' + params.toString(), '_blank');
`.replace(/\s+/g, ' ').trim()
return `javascript:${code}`
}

View File

@@ -13,6 +13,7 @@ const TYPE_PREFIXES: Record<string, NoteType> = {
'rec:': 'recipe',
'proc:': 'procedure',
'inv:': 'inventory',
'web:': 'note',
}
const TAG_REGEX = /#([a-z0-9]+)/g