Comfy-Org / Comfy-Org/ComfyUI_frontend

Use structured widget-store keys for promoted-widget instance scope

Open
#11,741 0 comments 0 reactions 0 assignees View on GitHub
area:widgets developer experience
Dominant language
TypeScript
Stars
2k
Forks
705
Avg merge
1d 8h
Merged PRs (30d)
512

Description

Follow-up from #11559 and DrJKL's review.

Current state:
- `src/stores/widgetValueStore.ts:17` encodes widget identity and optional instance scope into a string `WidgetKey`.
- `src/stores/widgetValueStore.ts:50` constructs keys with `:` and `@` separators.
- `src/stores/widgetValueStore.ts:77` and `src/stores/widgetValueStore.ts:95` depend on prefix scans for scoped lookup and clearing.

Goal:
- Replace string-concatenated widget keys with structured identity/scope storage.
- Make clearing an instance scope a direct map operation instead of a prefix scan.
- Preserve existing regular widget behavior and promoted-widget instance isolation.

Why:
- Structured keys avoid delimiter coupling, reduce prefix-scan behavior, and better match the entity/component access direction in the architecture guidance.

┆Issue is synchronized with this [Notion page](https://app.notion.com/p/Issue-11741-Use-structured-widget-store-keys-for-promoted-widget-instance-scope-3516d73d3650815ab5d1e3a8bd9e5075) by [Unito](https://www.unito.io)

Contributor guide

Open the contributing guide

Research direction

Start in src/stores/widgetValueStore.ts, especially lines 17, 50, 77, and 95, and trace how regular and promoted-widget keys are created, looked up, and cleared. Compare the current prefix-scan paths with the desired structured identity and scope storage. Done means instance clearing uses a direct map operation while regular widget behavior and promoted-widget isolation remain unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.