Skip to content

feat(tracker): Gantt — #6 tier-3 virtualization (large-project performance)#10858

Draft
MichaelUray wants to merge 282 commits into
hcengineering:developfrom
MichaelUray:feat/gantt-upstream-pr6-tier3-virtualization
Draft

feat(tracker): Gantt — #6 tier-3 virtualization (large-project performance)#10858
MichaelUray wants to merge 282 commits into
hcengineering:developfrom
MichaelUray:feat/gantt-upstream-pr6-tier3-virtualization

Conversation

@MichaelUray

@MichaelUray MichaelUray commented May 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Vertical virtualization for the Gantt y-axis: only the rows within (or near) the visible viewport are mounted, and the dependency-arrow layer skips arrows whose endpoints both lie outside the viewport. Uses @tanstack/svelte-virtual as the foundation. Designed so projects with thousands of issues stay smooth — Jest performance gates assert that the y-viewport manager scales to 1 000 and 5 000 rows.

What's in this PR (+7 incremental commits)

  • deps add @tanstack/svelte-virtual to tracker-resources
  • Y-viewport manager for Gantt vertical virtualization
  • Sidebar-virtualization range helper (Phase 3a foundation reused here)
  • Classify dependency-arrow visibility against the y-viewport — skip arrows entirely off-screen
  • test 1 000 + 5 000-row y-viewport perf gates
  • chore remove dead Gantt lib files (filter-predicate, old sidebar-virtualization)
  • chore scrub internal tier/version markers from inline comments

Stack overview

# Branch Scope Status
PR1 …pr1-schema schema + version bump merged ✅
PR2 …pr2-readonly read-only viewlet draft
PR3a …pr3a-edit drag / resize / dnd draft
PR3b …pr3b-deps-cascade-cp dependencies + cascade + critical path draft
PR4 …pr4-polish polish draft
PR5 …pr5-tier2 undo, saved views, bulk, auto-scheduling draft
PR6 …pr6-tier3-virtualization this PR — virtualization draft
PR7 …pr7-tier4 mobile + tree + predecessor col + visual deps + notifications draft
Docs (huly-docs#70) MichaelUray:feat/gantt-section reference + screenshots open

Marked as draft to signal stack dependency on PR1 → PR5.

How to review

Fork compare: PR5...PR6 — 7 commits, 6 files

Reading order:

  1. y-viewport manager — the new module
  2. y-viewport.test.ts — the perf gates explain the design constraints
  3. Arrow-visibility classifier — minimal change at the connector layer

Testing

  • 1 000 + 5 000-row perf gates in y-viewport.test.ts.
  • Validated on a production-style deployment on 2026-05-18 — large project with 1 200 issues stays responsive while scrolling.

DCO

All commits are Signed-off-by.

@huly-github-staging

Copy link
Copy Markdown

Connected to Huly®: UBERF-16448

…comments

Strips reviewer-attribution markers ('review-N <date>') from source-code
comments. Comments are kept and rephrased as 'review note' so the noted
constraint or hidden invariant survives, only the internal attribution
is dropped.

Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
…onents

Resolve four pre-existing eslint errors that block the CI formatting job:
- GanttCanvas.svelte: split the milestone null-guard into nested {#if}
  blocks (prefer-optional-chain) — a naive optional chain would bypass
  the strict null check when range is null.
- GanttCanvas.svelte / GanttSidebar.svelte: convert void-returning
  short-circuit handlers to block-body arrows (no-confusing-void-expression).
- layout.test.ts: drop the non-null assertion in favour of optional
  chaining on the assertion (no-non-null-assertion).

Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
…sitions

Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
…mping

Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
…t/tooltip)

Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
…permission map

Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
…ize overlay

Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
…ttView

Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
…ocus)

Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
…both dates

Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
The drag-controller reducer only accepted mousedown-bar from hover-bar
state, but no DOM event ever transitioned idle → hover-bar (we never
wired the mouseenter-bar event from GanttBar to the reducer). The hover
state was dead code, and the first mousedown on a freshly-rendered
bar was silently dropped — Playwright integration test surfaced this.

Fix: reduceFromIdle accepts mousedown-bar directly with the same
edge-discriminator logic as reduceFromHover. Real users always go
through hover-bar first (mouseenter fires before mousedown), but
synthetic event dispatch and re-render edge cases can skip it.

Adds 2 tests:
- mousedown-bar from idle → dragging-body
- mousedown-bar (edge=left) from idle → resizing-left

Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
…sion

1. Context menu is too tall (~19 entries from auto-resolved Huly
   actions). Restructured via includedActions allow-list to 9
   curated entries that make sense for a Gantt bar:
   - Open (Edit issue)
   - Status / Priority / Assignee (existing actionPopup submenus, ›)
   - Set start date / Set due date
   - Copy issue ID / URL
   - Duplicate / Delete

   Component, Milestone, Labels, SubIssue, SetParent, Relations,
   Move-to-project and time-report stay accessible from the standard
   List/Kanban menu but are hidden from Gantt's right-click.

2. Unscheduled-drag-grip in the sidebar shared pointerdown with the
   canvas pan handler. Pan would start before the grip's
   mousedown|stopPropagation fired, swallowing the drag.

   Extended onCanvasPanStart exclusion: now also bails on
   .sidebar-cell, .drag-grip, .resize-handle. The grip's pointerdown
   no longer triggers a stray pan.

Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
…r gantt polish tier

