fix: scope selector UX, ARIA, and code quality improvements

- removeScope preserves graph state when items remain (only resets on empty)
- Extract shared CheckIcon, CloseIcon, Spinner, ScopeListItem components
- Unify three handleSelect* into single handleToggle
- Fix shared mutable Set in reset state (factory function)
- Add MAX_SCOPE_ITEMS UI feedback (disabled button, warning banner)
- Correct ARIA: dialog > tablist + listbox > option structure
- Event listeners only attached when dropdown is open
- isSelected uses Set lookup via useMemo instead of O(n) scan
- Clear user search only on add, not on deselect
This commit is contained in:
Fringg
2026-03-20 02:44:29 +03:00
parent db76cd0c64
commit 2780898d1c
6 changed files with 230 additions and 229 deletions

View File

@@ -1143,7 +1143,8 @@
"noResults": "نتیجه‌ای یافت نشد",
"removeItem": "حذف {{label}}",
"clearAll": "پاک کردن همه انتخاب‌ها",
"addScope": "افزودن محدوده"
"addScope": "افزودن محدوده",
"maxReached": "حداکثر {{max}} مورد"
},
"loading": "بارگذاری گراف...",
"error": "خطا در بارگذاری داده‌های شبکه",