LearnNewsExamplesServices
Frontmatter
id8565
titleScope timeline item IDs to Ticket ID to prevent stale rects on switch
stateClosed
labels
bugai
assigneestobiu
createdAtJan 12, 2026, 12:37 AM
updatedAtJan 12, 2026, 12:40 AM
githubUrlhttps://github.com/neomjs/neo/issues/8565
authortobiu
commentsCount1
parentIssue8398
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJan 12, 2026, 12:40 AM

Scope timeline item IDs to Ticket ID to prevent stale rects on switch

Closed v11.20.0 bugai
tobiu
tobiu commented on Jan 12, 2026, 12:37 AM

When switching between tickets that happen to have the same number of timeline events, TimelineCanvas sometimes renders the "old" event positions.

Root Cause: The timeline items use generic IDs like timeline-1, timeline-2. When switching tickets, if the Component is reused, the new HTML has the same IDs. TimelineCanvas calls waitForDomRect. If the DOM update hasn't happened yet (the old ticket HTML is still present), waitForDomRect finds the old elements (same IDs) immediately and returns stale rects.

Solution: Scope the timeline item IDs to the Ticket ID. Instead of timeline-1, use timeline-{ticketId}-1.

This ensures that when TimelineCanvas receives new data (for Ticket B), it looks for timeline-{ticketB}-1. These elements do not exist in the old DOM (Ticket A). waitForDomRect will correctly wait until the new HTML is mounted.

Changes:

  1. Modify apps/portal/view/news/tickets/Component.mjs to include me.record.id in bodyId and generated timeline event IDs.
tobiu added the bug label on Jan 12, 2026, 12:37 AM
tobiu added the ai label on Jan 12, 2026, 12:37 AM
tobiu referenced in commit d90b171 - "fix: Scope timeline item IDs to Ticket ID to prevent stale rects (#8565)" on Jan 12, 2026, 12:39 AM
tobiu assigned to @tobiu on Jan 12, 2026, 12:39 AM
tobiu
tobiu Jan 12, 2026, 12:39 AM

Input from Gemini 3 Pro:

✦ I have scoped the timeline item IDs to the Ticket ID.

Changes:

  • Modified apps/portal/view/news/tickets/Component.mjs to generate IDs in the format timeline-{ticketId}-{index} instead of timeline-{index}.
  • This applies to both the body item (timeline-{ticketId}-0) and all parsed timeline events.

This ensures that when TimelineCanvas waits for DOM elements after a ticket switch, it looks for new IDs that correspond to the new ticket. If the DOM update is pending, waitForDomRect will correctly wait until the new elements are mounted, preventing the use of stale rects from the previous ticket's view.

tobiu added parent issue #8398 on Jan 12, 2026, 12:40 AM
tobiu closed this issue on Jan 12, 2026, 12:40 AM