Conversation
Track the current manifest ID in ProjectDetails and skip render() when the manifest hasn't changed to prevent duplicate/expensive re-renders (components/project-details/index.js). Also add a render() helper and set the tpen-project-id attribute on tpen-project-details when the tpen-project-loaded event fires so the component receives the project ID and performs a controlled render (interfaces/project/index.html).
There was a problem hiding this comment.
Pull request overview
This PR optimizes the ProjectDetails component to prevent duplicate renders by tracking the current manifest ID. When the tpen-project-loaded event fires, a new render() helper function sets the tpen-project-id attribute on the component, which triggers a controlled render through the attributeChangedCallback.
Changes:
- Added duplicate render prevention in ProjectDetails by tracking
_currentManifestIdand skipping render when manifest hasn't changed - Added render() helper function in project/index.html to set tpen-project-id attribute on tpen-project-loaded event
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| components/project-details/index.js | Added _currentManifestId property and early return logic in render() to skip duplicate renders when manifest hasn't changed |
| interfaces/project/index.html | Added render() helper function and call in tpen-project-loaded event handler to set tpen-project-id attribute |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Static Review CommentsBranch: SummaryThis PR addresses issue #433 where the The root cause is a double-render: The approach is sound and minimal. There are a couple of correctness concerns around the comparison semantics.
Major Issues 🟠Issue 1: Reference-equality guard on array
|
thehabes
left a comment
There was a problem hiding this comment.


Track the current manifest ID in ProjectDetails and skip render() when the manifest hasn't changed to prevent duplicate/expensive re-renders (components/project-details/index.js). Also add a render() helper and set the tpen-project-id attribute on tpen-project-details when the tpen-project-loaded event fires so the component receives the project ID and performs a controlled render (interfaces/project/index.html).