fixes: scratchpad, zen ESC, chat time, tooltip safety, collab sync race
- Scratchpad: card-scoped private notes in editor (toggle vs preview), smaller font, cleared via button, stored in cards.scratchpad - Zen mode: ESC exits zen before closing detail, Z toggles zen - Chat: always show absolute time (hh:mm, yesterday, or date+time) - Backspace/Delete also deletes focused card (not just selected) - Selected + focused cards use brand accent (not accent2) - Tooltip: guard against non-element targets - Collab sync: skip poll while editor is open, 2s push debounce - Rrule test: only check geburtstag tag, not title format Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
2169c1de1b
commit
7e2b130434
11 files changed
+92
-30
No files matched your search
+36
-14
@@ -189,12 +189,8 @@ export function openModal(card = null) {
|
||||
selectColor(card ? card.color : '#38bdf8');
|
||||
setDueDate(card?.due_date || '');
|
||||
updateDoneToggle();
|
||||
state.previewVisible = true;
|
||||
preview.classList.remove('hidden');
|
||||
editorDivider?.classList.remove('hidden');
|
||||
$('toggle-preview').classList.add('text-t-accent');
|
||||
applyEditorSplit();
|
||||
updatePreview();
|
||||
if (scratchpadBody) scratchpadBody.value = card?.scratchpad || '';
|
||||
showSidePanel('preview');
|
||||
modal.classList.add('open');
|
||||
if (linesVisible) updateGutter();
|
||||
currentLine = -1;
|
||||
@@ -396,7 +392,8 @@ function updatePreview() {
|
||||
}
|
||||
|
||||
async function doSave(close, { animate = true } = {}) {
|
||||
const data = { title: inpTitle.value, body: body.value, color: inpColor.value, bucket_id: inpBucket.value || null, due_date: inpDueValue?.value || null };
|
||||
const scratch = scratchpadBody?.value || null;
|
||||
const data = { title: inpTitle.value, body: body.value, color: inpColor.value, bucket_id: inpBucket.value || null, due_date: inpDueValue?.value || null, scratchpad: scratch };
|
||||
if (!data.title.trim()) return;
|
||||
const returnToGallery = state.returnToGalleryAfterEdit;
|
||||
if (state.editingId) {
|
||||
@@ -536,18 +533,43 @@ function applyEditorSplit() {
|
||||
preview.style.flex = `${100 - editorSplit} 1 0`;
|
||||
}
|
||||
|
||||
$('toggle-preview')?.addEventListener('click', () => {
|
||||
state.previewVisible = !state.previewVisible;
|
||||
preview.classList.toggle('hidden', !state.previewVisible);
|
||||
editorDivider?.classList.toggle('hidden', !state.previewVisible);
|
||||
$('toggle-preview').classList.toggle('text-t-accent', state.previewVisible);
|
||||
if (state.previewVisible) {
|
||||
const scratchpadPanel = $('editor-scratchpad');
|
||||
const scratchpadBody = $('scratchpad-body');
|
||||
|
||||
function showSidePanel(which) {
|
||||
const showPreview = which === 'preview';
|
||||
const showScratch = which === 'scratchpad';
|
||||
|
||||
state.previewVisible = showPreview;
|
||||
preview.classList.toggle('hidden', !showPreview);
|
||||
scratchpadPanel?.classList.toggle('hidden', !showScratch);
|
||||
editorDivider?.classList.toggle('hidden', !showPreview && !showScratch);
|
||||
$('toggle-preview')?.classList.toggle('text-t-accent', showPreview);
|
||||
$('toggle-scratchpad')?.classList.toggle('text-t-accent', showScratch);
|
||||
|
||||
if (showPreview || showScratch) {
|
||||
applyEditorSplit();
|
||||
if (showScratch) scratchpadPanel.style.flex = preview.style.flex || '1 1 0%';
|
||||
} else {
|
||||
if (editorPane) editorPane.style.flex = '1 1 0%';
|
||||
preview.style.flex = '';
|
||||
if (scratchpadPanel) scratchpadPanel.style.flex = '';
|
||||
}
|
||||
updatePreview();
|
||||
if (showPreview) updatePreview();
|
||||
}
|
||||
|
||||
$('toggle-preview')?.addEventListener('click', () => {
|
||||
showSidePanel(state.previewVisible ? null : 'preview');
|
||||
});
|
||||
|
||||
$('toggle-scratchpad')?.addEventListener('click', () => {
|
||||
const isOpen = !scratchpadPanel?.classList.contains('hidden');
|
||||
showSidePanel(isOpen ? null : 'scratchpad');
|
||||
if (!isOpen) scratchpadBody?.focus();
|
||||
});
|
||||
|
||||
$('scratchpad-clear')?.addEventListener('click', () => {
|
||||
if (scratchpadBody) scratchpadBody.value = '';
|
||||
});
|
||||
|
||||
if (editorDivider) {
|
||||
|
||||
@@ -71,14 +71,16 @@ function hide() {
|
||||
}
|
||||
|
||||
function onEnter(e) {
|
||||
const target = e.target.closest('[data-tip],[data-help]');
|
||||
const el = e.target?.nodeType === 1 ? e.target : e.target?.parentElement;
|
||||
const target = el?.closest?.('[data-tip],[data-help]');
|
||||
if (!target) return;
|
||||
clearTimeout(hideTimer);
|
||||
showTimer = setTimeout(() => show(target), SHOW_DELAY);
|
||||
}
|
||||
|
||||
function onLeave(e) {
|
||||
const target = e.target.closest('[data-tip],[data-help]');
|
||||
const el = e.target?.nodeType === 1 ? e.target : e.target?.parentElement;
|
||||
const target = el?.closest?.('[data-tip],[data-help]');
|
||||
if (!target) return;
|
||||
clearTimeout(showTimer);
|
||||
hideTimer = setTimeout(hide, HIDE_DELAY);
|
||||
|
||||
Reference in new issue
Block a user