Skip to content

fix(timeline): don't crash when posts outnumber saved point configs - #303

Merged
ralvarez-dg merged 1 commit into
mainfrom
fix/-timeline-add-elements
Nov 3, 2026
Merged

ralvarez-dg merged 1 commit into
mainfrom
fix/-timeline-add-elements

Conversation

@timothy-mugo

Copy link
Copy Markdown
Contributor

Per-point settings were read as config[idx].x, which throws once a post is added beyond the saved data-config array. Add getPointConfig() that falls back to the last configured point, then defaults, and make subtitle reads null-safe.

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

Per-point settings were read as config[idx].x, which throws once a post is
added beyond the saved data-config array. Add getPointConfig() that falls back
to the last configured point, then defaults, and make subtitle reads null-safe.
@pkg-pr-new

pkg-pr-new Bot commented Nov 3, 2026

Copy link
Copy Markdown

Open in StackBlitz

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

commit: 043a521

@timothy-mugo

Copy link
Copy Markdown
Contributor Author

WP PR: devgateway/data-viz-wordpress#161

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.

🟢 Approval recommended

The patch addresses the reported timeline crash and missing-subtitle scenarios across all timeline variants with shared fallback settings and null-safe rendering.

No open issues 🎉

What changed in this PR

This pull request prevents timeline rendering crashes when posts exceed the saved per-point configuration entries and safely handles missing subtitles.

Changes:

  • Added shared point configuration defaults and fallback resolution.
  • Updated all timeline variants to use safe point configuration access.
  • Made subtitle rendering null-safe.
  • Added a patch changeset.
File Description
packages/​dvz-ui/​src/​embeddable/​time-line/​point-config.js Defines default point settings and fallback resolution for missing configuration entries.
packages/​dvz-ui/​src/​embeddable/​time-line/​mobile.jsx Applies fallback settings and safely renders missing subtitles on mobile.
packages/​dvz-ui/​src/​embeddable/​time-line/​desktop.jsx Applies fallback settings and safely renders missing subtitles on desktop.
packages/​dvz-ui/​src/​embeddable/​new-time-line/​timeline.jsx Applies shared fallback settings and null-safe subtitle rendering.
.changeset/​quiet-points-grow.md Documents the patch release for the timeline crash fix.

Review effort: Lite

@ralvarez-dg
ralvarez-dg merged commit 1329afd into main Nov 3, 2026
3 checks passed
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