Commit 1b79c24
fix UC missing-component warning for pre-enabled clusters
When you open a sample .zap that already had clusters enabled, the
"Required SLC Component not installed" warning was showing for every
one of them even though Studio had the components installed. The
install-requested gate I added in 9cee621 covers the case where ZAP
itself just clicked Install, but pre-existing clusters never go
through that path, so they fell through to the older id comparison.
That comparison was inconsistent about how it stripped Studio's id
prefixes. getClusterIdsByUcComponents would take everything after
the last `-` for anything containing "zigbee", but it would keep the
full `%extension-...%name` prefix for matter and only strip a
leading `%` in normalizeUcDependencyId. So:
tree leaf studiocomproot-...-zigbee_basic -> "zigbee_basic"
required %extension-zigbee%zigbee_basic -> "extension-zigbee%zigbee_basic"
Different strings, no match, warning shown. The matter path only
worked because both sides happened to keep the same `%extension-...%`
form, so the bad logic was symmetric for that one case.
Pull the id-shortening into a single extractUcClusterCode helper
that strips a leading `%`, takes everything after the last remaining
`%` if there is one, then takes everything after the last `-`. Run
both selected ids and required ids through it. Now both sides reduce
to the same cluster code regardless of which delimiter Studio used:
studiocomproot-...-zigbee_basic -> "zigbee_basic"
%extension-zigbee%zigbee_basic -> "zigbee_basic"
matter:1.0.0-...-%extension-matter%matter_level_control
-> "matter_level_control"
zigbee_basic -> "zigbee_basic"
Matter still matches the way it did before (both sides reduce
identically), zigbee with the %-prefixed required value now matches
too, and the install-requested short-circuit from 9cee621 keeps
covering the freshly-installed flow.
Also adds a JSDoc on the inner applyAdded helper in
applyUcComponentUpdate -- eslint's require-jsdoc was failing the
build with this rule on. Functional code unchanged.
Co-authored-by: Cursor <cursoragent@cursor.com>1 parent 9cee621 commit 1b79c24
2 files changed
Lines changed: 45 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1026 | 1026 | | |
1027 | 1027 | | |
1028 | 1028 | | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
1029 | 1034 | | |
1030 | 1035 | | |
1031 | 1036 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
155 | 185 | | |
156 | 186 | | |
157 | 187 | | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
163 | 191 | | |
164 | 192 | | |
165 | 193 | | |
166 | 194 | | |
167 | 195 | | |
168 | 196 | | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
| 197 | + | |
185 | 198 | | |
186 | 199 | | |
187 | 200 | | |
188 | 201 | | |
189 | | - | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
190 | 207 | | |
191 | 208 | | |
192 | 209 | | |
193 | 210 | | |
194 | | - | |
195 | | - | |
196 | | - | |
| 211 | + | |
197 | 212 | | |
198 | 213 | | |
199 | 214 | | |
| |||
0 commit comments