always set lane
This commit is contained in:
@@ -51,9 +51,9 @@
|
||||
title: "Design",
|
||||
sortOrder: 0,
|
||||
items: [
|
||||
{ id: "e-1", title: "Brand identity", start: "2026-01-02", end: "2026-01-08" },
|
||||
{ id: "e-2", title: "UI mockups", start: "2026-01-06", end: "2026-01-14" },
|
||||
{ id: "e-3", title: "Design review", start: "2026-01-20", end: "2026-01-22" },
|
||||
{ id: "e-1", title: "Brand identity", start: "2026-01-02", end: "2026-01-08", lane: 1 },
|
||||
{ id: "e-2", title: "UI mockups", start: "2026-01-06", end: "2026-01-14", lane: 2 },
|
||||
{ id: "e-3", title: "Design review", start: "2026-01-20", end: "2026-01-22", lane: 1 },
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -61,9 +61,9 @@
|
||||
title: "Engineering",
|
||||
sortOrder: 1,
|
||||
items: [
|
||||
{ id: "e-4", title: "API scaffolding", start: "2026-01-05", end: "2026-01-12" },
|
||||
{ id: "e-5", title: "Auth flow", start: "2026-01-10", end: "2026-01-18" },
|
||||
{ id: "e-6", title: "Dashboard UI", start: "2026-01-15", end: "2026-01-25" },
|
||||
{ id: "e-4", title: "API scaffolding", start: "2026-01-05", end: "2026-01-12", lane: 1 },
|
||||
{ id: "e-5", title: "Auth flow", start: "2026-01-10", end: "2026-01-18", lane: 2 },
|
||||
{ id: "e-6", title: "Dashboard UI", start: "2026-01-15", end: "2026-01-25", lane: 3 },
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -71,9 +71,9 @@
|
||||
title: "Launch",
|
||||
sortOrder: 2,
|
||||
items: [
|
||||
{ id: "e-7", title: "QA testing", start: "2026-01-19", end: "2026-01-26" },
|
||||
{ id: "e-8", title: "Beta release", start: "2026-01-24", end: "2026-01-28" },
|
||||
{ id: "e-9", title: "Marketing prep", start: "2026-01-08", end: "2026-01-15" },
|
||||
{ id: "e-7", title: "QA testing", start: "2026-01-19", end: "2026-01-26", lane: 1 },
|
||||
{ id: "e-8", title: "Beta release", start: "2026-01-24", end: "2026-01-28", lane: 2 },
|
||||
{ id: "e-9", title: "Marketing prep", start: "2026-01-08", end: "2026-01-15", lane: 1 },
|
||||
],
|
||||
},
|
||||
],
|
||||
@@ -111,15 +111,14 @@
|
||||
}
|
||||
|
||||
if (entry) {
|
||||
// Preserve duration, update start/end
|
||||
var oldStart = new Date(entry.start);
|
||||
var oldEnd = new Date(entry.end);
|
||||
var duration = oldEnd - oldStart;
|
||||
var newStart = new Date(p.newStart);
|
||||
var newEnd = new Date(newStart.getTime() + duration);
|
||||
// Update start/end from payload (ISO 8601 → date-only)
|
||||
entry.start = new Date(p.newStart).toISOString().split("T")[0];
|
||||
entry.end = p.newEnd
|
||||
? new Date(p.newEnd).toISOString().split("T")[0]
|
||||
: new Date(new Date(p.newStart).getTime() + (new Date(entry.end) - new Date(entry.start))).toISOString().split("T")[0];
|
||||
|
||||
entry.start = newStart.toISOString().split("T")[0];
|
||||
entry.end = newEnd.toISOString().split("T")[0];
|
||||
// Preserve the lane from the drop target
|
||||
entry.lane = p.newLane;
|
||||
|
||||
// Add to target group
|
||||
var targetGroup = state.timeline.groups.find(
|
||||
@@ -129,6 +128,10 @@
|
||||
targetGroup.items.push(entry);
|
||||
}
|
||||
|
||||
// Push updated state back to Flutter
|
||||
if (_updateState) {
|
||||
_updateState(JSON.stringify(state));
|
||||
}
|
||||
}
|
||||
} else if (event.type === "content_height") {
|
||||
console.log("[z-timeline dev] content_height:", event.payload.height);
|
||||
|
||||
Reference in New Issue
Block a user