Commit 5c259cb
authored
Avoid duplicate renders; set project-id on load (#468)
* Avoid duplicate renders; set project-id on load
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).
* Use manifest JSON key to avoid redundant renders
Change render guard to use a JSON string key of project.manifest to detect content changes and prevent duplicate renders. Rename _currentManifestId to _currentManifestKey and update the comparison to use JSON.stringify(project?.manifest ?? []) in components/project-details/index.js. In interfaces/project/index.html, rename render() to setProjectId() and call it on tpen-project-loaded to clarify intent. Includes minor whitespace cleanup.
* Reset manifest key; rename render function
Clear _currentManifestKey during component cleanup to avoid retaining stale manifest state. Also rename the top-level render() function in manage-project to applyProjectContext() and update its invocation to better reflect that it applies project context with permission checks.
* this is the actual fix for the PR
* Is this key tidier?
* testing canvas-panel
* Revert "testing canvas-panel"
This reverts commit 39591e1.1 parent fb6e8c5 commit 5c259cb
2 files changed
Lines changed: 22 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| |||
125 | 127 | | |
126 | 128 | | |
127 | 129 | | |
| 130 | + | |
128 | 131 | | |
129 | 132 | | |
130 | 133 | | |
131 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
132 | 150 | | |
133 | 151 | | |
134 | 152 | | |
| |||
150 | 168 | | |
151 | 169 | | |
152 | 170 | | |
153 | | - | |
| 171 | + | |
154 | 172 | | |
155 | 173 | | |
156 | 174 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
46 | | - | |
| 45 | + | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| |||
0 commit comments