fix(tasks): live updates only add real tasks, not fresh Quick Dump notes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
sandrodachandClaude Opus 5.5 committed 2026-10-31 09:39:50 +01:00
1 parent 2303ccce68
commit 052c7f2fbc
4 files changed
+21 -16

No files matched your search

+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "mindsift-frontend",
"version": "0.15.1",
"version": "0.15.2",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "mindsift-frontend",
"version": "0.15.1",
"version": "0.15.2",
"license": "Unlicense",
"dependencies": {
"@fontsource-variable/inter": "5.3.0",
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "mindsift-frontend",
"private": true,
"version": "0.15.1",
"version": "0.15.2",
"license": "Unlicense",
"type": "module",
"scripts": {
+11 -12
View File
@@ -48,6 +48,10 @@ const stopOnControl = (e: React.MouseEvent) => {
if ((e.target as HTMLElement).closest('button, select, a, input')) e.stopPropagation();
};
// Same rule as the server's task query: a fresh Quick Dump note (status inbox) is no task yet
const isTaskThought = (t: Thought) =>
t.status === 'kept' || (t.status === 'converted' && t.convertedType === 'task');
interface TasksViewProps {
currentUser?: User | null;
onRefreshStats: () => void;
@@ -186,13 +190,7 @@ export const TasksView: React.FC<TasksViewProps> = ({
if (msg.event === 'TASK_CREATED') {
const created = msg.payload as Thought;
if (
created &&
(created.status === 'converted' ||
created.kanbanStatus ||
created.taskListId ||
created.isCompleted !== undefined)
) {
if (created && isTaskThought(created)) {
setTasks((prev) => {
if (prev.some((t) => t.id === created.id)) return prev;
if (selectedListIdRef.current !== 'all' && created.taskListId !== selectedListIdRef.current) return prev;
@@ -207,17 +205,18 @@ export const TasksView: React.FC<TasksViewProps> = ({
const exists = prev.some((t) => t.id === updated.id);
if (!exists) {
if (
(updated.status === 'converted' ||
updated.kanbanStatus ||
updated.taskListId ||
updated.isCompleted !== undefined) &&
isTaskThought(updated) &&
(selectedListIdRef.current === 'all' || updated.taskListId === selectedListIdRef.current)
) {
return [updated, ...prev];
}
return prev;
}
if (selectedListIdRef.current !== 'all' && updated.taskListId !== selectedListIdRef.current) {
// Undone back into the Quick Dump, discarded, or moved to another list
if (
!isTaskThought(updated) ||
(selectedListIdRef.current !== 'all' && updated.taskListId !== selectedListIdRef.current)
) {
return prev.filter((t) => t.id !== updated.id);
}
return prev.map((t) => (t.id === updated.id ? updated : t));