mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-26 09:23:50 +00:00
Three issues hit while editing subtasks; all fixed in one pass: - PluginAPI.log is declared on the type but never assigned in the iframe's runtime PluginAPI (see plugin-iframe.util.ts). Every PluginAPI.log.err call inside a .catch() callback then threw "Cannot read properties of undefined (reading 'err')", which surfaced as the user-visible crash on double-Enter on an empty subtask. Replace all usages with a logErr helper that calls PluginAPI.log?.err?.() and always falls back to console.error. - deleteTask rejects with "Task data not found" when a stale chip points at a task already removed in the host (sync removal, etc.). The unhandled rejection cascaded with the log bug. Add deleteTaskTolerant: skip if the task isn't in the local cache, swallow "not found" responses, log anything else. - After setParagraph() on an empty taskRef/subTaskRef, the selection remained a NodeSelection on the new paragraph. A follow-up Enter on a NodeSelection takes a different path in ProseMirror and could resolve a bad position. Chain setTextSelection(nodePos + 1) so the caret lands inside the paragraph as text. - Subtask drag now stays inside the parent's group. Adds validInsertRange(draggingPos): for a subTaskRef, returns the [parentIdx+1, groupEnd] range. computeDropTarget clamps the candidate insertion index and recomputes the indicator Y so the drop line follows the clamped target. Top-level taskRef drag is unchanged for now. |
||
|---|---|---|
| .. | ||
| scripts | ||
| src | ||
| .gitignore | ||
| package-lock.json | ||
| package.json | ||
| tsconfig.json | ||