Comfy-Org / Comfy-Org/ComfyUI_frontend
Toast duration and tooltip delay magic numbers across 100+ files
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 699
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 490
Description
## Recommendation
### ♻️ REFACTOR: Define named constants for toast durations and tooltip delays
Raw numbers are scattered across the codebase with no named constants.
## What Was Found
### Toast `life:` Magic Numbers — 99 Occurrences
- Scattered across 48+ files (e.g., `useCoreCommands.ts`, `useFirebaseAuthActions.ts`, `useSelectionOperations.ts`)
- 8 distinct values: `1000`, `2000`, `3000`, `5000` etc. with no constants
- **Suggestion:** Define `TOAST_DURATION = { SHORT: 1000, DEFAULT: 3000, LONG: 5000 }` in a constants file
### Tooltip `showDelay` Overrides — 62 Files
- `useTooltipConfig` composable exists and defines `showDelay: 300`
- But 62 files hardcode inline `showDelay:` values (1000, 300, etc.)
- **Suggestion:** Use `useTooltipConfig()` consistently with named presets
## Context
These magic numbers make it impossible to adjust timing globally and create inconsistent UX.
**Estimated effort:** ~2-3 hours
---
**Category:** Refactoring Opportunity | **Confidence:** HIGH | **Tools:** Semantic analysis
_Filed by audit-code skill_
Part of #11022
┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-11056-Toast-duration-and-tooltip-delay-magic-numbers-across-100-files-33e6d73d365081ffac8ddabade7ff35f) by [Unito](https://www.unito.io)
Contributor guide
Assessment
This issue has not been assessed yet.