Commit Graph

531 Commits

Author SHA1 Message Date
Cita 62eca41bc2 refactor: extract settings portal modals 2026-03-23 13:18:37 +08:00
Cita f7a7084278 refactor: share responsive batch actions across admin pages 2026-03-23 13:12:06 +08:00
Cita b82d7c31d9 refactor: derive legacy schema compat from feature specs 2026-03-23 13:04:09 +08:00
Cita 55aea6afc4 refactor: separate brand registry from BrandIcon 2026-03-23 12:44:38 +08:00
Cita 8b3653c7c9 refactor: share schema metadata normalization rules 2026-03-23 12:23:04 +08:00
Cita 86518202fa refactor: move platform discovery out of model service 2026-03-23 12:14:22 +08:00
Cita 50c34b8866 refactor: keep downstream client metadata on cli profiles 2026-03-23 12:02:44 +08:00
Cita 3877f3a3f1 refactor: centralize oauth identity and route refresh workflow 2026-03-23 11:53:59 +08:00
Cita 328b492ab3 fix: finish review-driven single-source cleanup 2026-03-23 11:26:01 +08:00
Cita a3b061b60f Merge pull request #245 from cita-777/codex/site-binding-conflict
fix: handle duplicate site binding conflicts
2026-03-23 09:20:58 +08:00
Cita f5892b9656 Merge pull request #241 from Hureru/feat/model-filter-system
feat: add model filter system and route page performance optimization
2026-03-23 00:19:29 +08:00
Cita 90e9140c70 fix: preserve site disabled models on partial load failure 2026-03-22 23:58:43 +08:00
Cita 29c9fcbd29 fix: resolve remaining review follow-ups 2026-03-22 23:53:41 +08:00
Cita 5d78658af9 fix: address review feedback and code scanning alerts 2026-03-22 23:41:45 +08:00
Hureru 9a5e2bbc60 fix: prevent brand list loading indicator from hanging on API failure 2026-03-22 23:13:51 +08:00
Cita daa6a01ccf fix: handle duplicate site binding conflicts 2026-03-22 22:18:44 +08:00
Cita 32d7037629 refactor: share platform file and route helpers 2026-03-22 22:17:50 +08:00
Cita 9290e51ecc refactor: consolidate single-source routing and protocol helpers 2026-03-22 21:27:09 +08:00
Cita 96e7614835 fix: trust proxy headers and align proxy file mysql indexes 2026-03-22 21:17:56 +08:00
Hureru d278b41be2 fix: address review issues in brand filter sync, model guard, route counts, and candidate loading
- Sync blockedBrands local state after save to prevent stale chips
- Defer getBrandList from blocking Settings bootstrap
- Guard model management UI on brandGroups instead of availableModels
- Deduplicate single-model add in disabled models
- Skip read-only/zero-channel routes in enabledCounts and filter
- Add sequence counter to loadCandidates to prevent force race condition
- Use stableAddChannel for mobile add-channel button
2026-03-22 20:44:55 +08:00
Hureru b8ad89d1ab fix: use ref-based stale guard for site disabled-models fetch
Replace closure-captured editor check with loadingModelsSiteIdRef so the
stale-response guard works correctly across rapid site switches. Also
gate setDisabledModelsLoading(false) behind the same ref check.
2026-03-22 20:26:45 +08:00
Hureru 26be7c024a fix: address review issues across settings, sites, brand matcher, and token routes
- settings.ts: trigger route rebuild after globalBlockedBrands changes in both
  import and PUT handler; reject non-array payloads with 400 instead of silently
  defaulting to empty array
- sites.ts: trim model names before deduplication so whitespace variants merge
- brandMatcher.ts: align boundary regex with frontend delimiter class [/:_\-\s]
- Settings.tsx: add role="switch" and aria-checked to brand filter chips; make
  getBrandList best-effort so its failure doesn't block page load
- Sites.tsx: build brandGroups from union of availableModels and disabledModels
  so legacy/removed models remain visible; add stale-response guard and error
  logging for disabled/available model fetches
- TokenRoutes.tsx: use baseFilteredRoutes.length for totalRouteCount to keep
  enabled/disabled counts in sync with status filter; add candidatesVersionRef
  to invalidate lazy caches on payload change; add per-channel in-flight guard
  on toggle; invalidate channel cache after rebuild and site-block operations
2026-03-22 20:18:50 +08:00
Hureru 911d76fa08 fix: add channel toggle and site-block buttons to mobile channel row 2026-03-22 19:27:43 +08:00
Hureru 2f8dae70c2 fix: add missing onToggleChannelEnabled and onSiteBlockModel props to mobile RouteCard 2026-03-22 19:18:44 +08:00
Hureru 3195282c4e fix: address review issues in TokenRoutes performance optimization
- Escape modelName/siteName in innerHTML to prevent XSS
- Use content-based routePatternsKey for cache invalidation instead of
  length-only keys that miss content changes
- Extract shared baseFilteredRoutes to eliminate duplicated filter logic
  between enabledCounts and filteredRoutes
- Add candidatesPromiseRef to deduplicate concurrent loadCandidates calls
2026-03-22 19:12:50 +08:00
Hureru 92fd5e034d perf: defer token-candidates loading and lazy-compute heavy route indices
The routes page loaded ~924KB of API data upfront (summary 366KB +
token-candidates 558KB), but token-candidates was only needed when
expanding cards, opening panels, or using filters. This caused a ~3s
element render delay blocking LCP.

Changes:
- Split load() so first paint only fetches routesSummary (366KB)
- Preload token-candidates in background via requestIdleCallback
- Wrap candidates state updates in startTransition to avoid UI jank
- Convert 3 heavy O(routes×models) useMemo indices to lazy per-route
  computation with ref-based cache (candidateIndex, missingTokenIndex,
  missingTokenGroupIndex)
