Comfy-Org / Comfy-Org/ComfyUI_frontend

AUDIT-LG: delete dead LGraph/LGraphNode/LGraphCanvas event hooks (35 surfaces)

Open
#12,224 0 comments 0 reactions 0 assignees View on GitHub
Public API
Dominant language
TypeScript
Stars
2k
Forks
699
Avg merge
1d 7h
Merged PRs (30d)
490

Description

**Source audit:** `research/architecture/audit-litegraph-pruning.md (cross-repo workspace)` — see **§AUDIT-LG.7 — synthesis: master verdict table**.

## Verdict

**DELETE-NOW** — these 35 LiteGraph public surfaces all have **zero internal call sites** in `ComfyUI_frontend/src/`, `browser_tests/`, `tests-ui/`, and `packages/extension-api/` AND **zero external repos** touching them per the touch-points DB (`research/audits/litegraph-external-usage.csv` (cross-repo workspace artifact)).

These are stock LiteGraph hook fields inherited from the upstream `jagenjo/litegraph.js` subtree-merge that ComfyUI never wired execution behaviour onto. They are dead-by-inheritance, not dead-by-recent-removal.

## Symbols in this batch (35 surfaces)

| id | kind | symbol | int | ext_rep | tier |
|---|---|---|---:|---:|---|
| `lgraph_on_after_execute` | field | `LGraph.onAfterExecute` | 0 | 0 | long-tail |
| `lgraph_on_after_step` | field | `LGraph.onAfterStep` | 0 | 0 | long-tail |
| `lgraph_on_before_change` | field | `LGraph.onBeforeChange` | 0 | 0 | long-tail |
| `lgraph_on_before_step` | field | `LGraph.onBeforeStep` | 0 | 0 | long-tail |
| `lgraph_on_execute_step` | field | `LGraph.onExecuteStep` | 0 | 0 | long-tail |
| `lgraph_on_get_node_menu_options` | field | `LGraph.onGetNodeMenuOptions` | 0 | 0 | long-tail |
| `lgraph_on_play_event` | field | `LGraph.onPlayEvent` | 0 | 0 | long-tail |
| `lgraph_on_stop_event` | field | `LGraph.onStopEvent` | 0 | 0 | long-tail |
| `lgraphnode_on_add_property_to_panel` | field | `LGraphNode.onAddPropertyToPanel` | 0 | 0 | long-tail |
| `lgraphnode_on_before_connect_input` | field | `LGraphNode.onBeforeConnectInput` | 0 | 0 | long-tail |
| `lgraphnode_on_bounding` | field | `LGraphNode.onBounding` | 0 | 0 | long-tail |
| `lgraphnode_on_draw_collapsed` | field | `LGraphNode.onDrawCollapsed` | 0 | 0 | long-tail |
| `lgraphnode_on_draw_title` | field | `LGraphNode.onDrawTitle` | 0 | 0 | long-tail |
| `lgraphnode_on_draw_title_bar` | field | `LGraphNode.onDrawTitleBar` | 0 | 0 | long-tail |
| `lgraphnode_on_draw_title_text` | field | `LGraphNode.onDrawTitleText` | 0 | 0 | long-tail |
| `lgraphnode_on_drop_data` | field | `LGraphNode.onDropData` | 0 | 0 | long-tail |
| `lgraphnode_on_drop_item` | field | `LGraphNode.onDropItem` | 0 | 0 | long-tail |
| `lgraphnode_on_execute` | field | `LGraphNode.onExecute` | 0 | 0 | long-tail |
| `lgraphnode_on_get_property_info` | field | `LGraphNode.onGetPropertyInfo` | 0 | 0 | long-tail |
| `lgraphnode_on_input_added` | field | `LGraphNode.onInputAdded` | 0 | 0 | long-tail |
| `lgraphnode_on_input_removed` | field | `LGraphNode.onInputRemoved` | 0 | 0 | long-tail |
| `lgraphnode_on_key_up` | field | `LGraphNode.onKeyUp` | 0 | 0 | long-tail |
| `lgraphnode_on_menu_node_inputs` | field | `LGraphNode.onMenuNodeInputs` | 0 | 0 | long-tail |
| `lgraphnode_on_menu_node_outputs` | field | `LGraphNode.onMenuNodeOutputs` | 0 | 0 | long-tail |
| `lgraphnode_on_mouse_up` | field | `LGraphNode.onMouseUp` | 0 | 0 | long-tail |
| `lgraphnode_on_node_input_add` | field | `LGraphNode.onNodeInputAdd` | 0 | 0 | long-tail |
| `lgraphnode_on_node_output_add` | field | `LGraphNode.onNodeOutputAdd` | 0 | 0 | long-tail |
| `lgraphnode_on_node_title_dbl_click` | field | `LGraphNode.onNodeTitleDblClick` | 0 | 0 | long-tail |
| `lgraphnode_on_output_added` | field | `LGraphNode.onOutputAdded` | 0 | 0 | long-tail |
| `lgraphnode_on_output_click` | field | `LGraphNode.onOutputClick` | 0 | 0 | long-tail |
| `lgraphnode_on_output_dbl_click` | field | `LGraphNode.onOutputDblClick` | 0 | 0 | long-tail |
| `lgraphnode_on_output_removed` | field | `LGraphNode.onOutputRemoved` | 0 | 0 | long-tail |
| `lgraphnode_on_property_change` | field | `LGraphNode.onPropertyChange` | 0 | 0 | long-tail |
| `lgraphnode_on_show_custom_panel_info` | field | `LGraphNode.onShowCustomPanelInfo` | 0 | 0 | long-tail |
| `lgraphnode_on_title_button_click` | method | `LGraphNode.onTitleButtonClick` | 0 | 0 | long-tail |

## Risk

**Low** — the rubric only fires `DELETE-NOW` + `delete-immediately` for surfaces with zero internal AND zero external callers. Mechanically safe to remove. (See **§Risk rubric (applied)** in the audit doc.)

## Action items

- [ ] Group by file (most are `LGraph.ts` / `LGraphNode.ts` / `LGraphCanvas.ts` field declarations) to keep the diff readable.
- [ ] Several surfaces may share file location with KEEP surfaces — preserve surrounding fields, only delete the rows from this issue.
- [ ] One PR per file is fine; one PR for the whole batch is also fine. Caller's choice based on diff size.
- [ ] Verify `pnpm lint && pnpm format:check && pnpm knip`.

## Sequencing

Per the framing doc, deletions happen **after Phase B ECS migration lands** (Alex's `#11939` and `#11811`). This is a tracking issue, not a green-light to ship before that gate.

## Caveats

The internal-usage CSV uses leaf-symbol regex (`\b\b`) and may overcount where DOM/Vue handlers share a name with an LGraph hook. Counts shown above are upper bounds; **a zero internal_count is still zero** under any tightening, so the verdict stands. Caller should still grep each symbol in context before removing the field declaration just to be sure no `// @ts-expect-error` reaches into a renamed/aliased import.

cc @drjkl

┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-12224-AUDIT-LG-delete-dead-LGraph-LGraphNode-LGraphCanvas-event-hooks-35-surfaces-35f6d73d3650819aa5b7fb98e0f2358c) by [Unito](https://www.unito.io)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.