Comfy-Org / Comfy-Org/ComfyUI_frontend
Agent panel follow-ups from PR 16198 review: unreachable follower branch + non-reactive cloud workflow map
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 699
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 490
Description
## Problem / Goal
Two review follow-ups from frontend PR 16198 (merged), both raised by @benjcooley as SHOULD FIX and deferred so the PR could land.
1. Dead code: the `isTargetActive` branch in `src/workbench/extensions/agent/crdt/useAgentCrdtFollower.ts` is currently unreachable. Page-reload recovery is deferred, not dropped — when it lands, this branch becomes live again.
2. Non-reactive read: `cloudIdsByName` is a plain `let` Map read inside the `boundTabFor` computed in `AgentPanelRoot.vue`. The read is untracked, so `refreshCloudWorkflowIds()` does not invalidate `isBoundWorkflowActive`. A workflow saved to cloud mid-session will not flip the flag until an unrelated reactive dependency changes.
## Proposed Solution
1. Either remove the unreachable branch with a note pointing at the deferred reload-recovery work, or wire it up as part of that work.
2. Move the name-to-id map into reactive state (e.g. a `shallowRef` replaced on refresh) so the computed re-evaluates when `refreshCloudWorkflowIds()` completes.
## Acceptance Criteria
- [ ] No unreachable branch in `useAgentCrdtFollower.ts`, or the branch is exercised by reload recovery.
- [ ] `isBoundWorkflowActive` updates after `refreshCloudWorkflowIds()` resolves, covered by a unit test.
Full context for agent readers
Source review threads on frontend PR 16198 (thread on useAgentCrdtFollower.ts, thread on AgentPanelRoot.vue boundTabFor). The dead-code item was downgraded from blocker after the reviewer confirmed reload recovery is deferred work, not lost work. Both fixes are small, low-risk, agent-panel-scoped, and suitable for a single PR.
Contributor guide
Research direction
Start by reading src/workbench/extensions/agent/crdt/useAgentCrdtFollower.ts and AgentPanelRoot.vue, focusing on the isTargetActive branch, boundTabFor, cloudIdsByName, and refreshCloudWorkflowIds(). Add or adjust the unit test for the cloud refresh behavior, and confirm that isBoundWorkflowActive updates after refreshCloudWorkflowIds() resolves while the unreachable branch is removed or exercised by reload recovery.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100