Comfy-Org / Comfy-Org/ComfyUI_frontend
editAttention.ts — stale 12-month-old extension with no tests
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 699
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 490
Description
## Problem
`src/extensions/core/editAttention.ts` (173 lines) was last modified **2025-03-17** — over 12 months ago. It has no test coverage.
### What it does
Implements Ctrl+Up/Down keyboard shortcuts for editing attention weights in prompt text widgets. Parses parenthesized tokens like `(word:1.0)` and adjusts the numeric weight using regex matching.
### Why it needs attention
- Complex regex parsing logic for nested parenthesized expressions — fragile and untested
- Operates on raw text content via DOM manipulation (`selectionStart`, `selectionEnd`)
- No tests exist to verify the parsing logic or edge cases (nested parens, decimal precision, boundary conditions)
- The feature is not obvious to users (undocumented keyboard shortcut)
### Suggested fix
Add unit tests for the attention weight parsing and adjustment logic. The regex-heavy text manipulation is exactly the kind of code that benefits from test coverage.
### Files involved
- `src/extensions/core/editAttention.ts`
- `src/extensions/core/index.ts` (imports it)
Parent: #11022
┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-11107-editAttention-ts-stale-12-month-old-extension-with-no-tests-33e6d73d3650811a970ae76edf4d53c4) by [Unito](https://www.unito.io)
Contributor guide
Assessment
This issue has not been assessed yet.