Skip to content

Commit 5afb991

Browse files
paulr34cursoragent
andcommitted
cleanup
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent fc71d7f commit 5afb991

4 files changed

Lines changed: 8 additions & 29 deletions

File tree

src/store/zap/actions.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,6 @@ export function updateSelectedEvents(context, selectionContext) {
292292
export function updateSelectedComponent(context, payload) {
293293
let op = payload.added ? restApi.uc.componentAdd : restApi.uc.componentRemove
294294
return axiosRequests.$serverPost(op, payload).then((response) => {
295-
// Record the cluster as install-requested so the missing-component warning
296-
// gate short-circuits regardless of any contradictory Studio WS updates.
297295
const list = Array.isArray(response?.data) ? response.data : []
298296
const anySuccess = list.some((r) => {
299297
const s = Number(r?.status)

src/store/zap/mutations.js

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -987,21 +987,10 @@ export function updateSelectedUcComponentState(state, data) {
987987
}
988988

989989
/**
990-
* Apply a Studio WebSocket UC component update.
990+
* Merge a Studio component tree snapshot into local state.
991991
*
992-
* Studio's "updateComponents" notification carries a full tree snapshot. After
993-
* a successful install, Studio has been observed to emit a follow-up snapshot
994-
* that re-marks the just-installed leaf with isSelected:false, which used to
995-
* make the missing-component warning flicker back.
996-
*
997-
* The fix is to treat Studio's WS updates as ADD-ONLY for the local selection
998-
* set:
999-
* - leaves with isSelected:true -> upserted (Studio can ADD)
1000-
* - leaves with isSelected:false -> ignored (Studio cannot remove)
1001-
* - leaves not mentioned at all -> left alone (no wipe)
1002-
*
1003-
* ucComponents (the catalog used for labels / metadata) is always merged so
1004-
* we keep accumulating entries.
992+
* Add-only for selectedUcComponents: leaves with isSelected:true are upserted,
993+
* isSelected:false is ignored. ucComponents (the catalog) is always merged.
1005994
*
1006995
* @param {*} state
1007996
* @param {any[]} treeLeaves Flattened list of leaf nodes from Studio's tree.
@@ -1038,10 +1027,8 @@ export function applyUcComponentUpdate(state, treeLeaves) {
10381027

10391028
/**
10401029
* Track which cluster ids ZAP has successfully asked Studio to install (or
1041-
* uninstall) components for. The missing-component warning is gated by this
1042-
* list: if ZAP just told Studio to install for a cluster and got a 2xx back,
1043-
* later Studio WebSocket noise cannot flicker the warning back on for that
1044-
* cluster.
1030+
* uninstall) components for. Consumed by the missing-component warning gate
1031+
* in common-mixin.js.
10451032
*
10461033
* @param {*} state
10471034
* @param {{ clusterId: any, added: boolean }} payload

src/store/zap/state.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,8 @@ export default function () {
193193
studio: {
194194
ucComponents: [], // Studio uc component states
195195
selectedUcComponents: [], // [] of 'studio..' prefixed Studio internal component ids
196-
// Cluster ids (the local cluster id, not Studio's component id) that ZAP
197-
// has successfully asked Studio to install components for. Used to gate
198-
// the missing-component warning so subsequent Studio tree updates can't
199-
// flicker it back on for components ZAP itself just installed.
196+
// Cluster ids that ZAP has successfully asked Studio to install
197+
// components for. Consumed by the missing-component warning gate.
200198
installRequestedClusterIds: [],
201199
// a list of dict: { "clusterCode": "$zcl_cluster-$zcl_role", "value": ["$uc_component_id"] }
202200
zclSdkExtClusterToUcComponentMap: []

src/util/common-mixin.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -298,11 +298,7 @@ export default {
298298
)
299299
}
300300

301-
// If ZAP has already successfully asked Studio to install for this
302-
// cluster, suppress the missing-component warning regardless of how
303-
// Studio's tree currently labels things. This is the authoritative
304-
// signal -- it bypasses any id-format mismatch between what Studio
305-
// echoes back over the WebSocket and what our extension map uses.
301+
// If ZAP just installed components for this cluster, skip the check.
306302
const installRequested =
307303
this.$store.state.zap.studio.installRequestedClusterIds || []
308304
if (cluster && installRequested.includes(cluster.id)) {

0 commit comments

Comments
 (0)