Skip to content

Commit 52b7225

Browse files
committed
Clarify conversation mutation locks
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 76a89e67-8a71-4803-8b12-9ac41600db0a
1 parent d3b36e4 commit 52b7225

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

frontend/src/components/Chat/ChatWindow.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,15 +224,18 @@ export default function ChatWindow({
224224
)
225225
const currentOperator = labels?.operator
226226
const attackOperator = attackLabels?.operator
227+
// Existing attacks are operator-locked when their operator differs from the current one.
227228
const isOperatorLocked = Boolean(
228229
attackResultId && attackLabels && attackOperator && currentOperator && attackOperator !== currentOperator,
229230
)
231+
// They are cross-target locked when the selected target's canonical hash differs from the persisted target.
230232
const isCrossTargetLocked = Boolean(
231233
attackResultId
232234
&& attackTarget
233235
&& activeTarget
234236
&& !targetInfoMatchesTarget(attackTarget, activeTarget),
235237
)
238+
// Any failed invariant keeps all mutation controls and handlers read-only.
236239
const isMutationLocked = isOperatorLocked || isCrossTargetLocked || isTargetResolutionLocked
237240

238241
// Clear internal messages when attack state is reset (e.g. New Attack).

0 commit comments

Comments
 (0)