Skip to content

feat(catalog): add Gantt recipe with nested phases and dependencies - #163

Open
greglum wants to merge 7 commits into
TanStack:mainfrom
greglum:greg/gantt-dependencies-recipe
Open

greglum wants to merge 7 commits into
TanStack:mainfrom
greglum:greg/gantt-dependencies-recipe

Conversation

@greglum

@greglum greglum commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

This adds catalog case 198, a Gantt recipe for the pending PLAN.md item "Gantt/resource timeline with nested groups and dependencies". The conformance README asks for that item to arrive first as a recipe. There is no core change.

What it shows, using only public marks on scaleBand lanes and scaleUtc time:

  • Phase header lanes with indented task lanes. Phase summary bars use an outline plus a light fill, so connectors stay visible across them.
  • Task bars with progress fills, a go-live milestone, and a dashed status-date rule.
  • Thirteen right-angle finish-to-start arrows, drawn with link and a small case-local d3 curve through d3Curve. Each exits the right edge and enters the left. It routes back through the lane gutter when a successor starts before its predecessor ends.
  • Connectors, progress fills and the status rule are decorative, so keyboard focus stops only on phases, tasks and the milestone.
  • A lane-tree focus strategy (focusNearestY with a y-then-x navigation), so arrow keys walk the plan top to bottom. Tooltips list dates, progress and predecessors.
  • Colours come from --ts-chart-* and currentColor.

Verification:

  • pnpm conformance -- --case=198-gantt-dependencies passes at 320, 640 and 960 px, light and dark, for initial and revised data. Geometry match against the Observable Plot reference is 98.7%.
  • The case unit tests pass, including keyboard focus order.
  • Catalog index, preview and examples checks, pnpm docs:check and pnpm typecheck pass.
  • Documented in Intervals and Financial Charts via the chart-example directive.

Friction found while building it, logged as API entries with status monitoring:

  • F-315: right-angle connectors need a hand-built curve, because a curve cannot see the band step or the target mark.
  • F-316: keyboard focus cannot follow a dependency. A custom resolve also cannot reuse the default nearest-point lookup, because it receives points, not the scene.
  • F-317: time-ranged bars cannot inset only their lane edges, and barX rejects Date fields.

These IDs will need renumbering if other friction entries land first. No changeset, because no published package changes.

Summary by CodeRabbit

  • New Features
    • Added a project Gantt chart example with nested phases and tasks, progress indicators, a milestone, a status-date marker, and right-angle dependency arrows.
    • Task descriptions are available through tooltips, and keyboard navigation follows lane order.
  • Documentation
    • Added guidance for using Gantt charts to plan projects with task dependencies and phase progress.
    • Added the chart to the individual charts catalog.
  • Chores
    • Expanded the conformance catalog and coverage reporting to include the new chart.

Add conformance case 198: phase header lanes with indented task lanes on scaleBand and scaleUtc, progress fills, a go-live milestone, a status-date rule, and right-angle finish-to-start arrows routed by a case-local d3 curve on link. Connectors, progress, and the rule are decorative, so keyboard focus stops on every phase, task, and milestone. Observable Plot reference uses the same routing curve.

Document the recipe in Intervals and Financial Charts, register the case in the catalog index, previews, navigation, and definition coverage records, and log F-310, F-313, and F-314 in the API friction log.
Use a focusNearestY-based strategy whose navigation sorts by y then x so arrow keys follow the lane tree, and assert the order in the unit test. Outline phase summaries with a light fill so crossing connectors stay visible in both themes. Note the fixed margin assumption in the gutter estimate and correct F-308.
@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ed49cc72-4063-42cf-a34b-1b00679ccd8a
📥 Commits

Reviewing files that changed from the base of the PR and between e31e62a and 2db7f2a.

