fix(tasks): a task opened by a link does not open again on every return to the tab
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 1m40s
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 1m40s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
687389df64
commit
2bb0dec744
6 files changed
+19
-5
No files matched your search
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "mindsift-frontend",
|
||||
"version": "0.49.0",
|
||||
"version": "0.49.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "mindsift-frontend",
|
||||
"version": "0.49.0",
|
||||
"version": "0.49.1",
|
||||
"license": "AGPL-3.0-only",
|
||||
"dependencies": {
|
||||
"@fontsource-variable/inter": "5.3.0",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "mindsift-frontend",
|
||||
"private": true,
|
||||
"version": "0.49.0",
|
||||
"version": "0.49.1",
|
||||
"license": "AGPL-3.0-only",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
||||
@@ -1297,6 +1297,7 @@ export const App: React.FC = () => {
|
||||
onOpenDocument={handleOpenDocument}
|
||||
refreshTrigger={refreshRevision}
|
||||
initialSelectedTaskId={selectedTaskId}
|
||||
onInitialTaskShown={() => setSelectedTaskId(null)}
|
||||
openTasksCount={stats.tasksOpenCount}
|
||||
/>
|
||||
)}
|
||||
|
||||
@@ -65,6 +65,9 @@ interface TasksViewProps {
|
||||
onOpenDocument: (docId: string, blockId?: string) => void;
|
||||
refreshTrigger?: number;
|
||||
initialSelectedTaskId?: string | null;
|
||||
// The task from initialSelectedTaskId was opened; the parent forgets it, so returning to the tab does
|
||||
// not open it again
|
||||
onInitialTaskShown?: () => void;
|
||||
openTasksCount?: number; // all open tasks incl. shared lists (same as the nav bar counter)
|
||||
}
|
||||
|
||||
@@ -94,6 +97,7 @@ export const TasksView: React.FC<TasksViewProps> = ({
|
||||
onOpenDocument,
|
||||
refreshTrigger = 0,
|
||||
initialSelectedTaskId,
|
||||
onInitialTaskShown,
|
||||
openTasksCount,
|
||||
}) => {
|
||||
// Open list and view survive switching to other tabs (like the workspace's open note)
|
||||
@@ -177,11 +181,14 @@ export const TasksView: React.FC<TasksViewProps> = ({
|
||||
const [showDetailModal, setShowDetailModal] = useState(false);
|
||||
const [extraTask, setExtraTask] = useState<Thought | null>(null);
|
||||
|
||||
const onInitialTaskShownRef = useRef(onInitialTaskShown);
|
||||
onInitialTaskShownRef.current = onInitialTaskShown;
|
||||
useEffect(() => {
|
||||
if (initialSelectedTaskId) {
|
||||
setDetailTaskId(initialSelectedTaskId);
|
||||
setShowDetailModal(true);
|
||||
setFilter('open');
|
||||
onInitialTaskShownRef.current?.();
|
||||
api.getThought(initialSelectedTaskId).then((th) => {
|
||||
if (th) setExtraTask(th);
|
||||
}).catch(() => {});
|
||||
|
||||
Reference in new issue
Block a user