From 09565acc1e61ba6c67692ce78e164277500b5f69 Mon Sep 17 00:00:00 2001 From: PewDiePie <229018391+pewdiepie-archdaemon@users.noreply.github.com> Date: Mon, 8 Jun 2026 21:41:25 +0900 Subject: [PATCH] Revert "feat(model-picker): add remove-from-recent button to Recent section rows (#2894)" (#3437) This reverts commit 2a422c00ecbdbf6035fedf2400e76698db94d857. Co-authored-by: pewdiepie-archdaemon --- static/js/modelPicker.js | 32 ++++---------------------------- static/style.css | 28 ---------------------------- 2 files changed, 4 insertions(+), 56 deletions(-) diff --git a/static/js/modelPicker.js b/static/js/modelPicker.js index a0e7095c6..84656c7d0 100644 --- a/static/js/modelPicker.js +++ b/static/js/modelPicker.js @@ -35,11 +35,6 @@ function _pushRecent(mid) { next.unshift(mid); _saveList(RECENT_KEY, next.slice(0, RECENT_MAX)); } -function _removeRecent(mid) { - if (!mid) return; - const next = _loadRecent().filter(x => x !== mid); - _saveList(RECENT_KEY, next); -} function _loadFavorites() { return _loadList(FAVORITES_KEY); } function _toggleFavorite(mid) { const favs = _loadFavorites(); @@ -309,7 +304,7 @@ function _initModelPickerDropdown() { empty.textContent = text; listEl.appendChild(empty); } - function _addRow(m, onRemove) { + function _addRow(m) { const row = document.createElement('div'); row.className = 'model-switch-item'; if (m.stale) { @@ -381,20 +376,6 @@ function _initModelPickerDropdown() { }); row.appendChild(favDot); - // Remove-from-recent button (shown only for Recent section items). - if (onRemove) { - const rmBtn = document.createElement('button'); - rmBtn.type = 'button'; - rmBtn.className = 'mp-remove-dot'; - rmBtn.textContent = '×'; - rmBtn.title = 'Remove from recent'; - rmBtn.addEventListener('click', (e) => { - e.stopPropagation(); - onRemove(); - }); - row.appendChild(rmBtn); - } - row.addEventListener('click', () => _pick(m)); listEl.appendChild(row); } @@ -411,7 +392,8 @@ function _initModelPickerDropdown() { return; } - // ── Browse mode: sections in order: Favorites → Recent (big catalogs only) → All / Providers ── + // ── Browse mode: Favorites (manual) + Recent (auto), with dedupe. ── + // Rules: // 1. Never list the same model twice in the dropdown. Favorites // win over Recent (if you favorited it, that's where it // belongs — Recent shouldn't show it again as duplicate). @@ -436,13 +418,7 @@ function _initModelPickerDropdown() { .slice(0, RECENT_MAX); if (recentModels.length) { _addSection('Recent'); - recentModels.forEach(m => { - shown.add(m.mid); - _addRow(m, () => { - _removeRecent(m.mid); - _populate(''); - }); - }); + recentModels.forEach(m => { shown.add(m.mid); _addRow(m); }); } } diff --git a/static/style.css b/static/style.css index e711876bd..a5a724f16 100644 --- a/static/style.css +++ b/static/style.css @@ -2940,34 +2940,6 @@ body.bg-pattern-sparkles { 45% { text-shadow: 0 0 10px color-mix(in srgb, var(--accent, var(--red)) 60%, transparent); } 100% { text-shadow: 0 0 0 color-mix(in srgb, var(--accent, var(--red)) 0%, transparent); } } - /* Inline remove-from-recent button — only shown on Recent rows. */ - .model-picker-list .mp-remove-dot { - flex: 0 0 auto; - display: inline-flex; - align-items: center; - justify-content: center; - width: 24px; - height: 24px; - margin: -4px -4px -4px 2px; - padding: 0; - border: none; - background: transparent; - cursor: pointer; - color: color-mix(in srgb, var(--fg) 28%, transparent); - font-family: inherit; - font-size: 15px; - line-height: 1; - transition: color 0.15s ease, opacity 0.15s ease, transform 0.12s ease; - -webkit-tap-highlight-color: transparent; - } - .model-picker-list .mp-remove-dot:hover { - color: var(--red, #ff5555); - transform: scale(1.1); - } - .model-picker-list .mp-remove-dot:focus-visible { - outline: none; - color: var(--red, #ff5555); - } /* First-run hint when a large catalog has no Recent/Favorites yet. */ .model-picker-list .mp-empty-hint { flex-direction: column;