⛔ Files ignored due to path filters: 1
  • benchmarks/conformance/previews/198-gantt-dependencies.svg is excluded by !**/*.svg
📒 Files selected for processing: 4
  • API-FRICTION.md
  • benchmarks/conformance/previews/manifest.json
  • docs/config.json
  • packages/charts-core/docs/config.json
🚧 Files skipped from review as they are similar to previous changes: 1
  • API-FRICTION.md

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.

📝 Walkthrough

Adds Gantt conformance case 198 with grouped task lanes, progress, milestones, a status-date rule, and routed finish-to-start dependency arrows. The change includes chart implementations, case registration, tests, coverage updates, and documentation.

Changes: Project Gantt conformance case

Layer / File(s) Summary
Task data and schedule layout
benchmarks/conformance/cases/198-gantt-dependencies/data.ts, benchmarks/conformance/cases/198-gantt-dependencies/plan.ts
Adds revision-specific project tasks and derives phase summaries, task lanes, progress spans, dependency endpoints, and a date domain.
Chart rendering and dependency routing
benchmarks/conformance/cases/198-gantt-dependencies/example.tsx, benchmarks/conformance/cases/198-gantt-dependencies/route.ts, benchmarks/conformance/cases/198-gantt-dependencies/plot.ts, benchmarks/conformance/cases/198-gantt-dependencies/tanstack.ts, benchmarks/conformance/cases/198-gantt-dependencies/tanstack.test.ts
Adds chart renderers, elbow-routed connectors, lane-ordered keyboard navigation, chart mounting, and tests for rendered items, lane scales, and focus order.
Case registration and validation
benchmarks/conformance/cases/198-gantt-dependencies/case.json, benchmarks/conformance/catalog-index.json, benchmarks/conformance/definition-coverage-roadmap.json, benchmarks/conformance/definition-coverage-roadmap.test.ts, benchmarks/conformance/previews/manifest.json, benchmarks/conformance/DEFINITION-COVERAGE-*, scripts/catalog-definition-shapes.test.mjs
Registers case 198, updates coverage counts and validation expectations, and adds the preview asset.
Usage documentation and API observations
docs/config.json, docs/examples/intervals-and-financial.md, packages/charts-core/docs/config.json, packages/charts-core/docs/examples/intervals-and-financial.md, API-FRICTION.md, PLAN.md
Adds chart navigation and Gantt guidance, records connector, keyboard traversal, and bar inset observations, and updates the roadmap entry.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Example as createExampleChart
  participant Data as planForRevision
  participant Layout as planLayout
  participant Chart as Chart marks
  Example->>Data: Select revision-specific tasks
  Example->>Layout: Build lanes, items, and dependencies
  Layout-->>Example: Return chart layout
  Example->>Chart: Compose marks and interaction settings
Loading

Suggested reviewers: tannerlinsley

Merge Risk: ⚪ Minimal · up to 2db7f

The Gantt navigation entry is present in the documentation source and generated copy. No actionable merge risk is identified in the supplied changes.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 37.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 9 files. (4 skipped: 4… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: adding a catalog Gantt recipe with nested phases and dependencies.
Full details: Docstring Coverage

Explanation

Docstring coverage is 37.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 9 files. (4 skipped: 4 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@tannerlinsley

Copy link
Copy Markdown
Member

Thanks @greglum. The recipe keeps the new work out of the published runtime, which is a good fit here. I reviewed the source and the generated preview at 2db7f2a0fe5205a07067a317179a5ad2b5cc96d1; independent interactive and conformance checks are still pending.

One rebase detail to fix: the new entries in API-FRICTION.md are now F-315, F-316 and F-317, but PLAN.md still points to F-307/F-308 and the PR description still lists F-307 through F-309. Please update those references together. PR #165 also currently proposes F-315, so we will need to reconcile the numbering when the first of these lands.

@changeset-bot

changeset-bot Bot commented Oct 14, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 116d53c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@tannerlinsley

Copy link
Copy Markdown
Member

Thanks for updating the friction references. I checked the recipe independently against current main, and the recipe source is unchanged in 116d53c.

The isolated Chromium checks covered initial and revised data at 320, 640 and 960 pixels in light and dark themes, then same-host updates down to 280 pixels and back. All 30 states kept 14 focusable items, 13 dependencies, finite SVG geometry and the expected keyboard order. Pointer movement at each item resolved the correct lane, and destroying each host removed its SVG.

I also inspected narrow light and medium-width dark renders. This does not replace the full conformance comparison or repository checks. Those workflow gates still need approval before this can be merged.

@tannerlinsley

Copy link
Copy Markdown
Member

React follow-up on 116d53c: the example also passes isolated Chromium checks under React Strict Mode at 320, 640 and 960 px. All 14 keyboard stops show their expected descriptions, resizing to 280 px keeps valid SVG geometry and the accessible label, and unmounting leaves no SVG or tooltip behind. No browser errors were reported.

This adds React mounting and cleanup coverage to the earlier scene checks. Full CI and reference-renderer conformance are still pending.

@tannerlinsley

Copy link
Copy Markdown
Member

Thanks @greglum, I completed another local verification slice at 116d53c57bfc753fea6a5ffcef94c586512325b5: the isolated checkout passes all 2,228 DOM tests, TypeScript, the documentation contract and the 189 self-contained catalog-entry checks.

This complements the earlier interactive and React Strict Mode checks. It does not replace the pending full CI or reference-renderer conformance comparison, and I have not approved workflow execution or merged the PR.

@tannerlinsley

Copy link
Copy Markdown
Member

Thanks @greglum, the reference-renderer checks now pass at this same head. The repository visual assertions pass for both initial and revised data at 320, 640 and 960 pixels in light and dark themes, across Chromium, Firefox and WebKit. That covers geometry counts, guide containment, accessible naming and matching data-mark paints. An intentionally incorrect geometry count fails the verifier. The paired source/type build also passes.

The full isolated package gate passes too, including bare React Native, Expo, seven adapters and the unified artifact. This is not a runtime timing benchmark or a replacement for the required CI, which remains pending.

Verified head: 116d53c57bfc753fea6a5ffcef94c586512325b5.

This branch has not been deployed

No deployments
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.

2 participants