- Guard 4 ManualRoutePanel-only useMemos with showManual check
- Convert 2 derived useMemos to per-route getter functions
- Add loadCandidates() calls at 7 interaction trigger points
2026-03-22 19:00:03 +08:00
Hureru d2db989b98 fix: add bottom border to channel rows for clearer separation 2026-03-22 19:00:02 +08:00
Hureru 835fccb4f5 fix: align site-block and delete buttons in channel row grid layout
Wrap site-block and delete buttons in a flex container and expand grid
to 4 columns so all action buttons stay on the same row.
2026-03-22 18:59:04 +08:00
Hureru 4415317bdc fix: align brand matcher with frontend logic and remove manual model input
- brandMatcher: port collectBrandCandidates + buildMatchContext from
  frontend BrandIcon.tsx so matching is identical between route display
  and rebuild filtering; segments now split on /,:,\s only (not - or _),
  and candidates are recursively generated from /,:,, splits
- Sites.tsx: remove manual model name input and handleAddDisabledModel;
  the checkbox-based batch selection UI fully replaces it
2026-03-22 18:55:40 +08:00
Hureru f14ffd7dc9 fix: address review issues in model filter system
- brandMatcher: split keywords into includes/startsWith/segment/boundary
  modes to align with frontend BrandIcon.tsx matching semantics, preventing
  false-positive blocking from short keywords like o1, tts, command
- handleSiteBlockModel: reject wildcard route patterns (e.g. gpt-*) from
  being written to site disabled list; only allow exact model names
- Sites.tsx: extract brand grouping to useMemo, convert disabledModels
  to Set for O(1) lookup, remove duplicate IIFE computations in JSX
- handleSiteBlockModel: replace window.confirm with project-style DOM
  dialog for visual consistency
- enabledCounts: compute from filtered scope (excluding enabled filter
  itself) so counts reflect current brand/site/search filters
- Fix declaration order: move enabledCounts after sortedRoutes to avoid
  ReferenceError
2026-03-22 18:55:40 +08:00
Hureru cf6ed7db91 feat: add model filter system with site-level batch disable, global brand filter, route status filter, and channel site-block shortcut
- Route status filter: add enabled/disabled filter chips to RouteFilterBar
- Channel site-block: add "站点屏蔽" button on channel rows to quickly
  add a model to a site's disabled list and trigger rebuild
- Site batch selection: new GET /api/sites/:id/available-models endpoint;
  Sites.tsx now shows a brand-grouped checkbox list for batch model disable
- Global brand filter: new brandMatcher.ts service; settings API and UI
  for blocking entire brands from route generation
- Fix infinite scroll race condition when sentinel ref is null during
  IntersectionObserver effect setup after filter changes
2026-03-22 18:55:40 +08:00
Cita 3cc6b7be45 Merge pull request #238 from cita-777/codex/mobile-panel-refactor-final
feat: overhaul mobile management layouts
2026-03-21 20:47:56 +08:00
Cita 09fbf258e2 feat: overhaul mobile management layouts 2026-03-21 20:42:25 +08:00
Cita c64a760b69 Merge pull request #237 from cita-777/codex/codex-review-fixes
fix: harden codex runtime routing and oauth recovery
2026-03-21 20:40:07 +08:00
Cita a81965176f fix: preserve inactive availability after main merge 2026-03-21 20:34:52 +08:00
Cita 3775ee059c Merge remote-tracking branch 'origin/main' into codex/codex-review-fixes
# Conflicts:
#	src/server/services/modelService.ts
2026-03-21 20:31:30 +08:00
Cita fa372d121a fix: preserve availability on inactive refresh failure 2026-03-21 20:27:18 +08:00
Cita 4c14f9c9b0 Merge pull request #234 from cita-777/codex/gemini-oauth-hardening
Fix Gemini OAuth refresh and failure coverage
2026-03-21 20:13:08 +08:00
Cita 4480f504e4 fix: satisfy server build typing 2026-03-21 19:58:41 +08:00
Cita d9e550c279 fix: address codex review findings 2026-03-21 19:45:29 +08:00
Cita b7a1e523e7 fix: reuse oauth singleflight in gemini discovery 2026-03-21 19:29:33 +08:00
Cita e09fb43b33 Merge pull request #236 from cita-777/codex/claude-count-models
Fix Claude count_tokens compatibility and OAuth model discovery
2026-03-21 19:28:18 +08:00
Cita c7ba436685 Merge pull request #235 from cita-777/codex/gemini-multimodal-routing
fix: keep gemini multimodal routing off endpoint memory
2026-03-21 19:27:36 +08:00
Cita 1d8889001f fix: harden codex runtime routing and oauth recovery 2026-03-21 19:07:14 +08:00
Cita dc93c58582 Fix Claude count tokens routing and model discovery 2026-03-21 18:42:28 +08:00
Cita dd48550ffa Fix Gemini OAuth refresh and failure coverage 2026-03-21 18:38:00 +08:00
Cita 500ba25787 fix: bypass multimodal endpoint memory for gemini 2026-03-21 18:37:36 +08:00
Cita 6a19d809f0 Merge pull request #233 from cita-777/codex/login-surface-pr
feat(web): redesign login surface
2026-03-21 17:17:51 +08:00
Cita 781c44140f Merge pull request #232 from cita-777/codex/backup-config-semantics-v21
fix: refine config backup import semantics
2026-03-21 17:12:53 +08:00
ciat-777 719e21cce7 feat(web): redesign login surface 2026-03-21 17:12:11 +08:00