Skip to content

fix(views): prevent browser freeze on long-timeline issues in Inbox#1972

Open
forrestchang wants to merge 1 commit intomainfrom
agent/lambda/b78aad20
Open

fix(views): prevent browser freeze on long-timeline issues in Inbox#1972
forrestchang wants to merge 1 commit intomainfrom
agent/lambda/b78aad20

Conversation

@forrestchang
Copy link
Copy Markdown
Collaborator

Summary

Fixes the browser tab freeze reported in #1968 when clicking a long-timeline issue (~6,400 entries) from Inbox.

Three targeted changes:

  • Timeline truncation — Initially renders only the most recent ~50 groups with a "Show earlier entries" button. When highlightCommentId is set (Inbox click), the full timeline auto-expands so scroll-to-comment still works.
  • CommentCard memoization — Wrapped with React.memo to skip re-rendering unchanged comment trees during parent state changes / WS-driven reconciliation.
  • ReadonlyContent memoization — Wrapped with React.memo so the heavy markdown pipeline (react-markdown + rehype + lowlight) is skipped when content hasn't changed.

Test plan

  • Open a long-timeline issue from the Inbox — page should load without freezing
  • Verify "Show earlier entries" button appears and loads remaining entries when clicked
  • Click an Inbox notification targeting a specific comment — should auto-expand and scroll to the comment
  • Verify normal issue detail rendering (short timelines) is unaffected
  • Verify comment editing, replying, reactions, and collapsing still work correctly

Three changes to address the performance freeze when opening issues with
thousands of timeline entries from the Inbox:

1. Truncate initial timeline to ~50 most recent groups with a "Show
   earlier entries" button. When a highlightCommentId is provided (e.g.
   from Inbox click), the full timeline is expanded automatically so
   scroll-to-comment still works.

2. Wrap CommentCard with React.memo so parent re-renders (from Inbox WS
   events, state changes in IssueDetail) skip reconciliation of unchanged
   comment trees.

3. Wrap ReadonlyContent with React.memo so the heavy markdown pipeline
   (react-markdown + rehype-raw + rehype-sanitize + rehype-katex +
   lowlight) is skipped when content/className haven't changed.

Closes #1968

Co-authored-by: multica-agent <github@multica.ai>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
multica-docs Ready Ready Preview, Comment May 1, 2026 7:09am

Request Review

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.

1 participant