feat(ui): enhance model select modal UX and modal traffic lights (#1111)

* feat(model-select-modal): highlight added models and support bulk selection

- Add addedModelValues prop to highlight already-added models with primary color
- Sort models alphabetically per provider, with added models floated to top
- Replace green highlight with primary brand color (orange #E56A4A)
- Use check icon (10px) inline with model name instead of check_circle
- Replace Done button with info bar explaining click-to-toggle behavior
- Add ProviderIcon to provider group headers replacing colored dot
- Import ProviderIcon, remove unused Button import

* feat(cli-tools): wire addedModelValues, onDeselect, and auto-save to model select modals

- Pass selectedModels as addedModelValues to ModelSelectModal in OpenCode and Copilot cards
- Add onDeselect handler to remove model from list on second click
- Set closeOnSelect=false to allow bulk model selection
- Remove manual setModalOpen(false) from onSelect callbacks
- Add saveModels() silent auto-save triggered on modal close (OpenCodeToolCard)
- Use useRef to track latest selectedModels in closure-safe way

* feat(modal): functional traffic light close button with hover icon and tooltip

- Make red dot a clickable button that closes the modal
- Show ✕ icon inside red dot on hover via group-hover opacity transition
- Gray out yellow and green dots (cursor-not-allowed, no tooltip)
- Increase dot size from w-3 h-3 to w-4 h-4
- Add Tooltip with brand-matched color #FF5F56 on red dot
- Remove X close button from modal header

* feat(tooltip): add color prop for themed tooltip backgrounds

* feat(i18n): add translations for model select info bar and close tooltip

- Add 'Click to add, click again to remove. Changes are saved automatically.' to all 32 locales
- Add 'Close' translation to all 32 locales

* fix(ui): address code review feedback on modal UX and auto-save

- Modal: remove showCloseButton prop, use showTrafficLights for header
  condition, hide traffic lights on mobile (hidden md:flex), add mobile
  X button (md:hidden) with aria-label, add aria-label and title on
  traffic light close button
- OpenCodeToolCard: validate activeModel membership before saving —
  fallback to models[0] or empty string; clear/reassign activeModel
  on deselect when removed model was the active one
- CopilotToolCard: add useRef + selectedModelsRef, add saveModels()
  using /api/cli-tools/copilot-settings, wire auto-save on modal close
- ModelSelectModal: fix JSX formatting — separate info bar closing div
  from Search comment onto its own line
This commit is contained in:
Rigel Ramadhani Waloni
2026-05-15 09:21:24 +07:00
committed by GitHub
parent 4098f91ac5
commit 1fd3132647
37 changed files with 209 additions and 276 deletions

View File

@@ -12,7 +12,7 @@
"Logout": "لاگ آؤٹ",
"Login": "لاگ ان",
"Providers": "فراہم کنندگان",
"Usage": "استعمال",
"Usage": "استعمال کے اعدادوشمار",
"API Key": "API کلید",
"Connected": "منسلک",
"Disconnected": "منقطع",
@@ -91,9 +91,7 @@
"Dark": "تاریک",
"Auto": "خودکار",
"Endpoint": "اختتام نقطہ",
"Providers": "فراہم کنندگان",
"Combos": "امتزاجات",
"Usage": "استعمال کے اعدادوشمار",
"Quota Tracker": "کوٹہ ٹریکر",
"MITM": "MITM",
"CLI Tools": "آلات",
@@ -150,7 +148,6 @@
"No Proxy": "کوئی پروکسی نہیں",
"Comma-separated hostnames/domains to bypass the proxy.": "پروکسی کو نظر انداز کرنے کے لیے کوما سے الگ شدہ ہوسٹ ناموں/ڈومین۔",
"Test proxy URL": "پروکسی URL کو ٹیسٹ کریں",
"Apply": "لاگو کریں",
"Proxy settings applied": "پروکسی ترتیبات لاگو کی گئیں",
"Proxy enabled": "پروکسی فعال",
"Proxy disabled": "پروکسی غیر فعال",
@@ -178,7 +175,6 @@
"Use Antigravity IDE & GitHub Copilot → with ANY provider/model from 9Router": "Antigravity IDE اور GitHub Copilot استعمال کریں → 9Router سے کسی بھی فراہم کنندہ/ماڈل کے ساتھ",
"How it works:": "یہ کیسے کام کرتا ہے:",
"Antigravity/Copilot IDE request → DNS redirect to localhost:443 → MITM proxy intercepts → 9Router → response to Antigravity/Copilot": "Antigravity/Copilot IDE درخواست → DNS کو localhost:443 کی طرف ری ڈائریکٹ کریں → MITM پروکسی روکے → 9Router → Antigravity/Copilot کو جواب",
"API Key": "API کلید",
"No API keys — create one in Keys page": "کوئی API کلید نہیں — Keys صفحہ میں ایک بنائیں",
"sk_9router (default)": "sk_9router (ڈیفالٹ)",
"Server started": "سرور شروع ہوگیا",
@@ -192,5 +188,5 @@
"Sudo Password Required": "Sudo پاس ورڈ درکار ہے",
"Enter your sudo password to start/stop MITM server": "MITM سرور شروع/بند کرنے کے لیے اپنا sudo پاس ورڈ داخل کریں",
"Sudo Password": "Sudo پاس ورڈ",
"Confirm": "تصدیق کریں"
"Click to add, click again to remove. Changes are saved automatically.": "شامل کرنے کے لیے کلک کریں، ہٹانے کے لیے دوبارہ کلک کریں۔ تبدیلیاں خودکار طور پر محفوظ ہو جاتی ہیں۔"
}