Reviewer-approved fix patterns applied to the pre-existing eslint errors the
CI formatting job surfaces in the PR4 polish-tier code, alongside the prettier /
eslint --fix normalisation after the develop merge:
- no-confusing-void-expression: block-body arrows / drop redundant void operator
  (GanttCanvas dblclick, GanttView reactive recompute);
- no-non-null-assertion: drop redundant `!` on already-any-cast dragTarget;
- strict-boolean-expressions: explicit nullish handling in exporter;
- no-case-declarations: brace case blocks with lexical declarations (bar-labels);
- naming-convention: __resetConfirmGate -> resetConfirmGate (test reset helper);
- require-array-sort-compare: explicit localeCompare in build-rows test;
- balance the connector-overlay nested {#if} (prefer-optional-chain split) that
  the merge left one {/if} short.

Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
…lector types

svelte-check surfaced type errors from the cascade merge + eslint import
consolidation in the PR4 polish tier:
- './lib/types' merged into an `import type { ... }` with redundant inner
  `type` modifiers (invalid) — flatten to plain names;
- descendantsWithDates dropped from the './lib/scheduler' import (used in the
  scheduler/cascade paths) — restore it;
- getEventPositionElement dropped from the @hcengineering/ui import (used by
  openGanttMenu) — restore it;
- exporter expandForCapture passed Element (untyped querySelector) where
  HTMLElement is required — add the <HTMLElement> generic, matching the
  querySelectorAll call in the same function.

Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
Re-materialize the exact intended tip content for Gantt component and
i18n files that were carried via merge commits. Linearizing onto the new
develop dropped those merges; develop does not touch these files.

Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
…ion for all v1 entry kinds

Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
…lete via DependencyEditor

Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
…controller

Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
…scade pass

Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
…gression tests

Adds a GanttUndoConflictHint i18n string and surfaces it as the
notification sub-line when a Ctrl-Z gets dropped due to a conflict, so
users understand why repeated Ctrl-Z does not retry the same frame.
Both conflict and error paths now emit a console.warn with the original
UndoEntry to make intermittent 'undo did nothing' reports debuggable
in DevTools.

The cascade-frame atomicity was already wired (commitCascadeBatch pushes
one date-batch UndoEntry; applyInverse iterates inside one client.apply
scope so commit() is all-or-nothing). Adds 4 explicit regression tests
that pin that contract: 5-issue cascade applies in one commit, commit
throw leaves zero partial mutations, conflict drops the frame from the
stack without re-push, conflicted result carries the original entry
for the debug-log payload.

Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
…eCollection

Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
…w (de)serialization

Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
…line comments

Strips internal-tracking phrases from source-code comments (Tier-N Item M,
Tier-N #M, v121.NN, per Tier-N spec, leftover internal review markers).
Comments themselves are preserved — only the attribution labels are dropped.

Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
…Phase 3a

Pure-logic computeVisibleRowRange returns the visible row index range plus
top/bottom spacer heights for a uniform-row-height virtual list. Stages
the data path the sidebar renderer will adopt in a follow-up to handle
1000+ rows under the new column system without breaking the canvas
scroll coupling. 10 unit tests cover edge cases (empty list, top/bottom
edges, overflow, rubber-band scroll, zero rowHeight).

Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
…s virtualization

as the virtualization library (~50 KB minified, Apache-2.0). Headless virtualizer
will drive a single Y-viewport manager that the Gantt sidebar, canvas, and
dependency-arrow layer all subscribe to so the three layers stay scroll-synced
without re-implementing fixed-row-height math in each component.

Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
…rtualization

Pure-logic Y-axis virtualization surface (computeYViewport, rowIndexToY,
yToRowIndex, sliceVisibleRows) — mirrors the runtime virtualizer's decisions
so the sidebar + canvas + dependency layer can be tested deterministically
without a browser. Supersedes Phase 3a's computeVisibleRowRange() helper as
the single source of truth for visible-range + spacer math.

Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
… y-viewport

Pure-logic classifyArrowVisibility() + clippedEndpointPx() helpers tell the
dependency layer which arrows to render in full, which to clip at the
viewport edge with an off-screen indicator, and which to cull. Both
endpoints on the same off-edge side → none. Endpoints straddling opposite
edges → both-off (arrow path still crosses the viewport). Single-pixel
overlap with bounds counts as visible.

Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
Synthetic sweep over 100 / 50 scroll positions on a generated 1000 / 5000
row dataset. Budgets are loose (500 ms / 1500 ms) so the test doesn't
flake under rush parallel test execution; actual runtime is single-digit
ms on modern CPUs. The gate exists to flag catastrophic regressions
(10× slowdown) in the pure-logic virtualization path.

Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
…te, sidebar-virtualization)

Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
…line comments

Strips internal-tracking phrases from source-code comments (Tier-N Item M,
Tier-N #M, v121.NN, per Tier-N spec, leftover internal review markers).
Comments themselves are preserved — only the attribution labels are dropped.

Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
@MichaelUray MichaelUray force-pushed the feat/gantt-upstream-pr6-tier3-virtualization branch from 13379bf to 9d5a2be Compare July 9, 2026 07:45
Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant