feat(plugin-gantt): drag-to-link endpoints, resizable name column, handle ergonomics & view-switch anchoring#1870
Merged
Merged
Conversation
Two metadata-driven knobs for the 项目→产品→排产计划→派工单 tree (no hardcoded business logic): - defaultCollapsedDepth (默认折叠): GanttView seeds collapsedIds once from a 0-indexed depth threshold, folding every node at/below it that has children. ObjectGantt forwards schema.defaultCollapsedDepth. - locked (仅查看/跳转): per-node view-only flag. A locked bar can't be dragged/resized, its progress can't be dragged, no dependency dot, and its inline-edit / context-menu edit+delete are hidden — clicking (open/jump) still works. ObjectGantt maps schema.lockField truthiness onto task.locked. Demo: ?mfg=1 locks every 派工单 and collapses 排产计划 (depth 2) by default. +5 tests (group/depth/lock in GanttView, lockField+depth wiring in ObjectGantt).
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
… flush to row edge
- Flash now starts on scrollend (the smooth-scroll-finished signal) rather
than ~40ms after the click, so the pulse fires where the bar lands instead
of mid-flight. Falls back to a short fixed delay when scrollend is
unsupported; a 1.5s backstop guards the supported path. Pending waits are
torn down on re-trigger and unmount via flashCleanupRef.
- Locate icon moved out of the right-aligned End-date flow into a row-pinned
absolute slot flush with the chart divider, so it no longer reads as inset
('偏左') and no longer shifts the date column on hover.
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
… date - Locate now scrolls to the bar's start (with a small left margin) instead of centering its midpoint, so a long bar's beginning stays visible rather than scrolling off the left edge. Bars that fit the viewport still center. - Fix the locate icon falling back to the row's left edge: Tailwind's fractional right-0.5 isn't in the prebuilt CSS, so the right offset is now an inline style (right:1px), keeping the icon flush at the divider with a small gap from the date column.
Blink the located bar 3× with a 3px outline ring plus a colored drop-shadow glow (up to ~9px) instead of a single thin 2px outline-color fade. The glow is a filter (not box-shadow) so it stays clear of the critical-path bars' inline box-shadow. Bump the flash duration to 1.5s and sync the clear timer.
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
Leaf task bars previously rendered no label — only summary bars showed their title, so a wide leaf bar (e.g. a 派工单 work order) looked blank. Render the title inside leaf bars like summary bars; the progress%/drag-date readout now overlays it on hover so the bar's text width never shifts. Adds a tree test.
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
… don't leak raw keys useGanttTranslation probed a single key (gantt.column.taskName) and, if the host i18n resolved it, trusted the host's t() for *every* key. A consuming app whose dictionary translates the common gantt keys but lags on newer ones (e.g. gantt.linkType.*, gantt.menu.removeDependency) then leaked raw keys, since i18next returns the key string on a miss. Resolve each key against the host first and fall back to the bundled default only when the host returns the key unchanged.
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
…croller The left task list was overflow-hidden and only mirrored the timeline's scrollTop, so vertical scrolling was possible only over the right (timeline) pane. With large datasets users expect to scroll the task list directly. Make the list overflow-y-auto and sync two-way: list scroll pushes scrollTop onto the timeline (which drives the shared virtualization window and mirrors back). Both sync paths assign scrollTop only when it differs, so the browser emits no further scroll event and the loop self-terminates.
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
…k'/'This month' The jump-to-today control was a CalendarDays icon while the sibling period-jump controls were text buttons, so the toolbar group read inconsistently. Render it as a text button (gantt.toolbar.today) with the same sizing as its siblings; drop the now-unused CalendarDays import.
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
…anularity Switching Day/Week/Month/Year kept the scroll container's raw pixel scrollLeft, but a Day->Month switch shrinks the timeline ~5x, so that offset landed on a wildly different (usually edge-clamped) date — the jumpy, disorienting behaviour users described as '乱'. Capture the date at the viewport centre via xToDate before the switch, then re-centre on it in a useLayoutEffect once the new dateToX mapping and total width are measured (pre-paint, so no flash). The anchor ref is null for any other dateToX change (zoom, fold, edits), leaving those paths untouched.
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
Flesh out the ?mfg=1 fixture to mirror the 3.4 制造排班 spec: status-based bar colors for 排产计划 (待开始/已下推/进行中/已完成) and 派工单 (待开始/进行中/已报工/已完成), ◆-prefixed milestone rows, planned-vs-actual baselines on 派工单, hover-detail `fields`, FS dependencies between 三级 排产计划 only, and a status-color legend (ManufacturingLegend).
…meline scrollbar View-switch anchoring: switching granularity now preserves the precise day at the viewport's left edge, so Day(Apr 9)→Week→Month→Day round-trips back to Apr 9 instead of drifting to the timeline start. The precise intent is held in a persistent ref updated only by genuine user scrolling; coarser views snap their *display* to the containing week/month bucket but never overwrite the anchor. A gate, armed on each switch and cleared only by real user input (wheel / touch / pointer / scroll keys), blocks the browser's auto-clamp scroll — fired when a narrower layout shrinks scrollWidth — from poisoning the anchor (the bug that sent Month→Day to Dec 29). Scrollbar: macOS overlay scrollbars collapse to 0px and auto-hide, making the timeline's vertical scrollbar nearly impossible to find, and thousands of virtualized rows shrank the thumb to a sliver. Style ::-webkit-scrollbar into a persistent 14px bar with a floored thumb size, and hide the redundant (synced) task-list scrollbar. Standard scrollbar-width is scoped to @supports not selector(::-webkit-scrollbar) so modern Chrome doesn't ignore the pseudo and fall back to the overlay bar.
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
…ing FS/FF/SS/SF
dhtmlx-style dependency creation. Each leaf bar now exposes a connector
dot at BOTH ends (start + finish). The link type is derived from which
endpoint you drag FROM and which half of the target bar you drop ONTO:
end→start=FS, end→end=FF, start→start=SS, start→end=SF. A draft hint
('Task A (end) → Task B (end)') names the endpoints during the drag so
the resulting link type is obvious before release.
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
The task-list pane width was auto-derived from the container with no way to widen it. Add a draggable splitter on the divider between the name grid and the timeline: drag to resize (clamped 160px ↔ container-200px so it can never collapse or swallow the chart), double-click to reset to auto-size. The chosen width persists in the saved layout (persistLayoutKey / onLayoutChange) and the start/end columns auto-reveal once the pane is wide enough.
…on (dhtmlx-style) The connector dots half-overlapped the bar end and resize zone, and the progress grip was a thin full-height strip in the bar body — so linking sometimes moved the bar and progress was awkward to grab. - Connector dots now float fully OUTSIDE each bar end (detached circles in a 20px hit area). Sitting outside the bar body means grabbing one can never start a move or an edge-resize. They show on row hover (or while this bar is the link source) and are pure visual hints during a drag. - Progress handle is now an up-pointing triangle hugging the bottom edge at the progress %, with its hit area confined to the bottom half — clear of the move body (top) and the centred end dots.
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
…ctor dots stay grabbable The link connector dots float just outside each end of a bar. Hover was tracked on the narrow bar element, so the moment the cursor crossed the bar's right edge toward the end dot, the bar's mouseleave fired, cleared hoveredTaskId, and the dot vanished before it could be grabbed — and a fast sweep could outrun the dot's pointer-events:auto re-render and fall straight through. Move onMouseEnter/onMouseLeave to the full-width row. The row spans the whole timeline, so moving bar -> dot never leaves the hover zone (dhtmlx-style), and the dot is enabled well before the cursor reaches it.
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
…default columns Two ergonomics fixes the user called out against dhtmlx: 1. Connector dots were crammed against the bar end. Now the visible circle sits out with a comfortable ~12px gap so it reads as its own affordance. The transparent hit area is wider and BRIDGES back to the bar edge (z-20 above the dependency line's z-10 hit-stroke), so crossing the gap never drops the row hover and the dot stays grabbable the whole way out. 2. Default column width was too narrow (35/50/60). Bumped to 44/64/80 so day/week/month columns have room to breathe. Tests: the drag-snap suites were calibrated to columnWidth=60. Rescaled their pixel deltas to clean multiples of 80 (avoiding the Math.round(±1.5) asymmetry) and updated the COLUMN_WIDTH constants/comments. 201 pass.
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
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.
ObjectGantt — interaction & layout improvements
A batch of
@object-ui/plugin-ganttfixes and features. Each was verified in-browser and is covered by the unit suite (201 passing, type-check clean).Dependencies (drag-to-link)
end→start = FS,end→end = FF,start→start = SS,start→end = SF. A draft hint (Task A (end) → Task B (end)) names the endpoints during the drag.Handle ergonomics (stop mis-operation)
Layout
View switching
Config & i18n
defaultCollapsedDepth.gantt.linkType.fs); addedgantt.linkEnd.*keys.Demo
🤖 Generated with Claude Code