diff --git a/README.md b/README.md index 4a2d6d7..fa9e28c 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ File names: Latin letters, digits, `.`, `_` and `-`. Up to 8 MB per file and static mirror of the API's /catalog for Keira devices lilka-catalog-api (api/, Cloudflare) - Worker + D1 + R2 apps, versions, files, users, ratings, moderation + Worker + D1 + R2 apps, versions, files, users, moderation GitHub Actions ClamAV scan, icon_min, image compression, package.zip ``` diff --git a/README.uk.md b/README.uk.md index e119de1..5ad4524 100644 --- a/README.uk.md +++ b/README.uk.md @@ -48,7 +48,7 @@ scripts/mirror_api.py копіює каталог з API на Pages для пр статичне дзеркало /catalog для пристроїв Keira lilka-catalog-api (Cloudflare) - Worker + D1 + R2 застосунки, версії, файли, користувачі, оцінки, модерація + Worker + D1 + R2 застосунки, версії, файли, користувачі, модерація GitHub Actions ClamAV, icon_min, стиснення зображень, package.zip ``` diff --git a/api/README.md b/api/README.md index 9918ba1..8c5d693 100644 --- a/api/README.md +++ b/api/README.md @@ -22,7 +22,7 @@ flowchart LR subgraph CF["lilka-catalog-api · Cloudflare Worker (api/)"] API["API routes
/auth · /apps · /mod · /scan"] CAT["/catalog/…
/catalog/export.json"] - D1[("D1
users · sessions · apps
versions · ratings · reports")] + D1[("D1
users · sessions · apps
versions · reports")] R2[("R2
<id>-<name>/v/<version>/<file>")] end @@ -175,7 +175,6 @@ All bodies are JSON unless noted. Authenticated calls send | POST | `/apps` | user | Create draft; `kind`: `app`, `wallpaper` or `mod` | | PATCH | `/apps/:slug` | owner, mod | Edit metadata, `status: hidden \| published`; moderators also `author`, `owner` (login) | | POST | `/apps/:slug/versions` | owner, mod | Multipart: `version`, `keira_version`, `entry_type` (`lua`, `js`, `binary`, `archive`), `changelog`, files `entry`, `files[]`, `icon`, `screenshots[]`. Mods: no entry, model files as `files[]` | -| PUT | `/apps/:slug/rating` | user (not owner) | `{ "stars": 1..5 }` | | POST | `/apps/:slug/reports` | user | `{ "reason": "..." }` | | GET | `/users/:login/apps[?versions]` | user | Apps of a user (all of them, with versions, for the user themself or a moderator) | | GET | `/files/:slug/:version/:name` | owner, mod | File by version id, for "My apps" and moderation previews | diff --git a/api/scripts/smoke.sh b/api/scripts/smoke.sh index be48a78..9af0d32 100755 --- a/api/scripts/smoke.sh +++ b/api/scripts/smoke.sh @@ -93,8 +93,6 @@ call 404 "approved file is not served to strangers" "${fan[@]}" "$API/files/smok call 200 "owner gets the approved file" "${user[@]}" "$API/files/smoke-hello/$version_id/hello.lua" call 200 "HEAD for the owner" -I "${user[@]}" "$API/files/smoke-hello/$version_id/hello.lua" -call 403 "owner cannot rate own app" "${user[@]}" "${json[@]}" -X PUT "$API/apps/smoke-hello/rating" -d '{"stars":5}' -call 200 "rate" "${fan[@]}" "${json[@]}" -X PUT "$API/apps/smoke-hello/rating" -d '{"stars":4}' call 201 "report" "${fan[@]}" "${json[@]}" -X POST "$API/apps/smoke-hello/reports" -d '{"reason":"smoke"}' call 200 "open reports" "${mod[@]}" "$API/mod/reports" @@ -114,9 +112,9 @@ jq -e '."@smoke-dev"[0].path == "smoke-hello"' "$work/body" >/dev/null || { echo call 404 "catalog unknown kind" "${mirror[@]}" "$API/catalog/games/index_0.json" call 401 "listing.json needs the mirror secret" "$API/catalog/apps/listing.json" call 200 "listing.json for the site" "${mirror[@]}" "$API/catalog/apps/listing.json" -jq -e '.items[] | select(.path == "smoke-hello") | (.added != null) and (.updated != null) and .rating.average == 4 and .rating.count == 1 and .author == "@smoke-dev"' \ +jq -e '.items[] | select(.path == "smoke-hello") | (.added != null) and (.updated != null) and .author == "@smoke-dev"' \ "$work/body" >/dev/null && li=ok || li="$(jq -c '.items[] | select(.path == "smoke-hello")' "$work/body")" -check "listing has dates, rating and author" ok "$li" +check "listing has dates and author" ok "$li" pub=$(npx wrangler d1 execute lilka-catalog --local --json --command "SELECT published_at FROM apps WHERE slug = 'smoke-hello'" 2>/dev/null | jq -r '.[0].results[0].published_at') check "published_at set on first approval" ok "$([ -n "$pub" ] && [ "$pub" != null ] && echo ok || echo missing)" diff --git a/api/src/apps.ts b/api/src/apps.ts index 35ad355..f660997 100644 --- a/api/src/apps.ts +++ b/api/src/apps.ts @@ -42,8 +42,6 @@ export interface AppRow { updated_at: string; owner_login: string; owner_avatar: string | null; - rating_avg: number | null; - rating_count: number; } export interface VersionRow { @@ -74,9 +72,7 @@ export interface VersionRow { } export const APP_SELECT = ` - SELECT a.*, u.login AS owner_login, u.avatar_url AS owner_avatar, - (SELECT AVG(stars) FROM ratings r WHERE r.app_id = a.id) AS rating_avg, - (SELECT COUNT(*) FROM ratings r WHERE r.app_id = a.id) AS rating_count + SELECT a.*, u.login AS owner_login, u.avatar_url AS owner_avatar FROM apps a JOIN users u ON u.id = a.owner_id`; export function fileUrl(env: Env, slug: string, versionId: number, name: string): string { @@ -145,7 +141,6 @@ export function serializeApp(env: Env, a: AppRow, latest: VersionRow | null) { sources_url: a.sources_url, license: a.license, owner: { login: a.owner_login, avatar_url: a.owner_avatar }, - rating: { average: a.rating_avg === null ? null : Math.round(a.rating_avg * 10) / 10, count: a.rating_count }, latest_version: latest ? serializeVersion(env, a.slug, latest, false) : null, created_at: a.created_at, updated_at: a.updated_at, @@ -297,18 +292,9 @@ apps.get('/:slug', async (c) => { .all(); const latest = results.find((v) => v.status === 'approved') ?? null; - let myRating: number | null = null; - if (user) { - const row = await c.env.DB.prepare(`SELECT stars FROM ratings WHERE app_id = ? AND user_id = ?`) - .bind(app.id, user.id) - .first<{ stars: number }>(); - myRating = row?.stars ?? null; - } - return c.json({ ...serializeApp(c.env, app, latest), can_manage: manage, - my_rating: myRating, versions: results.map((v) => serializeVersion(c.env, app.slug, v, manage)), }); }); @@ -492,25 +478,6 @@ apps.post('/:slug/versions', async (c) => { return c.json(serializeVersion(c.env, app.slug, created!, true), 201); }); -apps.put('/:slug/rating', async (c) => { - const user = requireUser(c); - const app = await findApp(c.env, c.req.param('slug')); - if (!app || app.status !== 'published') fail(404, 'app not found'); - if (app.owner_id === user.id) fail(403, 'cannot rate your own app'); - const { stars } = await readJson<{ stars?: unknown }>(c); - if (typeof stars !== 'number' || !Number.isInteger(stars) || stars < 1 || stars > 5) { - fail(400, 'stars must be an integer from 1 to 5'); - } - await c.env.DB.prepare( - `INSERT INTO ratings (app_id, user_id, stars) VALUES (?, ?, ?) - ON CONFLICT (app_id, user_id) DO UPDATE SET stars = excluded.stars, updated_at = datetime('now')`, - ) - .bind(app.id, user.id, stars) - .run(); - const updated = await findApp(c.env, app.slug); - return c.json({ average: updated!.rating_avg, count: updated!.rating_count, my_rating: stars }); -}); - apps.post('/:slug/reports', async (c) => { const user = requireUser(c); const app = await findApp(c.env, c.req.param('slug')); diff --git a/api/src/catalog.ts b/api/src/catalog.ts index 0a5cd11..75c5916 100644 --- a/api/src/catalog.ts +++ b/api/src/catalog.ts @@ -29,7 +29,6 @@ interface CatalogRow extends AppRow { v_id: number; published_at: string | null; approved_at: string | null; - rating_sum: number | null; keira_version: string | null; entry_type: string | null; entry_file: string | null; @@ -61,11 +60,10 @@ async function published(env: Env, kind?: AppRow['kind'], slug?: string): Promis `SELECT a.*, u.login AS owner_login, u.avatar_url AS owner_avatar, v.id AS v_id, v.keira_version, v.entry_type, v.entry_file, v.files, v.files_meta, v.icon, v.icon_min, v.screenshots, v.changelog, v.changelog_en, v.package, v.security, v.storage_prefix, - v.approved_at, COALESCE(r.n, 0) AS rating_count, r.total AS rating_sum + v.approved_at FROM apps a JOIN users u ON u.id = a.owner_id JOIN versions v ON v.id = a.latest_version_id - LEFT JOIN (SELECT app_id, COUNT(*) AS n, SUM(stars) AS total FROM ratings GROUP BY app_id) r ON r.app_id = a.id WHERE ${where.join(' AND ')} ORDER BY a.slug COLLATE BINARY`, ) @@ -231,7 +229,7 @@ function authorsDoc(rows: CatalogRow[]): Record { * listing.json: everything the website's list needs for one kind, in one file. * * Not part of the old build.py layout and not read by Keira, so it can carry - * what the catalog list sorts by (dates, rating) without touching the + * what the catalog list sorts by (dates, author) without touching the * manifests devices parse. It also turns a list page from 1 index plus 12 * manifests into one request. */ @@ -247,10 +245,6 @@ function listingDoc(rows: CatalogRow[]) { icon: row.icon ?? '', added: row.published_at ?? row.approved_at, updated: row.approved_at, - rating: { - average: row.rating_count ? Math.round((row.rating_sum! / row.rating_count) * 10) / 10 : null, - count: row.rating_count, - }, }; if (Object.keys(loc).length) { entry.languages = Object.keys(loc); diff --git a/site/community.js b/site/community.js index 99df74f..0a2aa7e 100644 --- a/site/community.js +++ b/site/community.js @@ -74,7 +74,6 @@ const COMMUNITY_STRINGS = { 'view-in-catalog': 'Відкрити в каталозі', 'versions': 'Версії', 'no-versions': 'Версій ще немає.', - 'rating': '★ {average} ({count})', 'status-draft': 'чернетка', 'status-published': 'опубліковано', 'status-hidden': 'приховано', @@ -84,18 +83,6 @@ const COMMUNITY_STRINGS = { 'status-rejected': 'відхилено', 'status-infected': 'знайдено загрозу', 'review-note': 'Коментар модератора', - 'rating-title': 'Оцінка', - 'rating-none': 'Ще ніхто не оцінив.', - // Plural forms by Intl.PluralRules: one / few / many (and other) - 'rating-summary-one': '★ {average} · {count} оцінка', - 'rating-summary-few': '★ {average} · {count} оцінки', - 'rating-summary-many': '★ {average} · {count} оцінок', - 'rating-summary-other': '★ {average} · {count} оцінки', - 'rating-yours': 'Ваша оцінка:', - 'rating-star': '{n} з 5', - 'rating-sign-in': 'Увійдіть, щоб оцінити', - 'rating-thanks': 'Дякуємо! Ваша оцінка ({stars}★) з’явиться в списку протягом години.', - 'rating-own': 'Свій застосунок оцінити не можна.', 'files-removed': 'Файли цієї версії видалено після відхилення.', 'file-gone': 'Цього файлу вже немає.', 'scan-detail': 'Результат антивірусу', @@ -196,7 +183,6 @@ const COMMUNITY_STRINGS = { 'view-in-catalog': 'Open in catalog', 'versions': 'Versions', 'no-versions': 'No versions yet.', - 'rating': '★ {average} ({count})', 'status-draft': 'draft', 'status-published': 'published', 'status-hidden': 'hidden', @@ -206,15 +192,6 @@ const COMMUNITY_STRINGS = { 'status-rejected': 'rejected', 'status-infected': 'threat found', 'review-note': 'Moderator note', - 'rating-title': 'Rating', - 'rating-none': 'No ratings yet.', - 'rating-summary-one': '★ {average} · {count} rating', - 'rating-summary-other': '★ {average} · {count} ratings', - 'rating-yours': 'Your rating:', - 'rating-star': '{n} of 5', - 'rating-sign-in': 'Sign in to rate', - 'rating-thanks': 'Thanks! Your rating ({stars}★) shows in the list within an hour.', - 'rating-own': 'You cannot rate your own app.', 'files-removed': 'The files of this version were deleted when it was rejected.', 'file-gone': 'This file is no longer available.', 'scan-detail': 'Antivirus result', @@ -491,64 +468,6 @@ class CommunityUI { } } - // --- Rating in the details view ------------------------------------------ - - // The average comes from listing.json on Pages (no Worker request); only - // sending a rating calls the API. The list picks it up on the next mirror run. - async mountRating(modalBody, type, slug, entry) { - if (!this.enabled || !['apps', 'wallpapers', 'mods'].includes(type)) return; - const section = document.createElement('div'); - section.className = 'modal-section rating-section'; - const header = modalBody.querySelector('.modal-header'); - if (header) header.after(section); else modalBody.prepend(section); - - const rating = entry && entry.rating; - const plural = rating && rating.count ? new Intl.PluralRules(this.app.currentLang).select(rating.count) : ''; - const summary = rating && rating.count ? - this.t(`rating-summary-${plural}`, {average: rating.average, count: rating.count}) : - this.t('rating-none'); - section.innerHTML = ` -

${this.esc(this.t('rating-title'))}

-

${this.esc(summary)}

-
- `; - - await this.ready; - const action = section.querySelector('.rating-action'); - if (!this.user) { - action.innerHTML = ``; - action.querySelector('button').addEventListener('click', () => this.signIn()); - return; - } - action.innerHTML = `${this.esc(this.t('rating-yours'))} - ${[1, 2, 3, 4, 5].map(n => - ``).join('')}`; - const message = section.querySelector('.rating-message'); - const stars = [...action.querySelectorAll('.rating-star')]; - const show = (n) => stars.forEach(b => b.classList.toggle('on', Number(b.dataset.stars) <= n)); - action.querySelector('.rating-stars').addEventListener('mouseleave', () => show(Number(action.dataset.chosen || 0))); - stars.forEach(button => { - button.addEventListener('mouseenter', () => show(Number(button.dataset.stars))); - button.addEventListener('click', async () => { - const n = Number(button.dataset.stars); - stars.forEach(b => b.disabled = true); - try { - await this.request('PUT', `/apps/${encodeURIComponent(slug)}/rating`, {stars: n}); - action.dataset.chosen = String(n); - show(n); - message.textContent = this.t('rating-thanks', {stars: n}); - if (window.umami) window.umami.track('rate', {item: slug, stars: n}); - } catch (error) { - message.textContent = error.status === 403 ? this.t('rating-own') : this.t('error', {message: error.message}); - } finally { - message.hidden = false; - stars.forEach(b => b.disabled = false); - } - }); - }); - } - // --- API ------------------------------------------------------------------- async request(method, path, body) { @@ -969,15 +888,13 @@ class CommunityUI { renderMyApp(app) { const [catalogType] = app.catalog_path.split('/'); - const rating = app.rating && app.rating.count ? - `${this.esc(this.t('rating', app.rating))}` : ''; return `

${this.esc(this.appName(app))}

${this.esc(app.slug)} - ${this.statusBadge(app.status)} ${rating} + ${this.statusBadge(app.status)}
diff --git a/site/index.html b/site/index.html index e5bbe53..2ec9689 100644 --- a/site/index.html +++ b/site/index.html @@ -52,21 +52,25 @@
-
- - -
+ +
+ -
diff --git a/site/script.js b/site/script.js index d227f11..56602f9 100644 --- a/site/script.js +++ b/site/script.js @@ -1,7 +1,7 @@ // Static UI strings per language, applied to elements with [data-i18n] // Cards per page; listing.json holds every item, pages are cut here const PAGE_SIZE = 12; -const SORTS = ['newest', 'updated', 'rating', 'name', 'author']; +const SORTS = ['newest', 'updated', 'name', 'author']; const DEFAULT_SORT = 'newest'; const UI_STRINGS = { @@ -15,9 +15,9 @@ const UI_STRINGS = { 'sort-label': 'Сортувати', 'sort-newest': 'Нові', 'sort-updated': 'Нещодавно оновлені', - 'sort-rating': 'Найкраща оцінка', 'sort-name': 'Назва', 'sort-author': 'Автор', + 'sort-reverse': 'Зворотний порядок', 'card-added': 'Додано {date}', 'card-updated': 'Оновлено {date}', 'av-info-title': 'Як ми перевіряємо файли', @@ -37,9 +37,9 @@ const UI_STRINGS = { 'sort-label': 'Sort by', 'sort-newest': 'Newest', 'sort-updated': 'Recently updated', - 'sort-rating': 'Top rated', 'sort-name': 'Name', 'sort-author': 'Author', + 'sort-reverse': 'Reverse order', 'card-added': 'Added {date}', 'card-updated': 'Updated {date}', 'av-info-title': 'How we check files', @@ -64,6 +64,8 @@ class LilkaRepository { this.currentLang = this.loadLanguage(); this.dataBase = this.readDataBase(); this.sort = this.loadSort(); + // Flips the sort's own direction: oldest first, Z to A + this.sortReverse = this.loadSortReverse(); // listing.json per kind, fetched once per visit this.listings = {}; // community.js is optional: without it the catalog stays read-only @@ -117,6 +119,10 @@ class LilkaRepository { const text = strings[el.dataset.i18n]; if (text) el.textContent = text; }); + document.querySelectorAll('[data-i18n-title]').forEach(el => { + const text = strings[el.dataset.i18nTitle]; + if (text) el.title = text; + }); } // Re-render currently visible content using the selected language @@ -199,6 +205,30 @@ class LilkaRepository { document.getElementById('sortSelect').value = sort; } + loadSortReverse() { + try { + return localStorage.getItem('lilka-sort-reverse') === '1'; + } catch (e) { + return false; + } + } + + setSortReverse(reverse) { + this.sortReverse = reverse; + try { + localStorage.setItem('lilka-sort-reverse', reverse ? '1' : '0'); + } catch (e) { + // the choice then lasts for this visit only + } + this.updateSortReverseButton(); + } + + updateSortReverseButton() { + const button = document.getElementById('sortReverse'); + button.textContent = this.sortReverse ? '↑' : '↓'; + button.setAttribute('aria-pressed', String(this.sortReverse)); + } + // listing.json (one per kind, written by the mirror) has what the list // shows and sorts by. Null when a mirror without it is served. async loadListing(type) { @@ -213,10 +243,6 @@ class LilkaRepository { return this.listings[type]; } - listingEntry(type, path) { - return (this.listings[type] || []).find(e => e.path === path) || null; - } - sortItems(items) { const name = (e) => String(this.localized(e, 'name') || e.path); const collator = new Intl.Collator(this.currentLang, {sensitivity: 'base'}); @@ -226,13 +252,10 @@ class LilkaRepository { const compare = { newest: byDate('added'), updated: byDate('updated'), - // Unrated last; a higher count wins a tie - rating: (a, b) => ((b.rating && b.rating.average) || 0) - ((a.rating && a.rating.average) || 0) || - ((b.rating && b.rating.count) || 0) - ((a.rating && a.rating.count) || 0) || byName(a, b), name: byName, author: (a, b) => collator.compare(String(a.author || ''), String(b.author || '')) || byName(a, b), }[this.sort] || byName; - return [...items].sort(compare); + return [...items].sort(this.sortReverse ? (a, b) => compare(b, a) : compare); } formatDate(value) { @@ -268,6 +291,7 @@ class LilkaRepository { const page = params.get('page'); const item = params.get('item'); if (SORTS.includes(params.get('sort'))) this.setSort(params.get('sort')); + if (params.has('reverse')) this.setSortReverse(params.get('reverse') === '1'); if (this.isCommunityView(type)) { await this.community.show(type, params); @@ -360,7 +384,7 @@ class LilkaRepository { params.set('type', type); params.set('item', itemName); } else if (type) { - // Page navigation: ?type=apps&page=1&sort=rating + // Page navigation: ?type=apps&page=1&sort=name&reverse=1 params.set('type', type); if (page !== null && page > 0) { params.set('page', page); @@ -368,6 +392,9 @@ class LilkaRepository { if (this.sort !== DEFAULT_SORT && ['apps', 'wallpapers', 'mods'].includes(type)) { params.set('sort', this.sort); } + if (this.sortReverse && ['apps', 'wallpapers', 'mods'].includes(type)) { + params.set('reverse', '1'); + } } const url = params.toString() ? `?${params.toString()}` : '/'; @@ -441,6 +468,14 @@ class LilkaRepository { this.currentPage = 0; this.loadPage(); }); + const sortReverse = document.getElementById('sortReverse'); + this.updateSortReverseButton(); + sortReverse.addEventListener('click', () => { + this.setSortReverse(!this.sortReverse); + if (window.umami) window.umami.track('sort', {sort: this.sort, reverse: this.sortReverse}); + this.currentPage = 0; + this.loadPage(); + }); for (const id of ['prevPage', 'prevPageBottom']) { document.getElementById(id).addEventListener('click', () => { @@ -750,14 +785,9 @@ class LilkaRepository { return card; } - // Rating and last update, from listing.json; manifests have neither + // Last update, from listing.json; manifests have none renderCardMeta(entry) { const parts = []; - if (entry.rating && entry.rating.count) { - parts.push(`★ ${ - this.escapeHtml(String(entry.rating.average))} (${ - this.escapeHtml(String(entry.rating.count))})`); - } // The date the list is sorted by; "updated" otherwise const key = this.sort === 'newest' ? 'added' : 'updated'; const date = this.formatDate(entry[key]); @@ -1072,12 +1102,6 @@ class LilkaRepository { }); } - // Stars and "rate this" for signed-in users (community.js) - if (this.community) { - this.community.mountRating(modalBody, this.currentType, manifestName, - this.listingEntry(this.currentType, manifestName)); - } - // Copy-hash buttons modalBody.querySelectorAll('.copy-hash-btn').forEach(btn => { btn.addEventListener('click', (e) => { diff --git a/site/styles.css b/site/styles.css index a3e8abb..c716a8c 100644 --- a/site/styles.css +++ b/site/styles.css @@ -1800,84 +1800,91 @@ footer { .status-rejected, .status-infected { color: var(--error); } -/* Sorting and ratings (script.js listing, community.js mountRating) */ +/* Sorting (script.js listing): shares a row with the top pagination */ +.list-head { + display: flex; + justify-content: space-between; + align-items: center; + flex-wrap: wrap; + gap: 0.75rem; + margin: 2rem 0; +} + +.list-head .pagination { + margin: 0; +} + .list-toolbar { + margin-left: auto; display: flex; - justify-content: flex-end; align-items: center; - gap: 0.6rem; - margin-top: 1.5rem; + gap: 0.5rem; color: var(--text-muted); - font-size: 0.9rem; + font-size: 0.85rem; + white-space: nowrap; } -.list-toolbar select { +/* Same height and corners as the header controls */ +.list-toolbar select, +.list-toolbar .sort-reverse { + height: 36px; background-color: var(--surface); color: var(--text-primary); border: 1px solid var(--border-solid); - border-radius: var(--radius-sm); - padding: 0.45rem 0.75rem; + border-radius: var(--radius-xs); font: inherit; + font-size: 0.85rem; cursor: pointer; + transition: border-color var(--transition); } -.list-toolbar select:focus-visible { - outline: 2px solid var(--primary-color); - outline-offset: 2px; +.list-toolbar select { + padding: 0 0.6rem; } -.item-card .card-meta { - display: flex; - gap: 0.75rem; +.list-toolbar .sort-reverse { + width: 36px; + padding: 0; + display: inline-flex; align-items: center; - color: var(--text-muted); - font-size: 0.8rem; -} - -.item-card .card-rating { - color: var(--warning); - font-weight: 600; -} - -.item-card .card-rating-count { - color: var(--text-muted); - font-weight: 400; + justify-content: center; + font-size: 1rem; + line-height: 1; } -.rating-section .rating-summary { - color: var(--text-secondary); - margin-bottom: 0.5rem; +.list-toolbar select:hover, +.list-toolbar .sort-reverse:hover { + border-color: var(--primary-color); } -.rating-action { - display: flex; - align-items: center; - gap: 0.5rem; - flex-wrap: wrap; +.list-toolbar select:focus { + outline: none; + border-color: var(--primary-color); } -.rating-star { - background: none; - border: none; - color: var(--border-solid); - font-size: 1.5rem; - line-height: 1; - padding: 0 0.1rem; - cursor: pointer; - transition: color var(--transition), transform var(--transition); +.list-toolbar .sort-reverse:focus-visible { + outline: 2px solid var(--primary-color); + outline-offset: 1px; } -.rating-star.on, -.rating-star:focus-visible { - color: var(--warning); -} +@media (max-width: 768px) { + .list-head { + flex-direction: column-reverse; + align-items: stretch; + margin: 1.25rem 0; + } -.rating-star:hover { - transform: scale(1.15); + .list-toolbar { + justify-content: flex-end; + } } -.rating-star:disabled { - cursor: wait; +.item-card .card-meta { + display: flex; + gap: 0.75rem; + align-items: center; + color: var(--text-muted); + font-size: 0.8rem; } .list-toolbar[hidden] {