Skip to content

fix (new-timeline): Fix new timeline crashing on missing categories - #308

Merged
ralvarez-dg merged 3 commits into
mainfrom
task/fix-new-timeline
Nov 11, 2026
Merged

ralvarez-dg merged 3 commits into
mainfrom
task/fix-new-timeline

Conversation

@timothy-mugo

Copy link
Copy Markdown
Contributor

Description

Type of change

  • Bug fix (fix:)
  • New feature (feat:)
  • Breaking change (BREAKING CHANGE:)
  • Refactor / chore (refactor: / chore:)
  • Documentation update (docs:)

Affected package(s)

  • @devgateway/dvz-ui-react
  • @devgateway/wp-react-lib
  • example only (no changeset needed)

Checklist

  • PR title follows Conventional Commits format
  • A changeset has been added (pnpm changeset) for any change to a published package
  • pnpm build passes locally
  • pnpm --filter @devgateway/* typecheck passes
  • No hardcoded credentials, internal URLs, client names, or PII introduced
  • Any new dependency has an Apache-2.0-compatible license

@pkg-pr-new

pkg-pr-new Bot commented Nov 11, 2026

Copy link
Copy Markdown

Open in StackBlitz

pnpm add https://pkg.pr.new/@devgateway/dvz-ui-react@934f388
pnpm add https://pkg.pr.new/@devgateway/wp-react-lib@934f388

commit: 934f388

Copilot AI 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.

🟡 Changes recommended

Two moderate active issues remain: timeline renders can trigger repeated post-fetch requests, and the active marker can remain on the previously selected slide.

2 open issues
What changed in this PR

Fixes the new timeline’s handling of missing category data and stabilizes timeline rendering configuration to avoid unnecessary redraws.

Changes:

  • Makes category parsing tolerate absent or non-JSON values.
  • Memoizes parsed timeline configuration.
  • Clears and redraws the SVG when relevant timeline inputs change.
  • Adds a patch changeset for @devgateway/dvz-ui-react.
File Description
packages/​dvz-ui/​src/​embeddable/​new-time-line/​timeline.jsx Clears the D3 SVG before redraws and updates redraw dependencies for changing timeline inputs.
packages/​dvz-ui/​src/​embeddable/​new-time-line/​index.jsx Adds resilient category parsing and memoizes the parsed timeline configuration.
.changeset/​tidy-lines-render.md Records the patch release and bug-fix summary for @devgateway/dvz-ui-react.

Review effort: Lite

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings November 11, 2026 11:27
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@pkg-pr-new

pkg-pr-new Bot commented Nov 11, 2026

Copy link
Copy Markdown

Open in StackBlitz

pnpm add https://pkg.pr.new/@devgateway/dvz-ui-react@469afb8
pnpm add https://pkg.pr.new/@devgateway/wp-react-lib@469afb8

commit: 469afb8

@ralvarez-dg
ralvarez-dg merged commit aed86c4 into main Nov 11, 2026
2 checks passed

Copilot AI 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.

🔵 Needs a closer look

An active moderate issue remains because timeline rerenders create a new categories array, causing unnecessary posts requests even when the filter is unchanged.

No open issues 🎉

1 previously missed issue

In code that hasn't changed since last review

Medium severity Avoid refetching posts when categories are unchanged

packages/​dvz-ui/​src/​embeddable/​new-time-line/​index.jsx:67

This now returns a new array from parse on every render (both the JSON-array path and the comma-separated fallback). PostProvider compares categories by reference (categories != prevProps.categories), while this component re-renders whenever setCurrentSlide runs, so clicking a timeline point dispatches another posts request even though the filter did not change. Return a stable serialized category string (or memoize the parsed value before passing it to PostProvider) so rerenders do not refetch the posts.

2 resolved since last review

Review effort: Lite

@timothy-mugo
timothy-mugo deleted the task/fix-new-timeline branch November 11, 2026 11:30
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.

3 participants