Comfy-Org / Comfy-Org/ComfyUI_frontend
refactor: extract shared WidgetActionButton component to reduce boilerplate in WidgetActions.vue
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 699
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 490
Description
## Summary
Each action `` in `src/components/rightSidePanel/parameters/WidgetActions.vue` repeats the same boilerplate:
```vue
```
This same block appears four times (Rename, Toggle Visibility, Favorite, Reset to Default). A thin wrapper component (e.g., `WidgetActionButton.vue`) pre-applying the shared `variant`, `size`, and `class` values would eliminate the repetition and keep each action button's template focused on its unique icon and label.
## Proposed Change
Create `src/components/rightSidePanel/parameters/WidgetActionButton.vue` that wraps `Button` with the shared defaults, then replace the four repeated Button blocks in `WidgetActions.vue` with the new component.
## References
- PR: https://github.com/Comfy-Org/ComfyUI_frontend/pull/11414
- Comment: https://github.com/Comfy-Org/ComfyUI_frontend/pull/11414#discussion_r3107689998
- Requested by: @christian-byrne
┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-11432-refactor-extract-shared-WidgetActionButton-component-to-reduce-boilerplate-in-Widget-3476d73d365081e5bd45d08eb4c93273) by [Unito](https://www.unito.io)
Contributor guide
Assessment
This issue has not been assessed yet.