feat(plugin-gantt): ownership-aware reschedule + confirm-first auto-schedule, export fixes, business time zone#2683
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
Contributor
Author
|
Added commit 6de32ed — |
… confirms first computeProjectReschedule skipped EVERY parent task as a derived rollup, so under summaryExtent 'self' a plan that had children was silently immune to auto-schedule and to the post-drag conflict cascade — the scheduling twin of the summary-editability gap fixed earlier in this branch. - scheduling: computeProjectRescheduleDetailed with RescheduleOptions. summaryExtent 'self' lets an own-dates, unlocked summary shift like a task and carries its unlocked subtree by the same delta (group-drag semantics; a descendant pushed further by its own links keeps the later position — 顺延-only max rule). Locked tasks that violate a link are reported in skippedLocked instead of moving. snapStart hook snaps pushed starts onto a grid. Back-compat wrapper keeps the old signature/behavior. - GanttView: both cascade paths (toolbar wand + conflict dialog) share the new semantics, with pushed starts snapping to shift-band boundaries (班次边界) when shiftSegments are configured. - Toolbar auto-schedule now CONFIRMS before the bulk write — compute, show "shift N task(s)? (M locked skipped)", apply on confirm only; a clean graph shows a transient "nothing to reschedule" notice. Mirrors the conflict dialog's existing interaction contract; i18n en/zh. Verified live on the 4-level 排班计划 tree: wand → dialog "将顺延 4 个任务" → cancel leaves the DB untouched → confirm pushes the child-bearing plan +10d (start snapped to a band boundary, duration kept), cascades its successor, and leaves both locked dispatch children and the predecessor exactly in place. Suite: 335 tests green (12 new). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…mped filenames PNG/PDF export drew a rollup bar for EVERY parent row, including pure grouping levels (type 'group' — 项目/产品) that the live chart renders bar-less: the exported image showed phantom full-span bars on those rows (导出内容异常). The export row loop now mirrors the live renderer's group branch and draws nothing for them. Filenames were an opaque `gantt-week.png`. Exports are now `<base>-<yyyyMMdd-HHmm>.<ext>` — base from the new `gantt.exportFileName` view config (the host strips `label` off the schema it hands the component, so views declare their display name explicitly), falling back to the object schema label, then the object API name; the timestamp keeps repeated exports from overwriting each other. Verified live: exported PNG shows group rows bar-less with plan bars, links, dispatch bars and the today line intact; filename renders as 排班计划甘特图-20260719-0642.png. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The exported PNG/PDF rendered summary and leaf bars as bare color blocks — the live chart shows the task title inside every bar (bar_label: 计划名 on summaries, executor name on dispatch leaves), so exports lost that context. The export loop now draws the title inside summary and leaf bars, ellipsis- truncated to the bar width via a per-char width estimate (CJK ≈ 9px, latin ≈ 5.5px at font-size 9); narrow leaf bars fall back to the progress number when even a truncated title can't fit. Verified live: exported image shows 甘特计划A 组焊 / 甘特计划B 涂装 in their bars, with narrow bars truncating to 甘特… / Dev… — matching the on-screen rendering. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…eZone The chart rendered ALL calendar math — shift bands, day columns, drag snapping, the today line, start/end labels — in the VIEWER's browser zone. A viewer whose machine isn't in the business zone saw every band and date shifted (班次错位: a plan starting 7/20 08:00 Beijing displayed as 7/19 evening in a UTC-7 browser) and could drag bars onto misaligned instants. New `gantt.timeZone` (IANA name, e.g. 'Asia/Shanghai') renders the configured zone's wall time for every viewer via a "shifted clock" shim: incoming dates translate into a display space where the browser clock reads the business zone's wall time — all existing local-clock logic becomes zone-correct unchanged — and emitted date changes translate back, so persisted data stays real instants. Per-instant offsets keep DST zones correct; invalid names warn and fall back to the browser zone; omitting the config keeps today's behavior. Verified live in a UTC-7 browser with timeZone 'Asia/Shanghai': task-list dates read Beijing dates, plan bar left edge aligns pixel-exact with the 7/20 白班 band start, and dragging +1 band persists 7/20 20:00 → 7/24 08:00 Beijing (exact band boundary, duration kept). Suite: 340 green (5 new tz-shift tests incl. DST round-trips). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Delivers #2682 — the follow-up batch to #2677. These four commits were originally pushed to the #2677 branch after it was squash-merged, so they never reached main; cherry-picked clean onto main here. Each was verified live on the 4-level 排班计划 tree; suite 340 green (17 new tests across the batch).
eacde79 — reschedule follows date ownership + auto-schedule confirms first
computeProjectRescheduleDetailed: undersummaryExtent: 'self', an own-dates unlocked summary shifts like a task and carries its unlocked subtree by the same delta (group-drag semantics; descendants pushed further by their own links keep the later position — 顺延-only max rule). Locked violators are reported inskippedLockedinstead of moving.snapStarthook snaps pushed starts onto shift-band boundaries. Back-compat wrapper keeps the old signature.2f2334c — export skips group rows + business-context timestamped filenames
PNG/PDF export drew phantom rollup bars on pure grouping rows (type 'group') the live chart renders bar-less. Filenames upgrade from
gantt-week.pngto<base>-<yyyyMMdd-HHmm>.<ext>with base from the newgantt.exportFileNameview config (host schemas reach the component stripped oflabel), falling back to object label → API name.42718da — export draws in-bar titles (条上标题)
Summary bars show the plan title, leaf bars the executor label, ellipsis-truncated to bar width (CJK-aware per-char estimate); narrow leaf bars fall back to the progress number. Live: 甘特计划A 组焊 / 甘特计划B 涂装 in-bar, narrow bars truncate to 甘特… / Dev….
423ce17 — business time zone rendering via
gantt.timeZoneThe chart rendered all calendar math in the VIEWER's browser zone — bands and dates misalign for viewers outside the business zone. New IANA
gantt.timeZonerenders the configured zone's wall time for every viewer via a shifted-clock shim; emitted date changes translate back so persisted data stays real instants; DST-safe per-instant offsets; invalid names warn and fall back; omitted = unchanged behavior. Live from a UTC-7 browser against Asia/Shanghai: task-list dates read Beijing, bar left edge aligns pixel-exact with the 7/20 白班 band start, and a +1-band drag persists 7/20 20:00 → 7/24 08:00 Beijing exactly.Refs #2682, #2676
🤖 Generated with Claude Code