Skip to content

feat(timeline): add runnable basic timeline example (#21039) - #21044

Merged
tobiu merged 3 commits into
neomjs:devfrom
mrdeyroy:feat/timeline-basic-example
Nov 16, 2026
Merged

tobiu merged 3 commits into
neomjs:devfrom
mrdeyroy:feat/timeline-basic-example

Conversation

@mrdeyroy

@mrdeyroy mrdeyroy commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Resolves #21039

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

The PR fulfills this requirement:

  • It's submitted to the dev branch, not the main branch

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

Adds examples/timeline/basic: a standalone, runnable example demonstrating Neo.timeline.Column mounted in a plain Neo.grid.Container with a 24-hour Neo.timeline.TimeAxis and an inline Neo.timeline.store.Events.

Key details:

  • Standalone example (app.mjs, index.html, neo-config.json, Viewport.mjs) importing only from src/timeline, src/grid, src/button, and src/container. Imports nothing from src/scheduler or src/gantt.
  • Interactive interval shift button (record.set()) demonstrating live reactive bar repositioning on event store changes without reloading.
  • Added timeline-basic to apps/portal/resources/data/examples.json and updated SEO metadata.
  • Updated test/playwright/unit/apps/portal/view/examples/TabContainerController.spec.mjs catalog count (75 -> 76) and family store order.
  • Verified all CI baseline guards (check-guard-ci-parity, check-examples-body-only, check-relative-links, check-package-contents, check-class-module-scope, check-ticket-archaeology).

This issue/PR was prepared with AI assistance.

@neo-fable-mnemosyne neo-fable-mnemosyne left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Micro-Review

Opening: Thank you for this one too. The example does the one thing the issue cared most about: it mounts the timeline column by its module in an ordinary grid, with the axis and the event store as plain configs, and it reaches for neither the scheduler nor the Gantt chart. The pointers into Neo are in my review of your Gantt page; I filed this issue as well.

Class: contained: a new example of four files, its entry in the examples index and the generated SEO lines; the index spec follows the count. No engine code changes.

Verdict: Request Changes

Glance: The claim is a runnable example of Neo.timeline.Column in a plain grid, with a control that moves a bar through its record. I opened it in development mode at 6f040475bd (19:37Z): seven rows, all twelve interval titles drawn. Pressing the button moved "Sprint Planning" from 670 to 730 px, one hour at one pixel per minute, without a reload, and no other bar moved. Nothing is imported from src/scheduler or src/gantt, the index entry has the shape of its two siblings, and CI is green with the count at 76. What I looked for was whether the button does what its label says once a row is selected. It does not (finding 1). The screenshots the issue asked for are no longer needed: the observation is in this review.

Findings:

  • 1 · The button moves the selected row's interval, or its label and comment stop saying so. With the third row selected, pressing it moved the first row's "Sprint Planning" again (730 to 790 px) and left "Timeline Testing" where it was. grid.selectionModel?.selectedRecordIds reads nothing: a grid's selection model lives on its view, and the row model keeps the selected ids in selectedRows, so the read is grid.view.selectionModel?.selectedRows?.[0]. The name selectedRecordIds occurs nowhere under src on dev 9575d2689b. Either take that read and try it with a row selected, or drop the selection and name the button for what it does ("Shift the first interval by one hour"). An example is what the next person copies, so it should hold no read that silently returns nothing.

  • 2 · onShiftInterval gets a @summary line, as the methods of the two sibling examples have: /** @summary Moves one interval an hour later through its record. */.

  • Origin Session ID: 0d801763-b80f-4990-a86a-ee52142a3225

  • PR body attribution: the contributor template's own AI line; no harness-appended session backlink.

🪢 Mnemosyne (Claude Fable 5.2, Claude Code). Eligibility rules: pr-review-guide §6.4.


[review-budget-managed]

  • outcome: within-budget
  • ordinary-limit: 1
  • activation-issue: 15257
  • activation-pr: 15307
  • activated-at: 2026-07-16T20:54:31Z

@neo-fable-mnemosyne neo-fable-mnemosyne left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Review — Round 2 (disposition only)

Status: Comment

Opening: Thank you for the quick turn. This dispositions the two findings of my first review at f94ce61fd3: the summary line is in, and the button still moves the first row when another row is selected. That second one is on me, not on you: you took the read I gave you, and my read was incomplete. One line is left, and it is below, tested.

⚓ Anchor

  • PR / Target Issue: #21044 / #21039
  • Round-1 Review ID: #21044 (review) · Author Response: none; the repair is commit f94ce61fd3
  • Head under review: f94ce61fd3
  • Origin Session ID: 02ab4651-2282-4faf-bc5c-856a5ee5ab05

📋 Disposition

# Required Action (verbatim from Round 1) Disposition Evidence
RA-1 1 · The button moves the selected row's interval, or its label and comment stop saying so. With the third row selected, pressing it moved the first row's "Sprint Planning" again (730 to 790 px) and left "Timeline Testing" where it was. grid.selectionModel?.selectedRecordIds reads nothing: a grid's selection model lives on its view, and the row model keeps the selected ids in selectedRows, so the read is grid.view.selectionModel?.selectedRows?.[0]. The name selectedRecordIds occurs nowhere under src on dev 9575d2689b. Either take that read and try it with a row selected, or drop the selection and name the button for what it does ("Shift the first interval by one hour"). An example is what the next person copies, so it should hold no read that silently returns nothing. STILL_OPEN Development mode at f94ce61fd3, 05:27Z: with the third row selected the button moved the first row's "Sprint Planning" from 661 to 721 px and left "Timeline Testing" in place. Read inside the app worker, selectedRows holds ["neo-record-3"]: a grid issues its own row ids by default (useInternalId: true), so the value is never equal to a resourceId and line 103 falls back to the first event. The selection model resolves such an id to its record: getRowRecord("neo-record-3").id is "r-3". The replacement for line 101 is under this table.
RA-2 2 · onShiftInterval gets a @summary line, as the methods of the two sibling examples have: /** @summary Moves one interval an hour later through its record. */. ADDRESSED examples/timeline/basic/Viewport.mjs:96 at f94ce61fd3.

The one line for RA-1, in place of examples/timeline/basic/Viewport.mjs:101:

              selection   = grid.view.selectionModel?.getRowRecord(grid.view.selectionModel.selectedRows[0])?.id,

With that line on top of f94ce61fd3 I measured (05:29Z, one pixel per minute): third row selected, "Timeline Testing" 781 to 841 px; fifth row selected, "Integration Tests" 721 to 781 px, and 781 to 841 px on a second press; nothing selected, "Sprint Planning" 661 to 721 px. No other bar moved in any of the four presses.

🔚 Verdict

COMMENT. RA-1 stays open for that one line; nothing else is. CI is green at this head, and the rebase onto dev carried the catalog count to 77 correctly. When the line is in I approve at that head.

🖖 Mnemosyne (Claude Fable 5.2, Claude Code). Memory Core session 02ab4651-2282-4faf-bc5c-856a5ee5ab05.

@mrdeyroy

Copy link
Copy Markdown
Contributor Author

Thanks for the review and the pointer on grid selection!

Addressed both findings in commit f94ce61fd3:

  • Finding 1: Updated the selection read to grid.view.selectionModel?.selectedRows?.[0]. Selecting any row (e.g., row 3, "UI Components") now shifts that row's interval ("Timeline Testing") by 1 hour, while falling back to the first row ('r-1') if nothing is selected.
  • Finding 2: Added the JSDoc summary /** @summary Moves one interval an hour later through its record. */ to onShiftInterval().

Rebased on current dev to keep the branch mergeable with recent upstream changes.

@neo-fable-mnemosyne

Copy link
Copy Markdown
Contributor

Your comment and my second review crossed by four minutes, so in case you have not seen it yet: at f94ce61fd3 a selected third row still moves the first row's bar. I ran the example (the numbers are in the review). The cause is the read I gave you, not your change: it returns the grid's own row id (neo-record-3), not the record's id, so the comparison with resourceId never matches and the fallback takes the first event.

The one tested line is in that review. When it is in, I approve at that head.

🪢 Mnemosyne (Claude Fable 5.2, Claude Code)

@mrdeyroy
mrdeyroy force-pushed the feat/timeline-basic-example branch from 126c3b1 to 702b462 Compare November 16, 2026 08:51
@mrdeyroy

Copy link
Copy Markdown
Contributor Author

Thanks for catching the internal row id nuance and sharing the tested fix!

Updated the selection line in examples/timeline/basic/Viewport.mjs to:

selection   = grid.view.selectionModel?.getRowRecord(grid.view.selectionModel.selectedRows[0])?.id,

in commit 702b462449, which correctly resolves the record model's identifier ('r-3', 'r-5', etc.), and rebased cleanly onto latest dev.

@neo-opus-grace

Copy link
Copy Markdown
Contributor

A note for the timeline example, from #21102's AC-5: #21132 adds grid.view.selectedRecords, which resolves the grid's row ids to their records. With it, the resource this example reads as selected is one call: grid.view.selectedRecords[0].

If this PR is still open when #21132 merges, please switch to that read here. If this PR lands first, a follow-up makes the switch; #21132's author offered to do it.

🖖 Grace (Claude Opus 5.5, Claude Code) · session 9d2c0742-5c77-402e-82c9-3294b03a4062

@neo-fable-mnemosyne neo-fable-mnemosyne left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Review — Round 2 (disposition only)

Status: Approved

Opening: This dispositions the two findings of my first review at 702b462449: both are in, and the button now moves the bar of the row that is selected. Thank you for staying with it through a hint of mine that was wrong.

⚓ Anchor

📋 Disposition

# Required Action (verbatim from Round 1) Disposition Evidence
RA-1 1 · The button moves the selected row's interval, or its label and comment stop saying so. With the third row selected, pressing it moved the first row's "Sprint Planning" again (730 to 790 px) and left "Timeline Testing" where it was. grid.selectionModel?.selectedRecordIds reads nothing: a grid's selection model lives on its view, and the row model keeps the selected ids in selectedRows, so the read is grid.view.selectionModel?.selectedRows?.[0]. The name selectedRecordIds occurs nowhere under src on dev 9575d2689b. Either take that read and try it with a row selected, or drop the selection and name the button for what it does ("Shift the first interval by one hour"). An example is what the next person copies, so it should hold no read that silently returns nothing. ADDRESSED examples/timeline/basic/Viewport.mjs:101 at 702b462449 resolves the row id to its record. Development mode at that head, 13:33Z, one pixel per minute: third row selected, "Timeline Testing" 781 to 841 px; fifth row selected, "Integration Tests" 721 to 781 px, and 781 to 841 px on a second press; nothing selected, "Sprint Planning" 661 to 721 px.
RA-2 2 · onShiftInterval gets a @summary line, as the methods of the two sibling examples have: /** @summary Moves one interval an hour later through its record. */. ADDRESSED examples/timeline/basic/Viewport.mjs:96, unchanged since f94ce61fd3.

🔚 Verdict

Approve. No required actions — eligible for human merge.

CI is green at this head. Three e2e shards had failed on tests that touch no file of this pull request (portal/NewsTabOverflow, grid/StoreUpdateRowsNL, grid/IssuesShowcase); a re-run of the failed jobs passed, and the second of them is tracked in #21135.

One note that asks nothing of this pull request: #21132 adds grid.view.selectedRecords, and the comment above this review says who switches line 101 to it and when.

🖖 Mnemosyne (Claude Fable 5.2, Claude Code). Memory Core session 2aca1b1d-2c66-48b0-91b9-915e506da9a7.

@tobiu
tobiu merged commit 3a63c3f into neomjs:dev Nov 16, 2026
47 of 51 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Merged. Standing: Contributor (3 merged). 2 more reach Returning Contributor. Your record and badge: https://neomjs.com/badges/mrdeyroy-169705535/

Next, if you want one: #19145 and #20696 are open and unclaimed; a comment on either claims it. The full list has more if both are taken by then.

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.

The timeline column has no runnable example outside a scheduler

4 participants