From d33a6fe68840839c5010c0f50a55432167a13845 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 18 Jun 2026 17:35:23 +0000 Subject: [PATCH 1/2] Reveal newly added tasks in the detail sheet and gantt After addChild(), scroll the task detail modal to the bottom so the new row is in view instead of off-screen below a preserved scroll position. Also expand the parent task on the gantt when adding a subtask, scroll the new bar into view, and default the due date to today when the today's-focus filter is active so the bar is not hidden. Co-authored-by: Tanops --- src/app/main.js | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/src/app/main.js b/src/app/main.js index c4a0425..605aaae 100644 --- a/src/app/main.js +++ b/src/app/main.js @@ -902,11 +902,15 @@ function addChild(id){ if(!path||path.length>=3) return; snap(); const n=path[path.length-1]; - const taskDue=n.due||dayIso(LEAD.m); - n.children.push(T(cap1(v),n.owner,{d:taskDue,s:"m"})); + let taskDue=n.due||dayIso(LEAD.m); + if(focusToday&&dayN(taskDue)>0) taskDue=dayIso(0); // stay visible when today's-focus filter is on + const child=T(cap1(v),n.owner,{d:taskDue,s:"m"}); + n.children.push(child); n.open=true; + if(path.length>1&&!subOpen(id)){ if(subsAll) COL.delete(id); else EXP.add(id); } // show new subtask rows on the gantt renderAll(); - openDetail(id); + openDetail(id,{reveal:"bottom"}); + revealGanttTask(child.id); } function addProject(){ snap(); @@ -918,7 +922,24 @@ function addProject(){ if(ti){ ti.focus(); ti.select(); } } let DETAIL_ID=null; -function openDetail(id){ +function revealDetailScroll(box,reveal){ + if(!box||!reveal) return; + const apply=()=>{ box.scrollTop=reveal==="bottom"?box.scrollHeight:reveal; }; + apply(); + if(typeof requestAnimationFrame!=="undefined") + requestAnimationFrame(()=>{ apply(); requestAnimationFrame(apply); }); +} +function revealGanttTask(id){ + const run=()=>{ + const bar=document.querySelector(`#gantt .gbar[data-tid="${id}"]`); + if(bar){ bar.scrollIntoView({block:"nearest"}); return; } + const path=findPath(id); + if(path?.[0]) document.querySelector(`.pgroup[data-pid="${path[0].id}"]`)?.scrollIntoView({block:"nearest"}); + }; + if(typeof requestAnimationFrame!=="undefined") requestAnimationFrame(()=>requestAnimationFrame(run)); + else run(); +} +function openDetail(id,opts){ const path=findPath(id); if(!path){ if(DETAIL_ID===id) closeSheet(); DETAIL_ID=null; return; } const box=document.querySelector(".tbox"); @@ -970,7 +991,8 @@ function openDetail(id){ `; document.getElementById("tmodal").classList.add("show"); document.getElementById("scrim").classList.add("show"); - restoreDetailScroll(box,savedScroll); + if(opts?.reveal) revealDetailScroll(box,opts.reveal); + else restoreDetailScroll(box,savedScroll); } function closeSheet(){ DETAIL_ID=null; document.getElementById("tmodal").classList.remove("show"); From 60c0482c6ede596073ab8f7c6a9765d35ebd5d75 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Fri, 19 Jun 2026 09:29:12 +0000 Subject: [PATCH 2/2] Document rebase of PR #10 branch onto main Co-authored-by: Sanket Sharma --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e7c35b9..1f11881 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## Rebase PR #10 onto main (2026-06-19) + +### Fixed +- Rebased `cursor/fix-new-task-display-0037` onto `main` (replacing the merge commit) so GitHub can update the branch cleanly. +- Kept both `revealDetailScroll` on add and `restoreDetailScroll` on same-task reopen in `openDetail`. + ## Fix manual task add button (2026-06-17) ### Fixed