LearnNewsExamplesConnect
Frontmatter
assigneesneo-opus-ada
createdAtNov 20, 2026, 9:37 PM
updatedAtNov 20, 2026, 11:19 PM
githubUrlhttps://github.com/neomjs/neo/issues/21655
authorneo-opus-ada
commentsCount1
parentIssue20874
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtNov 20, 2026, 11:19 PM

A Gantt's tree-column sort: the header never sorts, links stay behind

neo-opus-ada
neo-opus-ada commented on Nov 20, 2026, 9:37 PM

No curated label: owned work from the operator's 20 Nov read of the home page, due before the Engine 14 examples lock (Sun 22 Nov 17:00Z).

Context

@tobiu reported on 2026-11-20 that the home plan preview's Gantt "breaks every dependency link after a tree-column sort" and needs proper tree-column support. A first headless check (three Task-header clicks) found the links on their bars and called it not reproduced. That check measured nothing: the header click never sorted the store, so no row moved.

Measured headless on dev 2c1d8e8c86 (Chrome, 1440 × 900, #/home, the "Gantt & Task Board" page):

Step Task header Plan store sortProperties Rows, top to bottom Links off their bars
at rest neo-sort-hidden [] Design, Wireframes, Visual design, Prototype, Build, … 0 of 8
header click neo-sort-asc, aria-sort="ascending" [] unchanged 0 of 8
second click neo-sort-desc, aria-sort="descending" [] unchanged 0 of 8
Gantt#onSortColumn({property: 'title', direction: 'ASC'}) — ['title'] Build, Data layer, Grid views, Scheduling, Design, Prototype, Visual design, Wireframes, Launch, Go live, Load test 4 of 8, up to 156 px (three 52 px rows)

The last row is the operator's frame: the bars move with their rows, every arrow stays where its rows used to be. The store itself is right: a unit run of Neo.gantt.TaskStore with the preview's eleven tasks sorts the tree by title ASC and DESC and fires sort once per call.

The Problem

Two defects stack, and either one alone breaks the tree column of every Gantt:

  1. The header's sort never reaches the store. The button flips its arrow and aria-sort, so the chart says it is sorted while it is not.
  2. A sort leaves the dependency overlay behind. Once the store is sorted by any path, the rows move and the links stay on the old rows.

The first defect is not the Gantt's own: every Neo.grid.Container subclass with an ntype of its own (scheduler, gantt) loses the header's sort, its inline header filter and its column menu's store binding the same way.

The Architectural Reality

  • src/grid/header/Button.mjs afterSetIsSorted() resolves its grid with me.up('grid-container') and returns before fire('sort') when that finds nothing. ComponentManager.up() turns a string into {ntype: 'grid-container'}, an exact match, so a header inside Neo.scheduler.Container (ntype: 'scheduler') or Neo.gantt.Container (ntype: 'gantt') finds no grid. The same lookup feeds afterSetDataField(), changeFilterOperator() and changeFilterValue() in that file, src/grid/header/plugin/Menu.mjs (the menu's store binding) and src/plugin/HeaderFilter.mjs.
  • The header toolbar already holds the reference: src/grid/header/Toolbar.mjs has a gridContainer config and reads it for its bodies.
  • src/grid/Container.mjs createColumns() wires onSortColumn as every column header's sort listener; Neo.scheduler.Container#createColumns() builds its locked and timeline columns and passes them through it, so the listener is in place and never called.
  • src/gantt/Container.mjs afterSetStore() re-projects the dependency layer on the task store's mutate, recordChange, rowsChange and filter. sort is not in that list.

Design authority: "A store batch (updateRows()) re-projects the overlay once, on its rowsChange. Its records' recordChange events and the filter or sort it reapplies arrive first, while store.isUpdatingRows is true, and leave the overlay to that final event." (Neo.gantt.Container#afterSetStore JSDoc: the overlay follows a sort, and only a batch defers it.) And Neo.data.TreeStore#doSort: "Hierarchically sorts the TreeStore."

The Fix

  1. One grid lookup for the header family. grid/header/Button resolves its grid through its header toolbar's gridContainer, the reference the grid container sets on its own toolbars, before any ntype match. Every reader listed above uses that one resolution. A grid subclass keeps its own ntype. The ntype match stays only as the fallback for a header placed under a bare grid-container, and for plugin/HeaderFilter's other owners: its contract follows any header "without adding a source ownership API".
  2. The overlay follows a sort. Neo.gantt.Container#afterSetStore() adds sort to the task-store listeners. A sort changes no date, so it re-projects the dependency layer without invalidating the schedule, and a sort inside an updateRows() batch still defers to its rowsChange.

Acceptance Criteria

  • AC-1: In the home plan preview, a Task-header click sorts the plan store by title (rows ASC within their phase), a second click sorts DESC, and the header's arrow and aria-sort match the store.
  • AC-2: After each of those sorts, every dependency link starts at its predecessor bar and ends at its successor bar within 1 px. An e2e asserts AC-1 and AC-2; it is red on dev and green at the head.
  • AC-3: A Neo.scheduler.Container resource-column header click sorts its resource store (unit or e2e).
  • AC-4: The header's inline filter and its column menu bind to the store of a grid subclass with its own ntype (unit test on a Gantt or Scheduler).
  • AC-5: Every grid lookup in src/grid/header/ and src/plugin/HeaderFilter.mjs asks the header's toolbar first (Button#getGridContainer()); up('grid-container') remains only as that fallback.

Out of Scope

  • Which records a tree sort moves: TreeStore#doSort sorts siblings within their parent, and that contract stands.
  • The board's card order: the board reads its own order field, not the grid's sorters.
  • The cascade motion of an open pull request (#21648): a sort is not a cascade and takes no transition.

Avoided Traps

  • Matching more ntypes (up('grid-container') || up('scheduler') || up('gantt')): every next subclass repeats the defect. The toolbar's reference is the grid that built the header.
  • Re-syncing the overlay from the grid body's row render: the overlay already follows the store everywhere else; a second trigger in the view is a second clock.

Related

Live latest-open + closed sweep: checked the latest 20 open issues and open and closed searches ("gantt sort", "header sort scheduler", "dependency links sort", "grid-container ntype", "tree column sort"; Out of Scope read on the same-surface closed hits #21407 and #19787) at 2026-11-20T20:35Z, 84 open (red band, so filed as a sub of #20874); no equivalent and no prior exclusion found. A2A claim sweep: the newest 30 messages of all read states, 19:50Z to 20:34Z; no claim on this scope. MC sweep: unavailable. query_raw_memories failed twice (embedding write canary consumer-probe-timeout); recorded as a defect-note. Own-assignment sweep: 5 open; #21639 is the same chart's cascade, no overlap in scope.

Retrieval Hint: "Gantt tree column sort header aria-sort store sortProperties empty dependency links stay on old rows grid-container ntype"

tobiu referenced in commit 51a202f - "fix(grid): headers sort a Gantt's store, and its links follow (#21655) (#21661) on Nov 20, 2026, 11:19 PM
tobiu closed this issue on Nov 20, 2026, 11:19 PM