Merge pull request #4576 from rommapp/claude/v2-upload-and-picker-polish

feat(v2): polish upload actions and pickers across details, player and scan settings
This commit is contained in:
Zurdi
2026-09-17 12:41:48 +02:00
committed by GitHub
53 changed files with 603 additions and 299 deletions

View File

@@ -113,6 +113,16 @@ test.describe("Media tab write affordances (admin)", () => {
});
});
// "All files" has no destination of its own, so it offers "Upload to folder";
// a folder subtab offers Upload straight into that folder.
function uploadButton(page: Page): Locator {
return page.getByRole("button", { name: "Upload", exact: true });
}
function uploadToFolderButton(page: Page): Locator {
return page.getByRole("button", { name: "Upload to folder", exact: true });
}
test.describe("Files tab write affordances", () => {
test.describe("read-only user", () => {
test.use({ storageState: STORAGE_STATE.viewer });
@@ -123,22 +133,36 @@ test.describe("Files tab write affordances", () => {
await openTab(page, "Files");
await expect(
page.getByRole("button", { name: "Upload", exact: true }),
).toHaveCount(0);
page.locator(".r-v2-files__subtab-btn").first(),
).toBeVisible();
await expect(uploadButton(page)).toHaveCount(0);
await expect(uploadToFolderButton(page)).toHaveCount(0);
});
});
test.describe("admin", () => {
test.use({ storageState: STORAGE_STATE.admin });
test("gets the upload button", async ({ page }) => {
test("gets Upload to folder from All files", async ({ page }) => {
await seedUiState(page, "dark");
await gotoFirstRom(page);
await openTab(page, "Files");
await expect(
page.getByRole("button", { name: "Upload", exact: true }),
).toBeVisible();
await expect(uploadToFolderButton(page)).toBeVisible();
await expect(uploadButton(page)).toHaveCount(0);
});
test("gets Upload from a folder subtab", async ({ page }) => {
await seedUiState(page, "dark");
await gotoFirstRom(page);
await openTab(page, "Files");
await page
.locator(".r-v2-files__subtab-btn:not(.r-v2-files__subtab-btn--active)")
.first()
.click();
await expect(uploadButton(page)).toBeVisible();
await expect(uploadToFolderButton(page)).toHaveCount(0);
});
});
});

View File

@@ -107,7 +107,7 @@
"multiplayer-hint": "Показва бутон „Присъединяване“ на страницата на играта и запазва чата и уеб камерата видими.",
"mute": "Заглушаване",
"new-memory-card": "Нова карта",
"new-slot": "Нов слот…",
"new-slot": "+ Нов слот",
"newer-save-warning": "Има запис от {time}, по-нов от избрания. Продължаването от избрания може да върне напредъка ти назад.",
"newer-state-warning": "Има бърз запис от {time}, по-нов от избрания. Продължаването от избрания може да върне напредъка ти назад.",
"no-memory-cards": "Все още няма карти памет",

View File

@@ -487,7 +487,7 @@
"upload-file-failed": "Неуспешно качване на {name}: {error}",
"upload-file-rejected": "{name} беше отхвърлен: {error}",
"upload-manual": "Upload manual",
"upload-new-folder": "Нова папка…",
"upload-new-folder": "Нова папка",
"upload-new-folder-hint": "Спрямо папката на играта, напр. hack/v2",
"upload-overwrite-body": "{names} вече съществува в тази папка и ще бъде заменен от новото качване. | {names} вече съществуват в тази папка и ще бъдат заменени от новите качвания.",
"upload-overwrite-title": "Презаписване на {n} съществуващ файл? | Презаписване на {n} съществуващи файла?",
@@ -496,7 +496,7 @@
"upload-slot-hint": "Записите в слот се синхронизират с устройствата; без слот файлът остава ръчен архив.",
"upload-soundtrack": "Upload soundtrack",
"upload-states": "Качи бързи записи",
"upload-to-folder": "Качи в папка…",
"upload-to-folder": "Качи в папка",
"upload-tracks": "Add tracks",
"upload-walkthrough": "Upload walkthrough",
"verification": "Потвърждение",

View File

@@ -107,7 +107,7 @@
"multiplayer-hint": "Na stránce hry se zobrazí tlačítko Připojit se a chat i webkamera zůstanou viditelné.",
"mute": "Ztlumit",
"new-memory-card": "Nová karta",
"new-slot": "Nový slot…",
"new-slot": "+ Nový slot",
"newer-save-warning": "Uložená pozice z {time} je novější než vaše volba. Pokračování z ní může vrátit váš postup zpět.",
"newer-state-warning": "Stav z {time} je novější než vaše volba. Pokračování z ní může vrátit váš postup zpět.",
"no-memory-cards": "Zatím žádné paměťové karty",

View File

@@ -487,7 +487,7 @@
"upload-file-failed": "Nelze nahrát {name}: {error}",
"upload-file-rejected": "{name} byl odmítnut: {error}",
"upload-manual": "Upload manual",
"upload-new-folder": "Nová složka…",
"upload-new-folder": "Nová složka",
"upload-new-folder-hint": "Relativně ke složce hry, např. hack/v2",
"upload-overwrite-body": "{names} v této složce již existuje a bude nahrazen novým nahráním. | {names} v této složce již existují a budou nahrazeny novými nahráními.",
"upload-overwrite-title": "Přepsat {n} existující soubor? | Přepsat {n} existující soubory?",
@@ -496,7 +496,7 @@
"upload-slot-hint": "Uložené pozice ve slotu se synchronizují se zařízeními; bez slotu zůstává soubor ručním archivem.",
"upload-soundtrack": "Upload soundtrack",
"upload-states": "Nahrát stavy",
"upload-to-folder": "Nahrát do složky…",
"upload-to-folder": "Nahrát do složky",
"upload-tracks": "Add tracks",
"upload-walkthrough": "Upload walkthrough",
"verification": "Ověření",

View File

@@ -107,7 +107,7 @@
"multiplayer-hint": "Zeigt auf der Seite dieses Spiels eine Schaltfläche zum Beitreten und hält Chat und Webcam sichtbar.",
"mute": "Stummschalten",
"new-memory-card": "Neue Karte",
"new-slot": "Neuer Slot…",
"new-slot": "+ Neuer Slot",
"newer-save-warning": "Ein Spielstand von {time} ist neuer als deine Auswahl. Damit fortzusetzen kann deinen Fortschritt zurücksetzen.",
"newer-state-warning": "Ein Zustand von {time} ist neuer als deine Auswahl. Damit fortzusetzen kann deinen Fortschritt zurücksetzen.",
"no-memory-cards": "Noch keine Speicherkarten",

View File

@@ -487,7 +487,7 @@
"upload-file-failed": "{name} konnte nicht hochgeladen werden: {error}",
"upload-file-rejected": "{name} wurde abgelehnt: {error}",
"upload-manual": "Upload manual",
"upload-new-folder": "Neuer Ordner…",
"upload-new-folder": "Neuer Ordner",
"upload-new-folder-hint": "Relativ zum Spielordner, z. B. hack/v2",
"upload-overwrite-body": "{names} existiert bereits in diesem Ordner und wird durch den neuen Upload ersetzt. | {names} existieren bereits in diesem Ordner und werden durch die neuen Uploads ersetzt.",
"upload-overwrite-title": "{n} vorhandene Datei überschreiben? | {n} vorhandene Dateien überschreiben?",
@@ -496,7 +496,7 @@
"upload-slot-hint": "Spielstände in einem Slot nehmen an der Gerätesynchronisierung teil; ohne Slot bleibt die Datei ein manuelles Archiv.",
"upload-soundtrack": "Upload soundtrack",
"upload-states": "Zustände hochladen",
"upload-to-folder": "In Ordner hochladen…",
"upload-to-folder": "In Ordner hochladen",
"upload-tracks": "Add tracks",
"upload-walkthrough": "Upload walkthrough",
"verification": "Verifizierung",

View File

@@ -107,7 +107,7 @@
"multiplayer-hint": "Shows a Join button on this game's page and keeps chat and webcam visible.",
"mute": "Mute",
"new-memory-card": "New card",
"new-slot": "New slot…",
"new-slot": "+ New slot",
"newer-save-warning": "A save from {time} is newer than your pick. Resuming it may roll your progress back.",
"newer-state-warning": "A state from {time} is newer than your pick. Resuming it may roll your progress back.",
"no-memory-cards": "No memory cards yet",

View File

@@ -487,7 +487,7 @@
"upload-file-failed": "Unable to upload {name}: {error}",
"upload-file-rejected": "{name} was rejected: {error}",
"upload-manual": "Upload manual",
"upload-new-folder": "New folder…",
"upload-new-folder": "New folder",
"upload-new-folder-hint": "Relative to the game folder, e.g. hack/v2",
"upload-overwrite-body": "{names} already exists in this folder and will be replaced by the new upload. | {names} already exist in this folder and will be replaced by the new uploads.",
"upload-overwrite-title": "Overwrite {n} existing file? | Overwrite {n} existing files?",
@@ -496,7 +496,7 @@
"upload-slot-hint": "Slotted saves join device sync; without a slot the file stays a manual archive.",
"upload-soundtrack": "Upload soundtrack",
"upload-states": "Upload states",
"upload-to-folder": "Upload to folder…",
"upload-to-folder": "Upload to folder",
"upload-tracks": "Add tracks",
"upload-walkthrough": "Upload walkthrough",
"verification": "Verification",

View File

@@ -107,7 +107,7 @@
"multiplayer-hint": "Shows a Join button on this game's page and keeps chat and webcam visible.",
"mute": "Mute",
"new-memory-card": "New card",
"new-slot": "New slot…",
"new-slot": "+ New slot",
"newer-save-warning": "A save from {time} is newer than your pick. Resuming it may roll your progress back.",
"newer-state-warning": "A state from {time} is newer than your pick. Resuming it may roll your progress back.",
"no-memory-cards": "No memory cards yet",

View File

@@ -487,7 +487,7 @@
"upload-file-failed": "Unable to upload {name}: {error}",
"upload-file-rejected": "{name} was rejected: {error}",
"upload-manual": "Upload manual",
"upload-new-folder": "New folder…",
"upload-new-folder": "New folder",
"upload-new-folder-hint": "Relative to the game folder, e.g. hack/v2",
"upload-overwrite-body": "{names} already exists in this folder and will be replaced by the new upload. | {names} already exist in this folder and will be replaced by the new uploads.",
"upload-overwrite-title": "Overwrite {n} existing file? | Overwrite {n} existing files?",
@@ -496,7 +496,7 @@
"upload-slot-hint": "Slotted saves join device sync; without a slot the file stays a manual archive.",
"upload-soundtrack": "Upload soundtrack",
"upload-states": "Upload states",
"upload-to-folder": "Upload to folder…",
"upload-to-folder": "Upload to folder",
"upload-tracks": "Upload tracks",
"upload-walkthrough": "Upload walkthrough",
"verification": "Verification",

View File

@@ -107,7 +107,7 @@
"multiplayer-hint": "Muestra un botón Unirse en la página de este juego y mantiene visibles el chat y la cámara web.",
"mute": "Silenciar",
"new-memory-card": "Nueva tarjeta",
"new-slot": "Nueva ranura…",
"new-slot": "+ Nueva ranura",
"newer-save-warning": "Hay una partida guardada de {time} más reciente que tu elección. Continuar con ella puede hacerte perder progreso.",
"newer-state-warning": "Hay un estado de {time} más reciente que tu elección. Continuar con ella puede hacerte perder progreso.",
"no-memory-cards": "Aún no hay tarjetas de memoria",

View File

@@ -487,7 +487,7 @@
"upload-file-failed": "No se pudo subir {name}: {error}",
"upload-file-rejected": "{name} fue rechazado: {error}",
"upload-manual": "Upload manual",
"upload-new-folder": "Nueva carpeta…",
"upload-new-folder": "Nueva carpeta",
"upload-new-folder-hint": "Relativa a la carpeta del juego, p. ej. hack/v2",
"upload-overwrite-body": "{names} ya existe en esta carpeta y se reemplazará con la nueva subida. | {names} ya existen en esta carpeta y se reemplazarán con las nuevas subidas.",
"upload-overwrite-title": "¿Sobrescribir {n} archivo existente? | ¿Sobrescribir {n} archivos existentes?",
@@ -496,7 +496,7 @@
"upload-slot-hint": "Las partidas con ranura entran en la sincronización de dispositivos; sin ranura el archivo queda como copia manual.",
"upload-soundtrack": "Upload soundtrack",
"upload-states": "Subir estados",
"upload-to-folder": "Subir a carpeta…",
"upload-to-folder": "Subir a carpeta",
"upload-tracks": "Add tracks",
"upload-walkthrough": "Upload walkthrough",
"verification": "Verificación",

View File

@@ -107,7 +107,7 @@
"multiplayer-hint": "Affiche un bouton Rejoindre sur la page de ce jeu et garde le chat et la webcam visibles.",
"mute": "Couper le son",
"new-memory-card": "Nouvelle carte",
"new-slot": "Nouvel emplacement…",
"new-slot": "+ Nouvel emplacement",
"newer-save-warning": "Une sauvegarde de {time} est plus récente que votre choix. Reprendre avec ce choix peut vous faire perdre de la progression.",
"newer-state-warning": "Un état de {time} est plus récent que votre choix. Reprendre avec ce choix peut vous faire perdre de la progression.",
"no-memory-cards": "Aucune carte mémoire pour le moment",

View File

@@ -487,7 +487,7 @@
"upload-file-failed": "Impossible de téléverser {name} : {error}",
"upload-file-rejected": "{name} a été rejeté : {error}",
"upload-manual": "Upload manual",
"upload-new-folder": "Nouveau dossier…",
"upload-new-folder": "Nouveau dossier",
"upload-new-folder-hint": "Relatif au dossier du jeu, par ex. hack/v2",
"upload-overwrite-body": "{names} existe déjà dans ce dossier et sera remplacé par le nouvel envoi. | {names} existent déjà dans ce dossier et seront remplacés par les nouveaux envois.",
"upload-overwrite-title": "Écraser {n} fichier existant ? | Écraser {n} fichiers existants ?",
@@ -496,7 +496,7 @@
"upload-slot-hint": "Les sauvegardes dans un emplacement rejoignent la synchronisation des appareils ; sans emplacement, le fichier reste une archive manuelle.",
"upload-soundtrack": "Upload soundtrack",
"upload-states": "Téléverser des états",
"upload-to-folder": "Téléverser dans un dossier…",
"upload-to-folder": "Téléverser dans un dossier",
"upload-tracks": "Add tracks",
"upload-walkthrough": "Upload walkthrough",
"verification": "Vérification",

View File

@@ -107,7 +107,7 @@
"multiplayer-hint": "Csatlakozás gombot jelenít meg a játék oldalán, és láthatóan tartja a csevegést és a webkamerát.",
"mute": "Némítás",
"new-memory-card": "Új kártya",
"new-slot": "Új hely…",
"new-slot": "+ Új hely",
"newer-save-warning": "Egy {time} mentés újabb a választottnál. A választott folytatása visszavetheti a haladásodat.",
"newer-state-warning": "Egy {time} állás újabb a választottnál. A választott folytatása visszavetheti a haladásodat.",
"no-memory-cards": "Még nincsenek memóriakártyák",

View File

@@ -487,7 +487,7 @@
"upload-file-failed": "{name} feltöltése nem sikerült: {error}",
"upload-file-rejected": "{name} elutasítva: {error}",
"upload-manual": "Upload manual",
"upload-new-folder": "Új mappa…",
"upload-new-folder": "Új mappa",
"upload-new-folder-hint": "A játék mappájához képest, pl. hack/v2",
"upload-overwrite-body": "{names} már létezik ebben a mappában, és az új feltöltés felülírja. | {names} már léteznek ebben a mappában, és az új feltöltések felülírják.",
"upload-overwrite-title": "Felülírja a(z) {n} meglévő fájlt? | Felülírja a(z) {n} meglévő fájlt?",
@@ -496,7 +496,7 @@
"upload-slot-hint": "A helyre tett mentések részt vesznek az eszközszinkronban; hely nélkül a fájl kézi archívum marad.",
"upload-soundtrack": "Upload soundtrack",
"upload-states": "Állások feltöltése",
"upload-to-folder": "Feltöltés mappába…",
"upload-to-folder": "Feltöltés mappába",
"upload-tracks": "Add tracks",
"upload-walkthrough": "Upload walkthrough",
"verification": "Ellenőrzés",

View File

@@ -107,7 +107,7 @@
"multiplayer-hint": "Mostra un pulsante Partecipa nella pagina di questo gioco e mantiene visibili chat e webcam.",
"mute": "Disattiva audio",
"new-memory-card": "Nuova card",
"new-slot": "Nuovo slot…",
"new-slot": "+ Nuovo slot",
"newer-save-warning": "Un salvataggio di {time} è più recente della tua scelta. Riprenderla può farti perdere progressi.",
"newer-state-warning": "Uno stato di {time} è più recente della tua scelta. Riprenderla può farti perdere progressi.",
"no-memory-cards": "Nessuna memory card",

View File

@@ -487,7 +487,7 @@
"upload-file-failed": "Impossibile caricare {name}: {error}",
"upload-file-rejected": "{name} è stato rifiutato: {error}",
"upload-manual": "Upload manual",
"upload-new-folder": "Nuova cartella…",
"upload-new-folder": "Nuova cartella",
"upload-new-folder-hint": "Relativo alla cartella del gioco, es. hack/v2",
"upload-overwrite-body": "{names} esiste già in questa cartella e verrà sostituito dal nuovo caricamento. | {names} esistono già in questa cartella e verranno sostituiti dai nuovi caricamenti.",
"upload-overwrite-title": "Sovrascrivere {n} file esistente? | Sovrascrivere {n} file esistenti?",
@@ -496,7 +496,7 @@
"upload-slot-hint": "I salvataggi in uno slot entrano nella sincronizzazione dei dispositivi; senza slot il file resta un archivio manuale.",
"upload-soundtrack": "Upload soundtrack",
"upload-states": "Carica stati",
"upload-to-folder": "Carica in cartella…",
"upload-to-folder": "Carica in cartella",
"upload-tracks": "Add tracks",
"upload-walkthrough": "Upload walkthrough",
"verification": "Verifica",

View File

@@ -107,7 +107,7 @@
"multiplayer-hint": "このゲームのページに参加ボタンを表示し、チャットとウェブカメラを表示したままにします。",
"mute": "ミュート",
"new-memory-card": "新しいカード",
"new-slot": "新しいスロット…",
"new-slot": "+ 新しいスロット",
"newer-save-warning": "{time}のセーブは選択したものより新しいです。このまま再開すると進行状況が戻る可能性があります。",
"newer-state-warning": "{time}のステートセーブは選択したものより新しいです。このまま再開すると進行状況が戻る可能性があります。",
"no-memory-cards": "メモリーカードはまだありません",

View File

@@ -487,7 +487,7 @@
"upload-file-failed": "{name} をアップロードできません: {error}",
"upload-file-rejected": "{name} は拒否されました: {error}",
"upload-manual": "Upload manual",
"upload-new-folder": "新しいフォルダ…",
"upload-new-folder": "新しいフォルダ",
"upload-new-folder-hint": "ゲームフォルダからの相対パス (例: hack/v2)",
"upload-overwrite-body": "{names} はこのフォルダにすでに存在し、新しいアップロードで置き換えられます。 | {names} はこのフォルダにすでに存在し、新しいアップロードで置き換えられます。",
"upload-overwrite-title": "既存の {n} 件のファイルを上書きしますか? | 既存の {n} 件のファイルを上書きしますか?",
@@ -496,7 +496,7 @@
"upload-slot-hint": "スロット付きのセーブは端末間で同期されます。スロットなしのファイルは手動のアーカイブとして保持されます。",
"upload-soundtrack": "Upload soundtrack",
"upload-states": "ステートセーブをアップロード",
"upload-to-folder": "フォルダにアップロード…",
"upload-to-folder": "フォルダにアップロード",
"upload-tracks": "Add tracks",
"upload-walkthrough": "Upload walkthrough",
"verification": "検証",

View File

@@ -107,7 +107,7 @@
"multiplayer-hint": "이 게임 페이지에 참가 버튼을 표시하고 채팅과 웹캠을 계속 보이게 합니다.",
"mute": "음소거",
"new-memory-card": "새 카드",
"new-slot": "새 슬롯…",
"new-slot": "+ 새 슬롯",
"newer-save-warning": "{time}의 세이브가 선택한 항목보다 최신입니다. 그대로 이어하면 진행 상황이 되돌아갈 수 있습니다.",
"newer-state-warning": "{time}의 상태가 선택한 항목보다 최신입니다. 그대로 이어하면 진행 상황이 되돌아갈 수 있습니다.",
"no-memory-cards": "메모리 카드가 아직 없습니다",

View File

@@ -487,7 +487,7 @@
"upload-file-failed": "{name}을(를) 업로드할 수 없습니다: {error}",
"upload-file-rejected": "{name}이(가) 거부되었습니다: {error}",
"upload-manual": "Upload manual",
"upload-new-folder": "새 폴더…",
"upload-new-folder": "새 폴더",
"upload-new-folder-hint": "게임 폴더 기준 상대 경로, 예: hack/v2",
"upload-overwrite-body": "{names}은(는) 이 폴더에 이미 존재하며 새 업로드로 대체됩니다. | {names}은(는) 이 폴더에 이미 존재하며 새 업로드로 대체됩니다.",
"upload-overwrite-title": "기존 파일 {n}개를 덮어쓸까요? | 기존 파일 {n}개를 덮어쓸까요?",
@@ -496,7 +496,7 @@
"upload-slot-hint": "슬롯이 있는 세이브는 기기 동기화에 포함됩니다. 슬롯이 없으면 파일은 수동 보관본으로 남습니다.",
"upload-soundtrack": "Upload soundtrack",
"upload-states": "상태 업로드",
"upload-to-folder": "폴더에 업로드…",
"upload-to-folder": "폴더에 업로드",
"upload-tracks": "Add tracks",
"upload-walkthrough": "Upload walkthrough",
"verification": "검증",

View File

@@ -107,7 +107,7 @@
"multiplayer-hint": "Wyświetla przycisk Dołącz na stronie tej gry i utrzymuje widoczny czat oraz kamerę internetową.",
"mute": "Wycisz",
"new-memory-card": "Nowa karta",
"new-slot": "Nowy slot…",
"new-slot": "+ Nowy slot",
"newer-save-warning": "Zapis z {time} jest nowszy niż twój wybór. Wznowienie go może cofnąć twój postęp.",
"newer-state-warning": "Stan z {time} jest nowszy niż twój wybór. Wznowienie go może cofnąć twój postęp.",
"no-memory-cards": "Brak kart pamięci",

View File

@@ -487,7 +487,7 @@
"upload-file-failed": "Nie można przesłać {name}: {error}",
"upload-file-rejected": "{name} został odrzucony: {error}",
"upload-manual": "Upload manual",
"upload-new-folder": "Nowy folder…",
"upload-new-folder": "Nowy folder",
"upload-new-folder-hint": "Względem folderu gry, np. hack/v2",
"upload-overwrite-body": "{names} już istnieje w tym folderze i zostanie zastąpiony nowym plikiem. | {names} już istnieją w tym folderze i zostaną zastąpione nowymi plikami.",
"upload-overwrite-title": "Nadpisać {n} istniejący plik? | Nadpisać {n} istniejące pliki?",
@@ -496,7 +496,7 @@
"upload-slot-hint": "Zapisy w slocie biorą udział w synchronizacji urządzeń; bez slotu plik pozostaje ręcznym archiwum.",
"upload-soundtrack": "Upload soundtrack",
"upload-states": "Prześlij stany",
"upload-to-folder": "Prześlij do folderu…",
"upload-to-folder": "Prześlij do folderu",
"upload-tracks": "Add tracks",
"upload-walkthrough": "Upload walkthrough",
"verification": "Weryfikacja",

View File

@@ -107,7 +107,7 @@
"multiplayer-hint": "Mostra um botão Entrar na página deste jogo e mantém o chat e a webcam visíveis.",
"mute": "Silenciar",
"new-memory-card": "Novo cartão",
"new-slot": "Novo slot…",
"new-slot": "+ Novo slot",
"newer-save-warning": "Um save de {time} é mais recente que sua escolha. Retomá-la pode desfazer seu progresso.",
"newer-state-warning": "Um state de {time} é mais recente que sua escolha. Retomá-la pode desfazer seu progresso.",
"no-memory-cards": "Nenhum cartão de memória ainda",

View File

@@ -487,7 +487,7 @@
"upload-file-failed": "Não foi possível enviar {name}: {error}",
"upload-file-rejected": "{name} foi rejeitado: {error}",
"upload-manual": "Enviar manual",
"upload-new-folder": "Nova pasta…",
"upload-new-folder": "Nova pasta",
"upload-new-folder-hint": "Relativo à pasta do jogo, ex.: hack/v2",
"upload-overwrite-body": "{names} já existe nesta pasta e será substituído pelo novo envio. | {names} já existem nesta pasta e serão substituídos pelos novos envios.",
"upload-overwrite-title": "Sobrescrever {n} arquivo existente? | Sobrescrever {n} arquivos existentes?",
@@ -496,7 +496,7 @@
"upload-slot-hint": "Saves em um slot entram na sincronização de dispositivos; sem slot o arquivo fica como cópia manual.",
"upload-soundtrack": "Enviar trilha sonora",
"upload-states": "Enviar states",
"upload-to-folder": "Enviar para pasta…",
"upload-to-folder": "Enviar para pasta",
"upload-tracks": "Enviar faixas",
"upload-walkthrough": "Upload walkthrough",
"verification": "Verificação",

View File

@@ -107,7 +107,7 @@
"multiplayer-hint": "Afișează un buton Alătură-te pe pagina acestui joc și păstrează vizibile chatul și camera web.",
"mute": "Dezactivează sunetul",
"new-memory-card": "Card nou",
"new-slot": "Slot nou…",
"new-slot": "+ Slot nou",
"newer-save-warning": "O salvare de {time} este mai nouă decât alegerea ta. Reluarea ei îți poate da progresul înapoi.",
"newer-state-warning": "O stare de {time} este mai nouă decât alegerea ta. Reluarea ei îți poate da progresul înapoi.",
"no-memory-cards": "Încă niciun card de memorie",

View File

@@ -487,7 +487,7 @@
"upload-file-failed": "Nu s-a putut încărca {name}: {error}",
"upload-file-rejected": "{name} a fost respins: {error}",
"upload-manual": "Upload manual",
"upload-new-folder": "Folder nou…",
"upload-new-folder": "Folder nou",
"upload-new-folder-hint": "Relativ la folderul jocului, de ex. hack/v2",
"upload-overwrite-body": "{names} există deja în acest folder și va fi înlocuit de noua încărcare. | {names} există deja în acest folder și vor fi înlocuite de noile încărcări.",
"upload-overwrite-title": "Suprascrii {n} fișier existent? | Suprascrii {n} fișiere existente?",
@@ -496,7 +496,7 @@
"upload-slot-hint": "Salvările dintr-un slot intră în sincronizarea dispozitivelor; fără slot fișierul rămâne o arhivă manuală.",
"upload-soundtrack": "Upload soundtrack",
"upload-states": "Încarcă stări",
"upload-to-folder": "Încarcă în folder…",
"upload-to-folder": "Încarcă în folder",
"upload-tracks": "Add tracks",
"upload-walkthrough": "Upload walkthrough",
"verification": "Verificare",

View File

@@ -107,7 +107,7 @@
"multiplayer-hint": "Показывает кнопку «Присоединиться» на странице этой игры и оставляет чат и веб-камеру видимыми.",
"mute": "Отключить звук",
"new-memory-card": "Новая карта",
"new-slot": "Новый слот…",
"new-slot": "+ Новый слот",
"newer-save-warning": "Сохранение от {time} новее вашего выбора. Продолжение с него может откатить ваш прогресс.",
"newer-state-warning": "Состояние от {time} новее вашего выбора. Продолжение с него может откатить ваш прогресс.",
"no-memory-cards": "Пока нет карт памяти",

View File

@@ -487,7 +487,7 @@
"upload-file-failed": "Не удалось загрузить {name}: {error}",
"upload-file-rejected": "{name} отклонён: {error}",
"upload-manual": "Upload manual",
"upload-new-folder": "Новая папка…",
"upload-new-folder": "Новая папка",
"upload-new-folder-hint": "Относительно папки игры, например hack/v2",
"upload-overwrite-body": "{names} уже существует в этой папке и будет заменён новой загрузкой. | {names} уже существуют в этой папке и будут заменены новыми загрузками.",
"upload-overwrite-title": "Перезаписать {n} существующий файл? | Перезаписать {n} существующих файлов?",
@@ -496,7 +496,7 @@
"upload-slot-hint": "Сохранения в слоте участвуют в синхронизации устройств; без слота файл остаётся ручным архивом.",
"upload-soundtrack": "Upload soundtrack",
"upload-states": "Загрузить состояния",
"upload-to-folder": "Загрузить в папку…",
"upload-to-folder": "Загрузить в папку",
"upload-tracks": "Add tracks",
"upload-walkthrough": "Upload walkthrough",
"verification": "Проверка",

View File

@@ -107,7 +107,7 @@
"multiplayer-hint": "Bu oyunun sayfasında bir Katıl düğmesi gösterir, sohbeti ve web kamerasını görünür tutar.",
"mute": "Sessize al",
"new-memory-card": "Yeni kart",
"new-slot": "Yeni yuva…",
"new-slot": "+ Yeni yuva",
"newer-save-warning": "{time} tarihli kayıt seçiminizden daha yeni. Seçiminizle devam etmek ilerlemenizi geri alabilir.",
"newer-state-warning": "{time} tarihli durum kaydı seçiminizden daha yeni. Seçiminizle devam etmek ilerlemenizi geri alabilir.",
"no-memory-cards": "Henüz hafıza kartı yok",

View File

@@ -487,7 +487,7 @@
"upload-file-failed": "{name} yüklenemedi: {error}",
"upload-file-rejected": "{name} reddedildi: {error}",
"upload-manual": "Kılavuz yükle",
"upload-new-folder": "Yeni klasör…",
"upload-new-folder": "Yeni klasör",
"upload-new-folder-hint": "Oyun klasörüne göre, örn. hack/v2",
"upload-overwrite-body": "{names} bu klasörde zaten mevcut ve yeni yüklemeyle değiştirilecek. | {names} bu klasörde zaten mevcut ve yeni yüklemelerle değiştirilecek.",
"upload-overwrite-title": "{n} mevcut dosyanın üzerine yazılsın mı? | {n} mevcut dosyanın üzerine yazılsın mı?",
@@ -496,7 +496,7 @@
"upload-slot-hint": "Yuvadaki kayıtlar cihaz eşitlemesine katılır; yuva yoksa dosya elle alınmış bir arşiv olarak kalır.",
"upload-soundtrack": "Müzik paketi yükle",
"upload-states": "Durum kaydı yükle",
"upload-to-folder": "Klasöre yükle…",
"upload-to-folder": "Klasöre yükle",
"upload-tracks": "Parça yükle",
"upload-walkthrough": "Upload walkthrough",
"verification": "Doğrulama",

View File

@@ -107,7 +107,7 @@
"multiplayer-hint": "在该游戏页面显示“加入”按钮,并保持聊天和摄像头可见。",
"mute": "静音",
"new-memory-card": "新建卡",
"new-slot": "新建存档位…",
"new-slot": "+ 新建存档位",
"newer-save-warning": "{time}的存档比你选择的更新。继续当前选择可能会回退你的进度。",
"newer-state-warning": "{time}的状态比你选择的更新。继续当前选择可能会回退你的进度。",
"no-memory-cards": "尚无记忆卡",

View File

@@ -487,7 +487,7 @@
"upload-file-failed": "无法上传 {name}:{error}",
"upload-file-rejected": "{name} 已被拒绝:{error}",
"upload-manual": "上传手册",
"upload-new-folder": "新建文件夹…",
"upload-new-folder": "新建文件夹",
"upload-new-folder-hint": "相对于游戏文件夹,例如 hack/v2",
"upload-overwrite-body": "{names} 已存在于此文件夹中,将被新上传的文件替换。 | {names} 已存在于此文件夹中,将被新上传的文件替换。",
"upload-overwrite-title": "覆盖 {n} 个已有文件? | 覆盖 {n} 个已有文件?",
@@ -496,7 +496,7 @@
"upload-slot-hint": "带存档位的存档会参与设备同步;没有存档位的文件将作为手动存档保留。",
"upload-soundtrack": "上传原声音乐",
"upload-states": "上传状态",
"upload-to-folder": "上传到文件夹…",
"upload-to-folder": "上传到文件夹",
"upload-tracks": "Add tracks",
"upload-walkthrough": "上传攻略",
"verification": "验证",

View File

@@ -107,7 +107,7 @@
"multiplayer-hint": "在此遊戲頁面顯示「加入」按鈕,並保持聊天與網路攝影機可見。",
"mute": "靜音",
"new-memory-card": "新增卡",
"new-slot": "新增存檔格…",
"new-slot": "+ 新增存檔格",
"newer-save-warning": "{time}的存檔比你選擇的更新。繼續目前選擇可能會回退你的進度。",
"newer-state-warning": "{time}的即時存檔比你選擇的更新。繼續目前選擇可能會回退你的進度。",
"no-memory-cards": "尚無記憶卡",

View File

@@ -487,7 +487,7 @@
"upload-file-failed": "無法上傳 {name}:{error}",
"upload-file-rejected": "{name} 已被拒絕:{error}",
"upload-manual": "Upload manual",
"upload-new-folder": "新增資料夾…",
"upload-new-folder": "新增資料夾",
"upload-new-folder-hint": "相對於遊戲資料夾,例如 hack/v2",
"upload-overwrite-body": "{names} 已存在於此資料夾中,將被新上傳的檔案取代。 | {names} 已存在於此資料夾中,將被新上傳的檔案取代。",
"upload-overwrite-title": "覆蓋 {n} 個現有檔案? | 覆蓋 {n} 個現有檔案?",
@@ -496,7 +496,7 @@
"upload-slot-hint": "有存檔槽的存檔會參與裝置同步;沒有存檔槽的檔案將作為手動存檔保留。",
"upload-soundtrack": "Upload soundtrack",
"upload-states": "上傳即時存檔",
"upload-to-folder": "上傳至資料夾…",
"upload-to-folder": "上傳至資料夾",
"upload-tracks": "Add tracks",
"upload-walkthrough": "Upload walkthrough",
"verification": "驗證",

View File

@@ -94,9 +94,6 @@ function mountTab(r = rom()) {
RCheckbox: true,
REmptyState: true,
RIcon: true,
RTooltip: {
template: `<div><slot name="activator" :props="{}" /></div>`,
},
RBtn: {
props: ["disabled", "icon"],
emits: ["click"],
@@ -108,10 +105,16 @@ function mountTab(r = rom()) {
});
}
function buttonByLabel(wrapper: ReturnType<typeof mountTab>, label: string) {
return wrapper.findAll("button.btn").find((b) => b.text() === label);
}
function uploadButton(wrapper: ReturnType<typeof mountTab>) {
return wrapper
.findAll("button.btn")
.find((b) => b.text() === "common.upload");
return buttonByLabel(wrapper, "common.upload");
}
function uploadToFolderButton(wrapper: ReturnType<typeof mountTab>) {
return buttonByLabel(wrapper, "rom.upload-to-folder");
}
async function pickFile(wrapper: ReturnType<typeof mountTab>, name: string) {
@@ -140,6 +143,7 @@ describe("FilesTab uploads", () => {
const wrapper = mountTab();
expect(uploadButton(wrapper)).toBeUndefined();
expect(uploadToFolderButton(wrapper)).toBeUndefined();
});
it("sends files straight into the active folder", async () => {
@@ -147,6 +151,7 @@ describe("FilesTab uploads", () => {
const click = vi.spyOn(HTMLInputElement.prototype, "click");
const wrapper = mountTab();
expect(uploadToFolderButton(wrapper)).toBeUndefined();
await uploadButton(wrapper)!.trigger("click");
expect(click).toHaveBeenCalled();
await pickFile(wrapper, "fix.ips");
@@ -179,7 +184,8 @@ describe("FilesTab uploads", () => {
it("asks for a destination from All files", async () => {
const wrapper = mountTab();
await uploadButton(wrapper)!.trigger("click");
expect(uploadButton(wrapper)).toBeUndefined();
await uploadToFolderButton(wrapper)!.trigger("click");
expect(wrapper.get(".dialog").attributes("data-open")).toBe("true");
const dialog = wrapper.findComponent(UploadFilesDialogStub);

View File

@@ -19,8 +19,9 @@
// inside each row.
//
// Section header (per active subtab):
// * Upload: the active subtab supplies the destination folder; "All
// files" has none, so the dialog asks for one.
// * Upload: a folder subtab supplies the destination folder.
// * Upload to folder: "All files" has no destination of its own, so its
// dialog asks for one.
//
// Content column:
// * Section header (Upload + Patch)
@@ -35,7 +36,7 @@
// Selected files in the Files tab can be deleted by users with the
// `rom.delete` permission. Each file is removed from disk and the DB
// row is dropped via `DELETE /roms/{rom_id}/files/{file_id}`.
import { RBtn, RCheckbox, REmptyState, RIcon, RTooltip } from "@v2/lib";
import { RBtn, RCheckbox, REmptyState, RIcon } from "@v2/lib";
import { computed, ref, watch } from "vue";
import { useI18n } from "vue-i18n";
import { useRoute, useRouter } from "vue-router";
@@ -549,11 +550,13 @@ const { uploading, uploadFiles: uploadRomFiles } = useRomFileUpload();
const uploadDialogOpen = ref(false);
const alive = useIsAlive();
const uploadFolders = computed<UploadFolderOption[]>(() =>
subtabDefs.value
// Root is always a destination, even before any file sits there.
const uploadFolders = computed<UploadFolderOption[]>(() => [
{ value: "", label: folderLabel(ROOT), icon: folderIcon(ROOT) },
...subtabDefs.value
.filter((s) => s.id !== "all" && s.id !== ROOT)
.map((s) => ({ value: s.id, label: s.label })),
);
.map((s) => ({ value: s.id, label: s.label, icon: s.icon })),
]);
// Destination implied by the active subtab: "" for the ROM root, null
// when there is none ("All files") and the dialog has to ask.
@@ -565,8 +568,7 @@ const activeUploadFolder = computed<string | null>(() => {
function triggerUpload() {
if (uploading.value) return;
if (activeUploadFolder.value === null) uploadDialogOpen.value = true;
else fileInput.value?.click();
fileInput.value?.click();
}
function onFilePick(event: Event) {
@@ -607,7 +609,6 @@ async function refreshRom() {
<UploadFilesDialog
v-model="uploadDialogOpen"
:folders="uploadFolders"
:initial-folder="activeUploadFolder ?? ''"
@submit="onDialogSubmit"
/>
@@ -642,7 +643,7 @@ async function refreshRom() {
<div class="r-v2-files__content">
<!-- Section header — the sidebar's subtab label already names the
section, so the header skips a redundant title and just hosts
the Upload button on the right. Download-all / Copy-link are
the upload action on the right. Download-all / Copy-link are
covered by the selection toolbar below (select-all then act). -->
<header
v-if="filteredFiles.length > 0 && canUpload"
@@ -650,6 +651,18 @@ async function refreshRom() {
>
<div class="r-v2-files__section-actions">
<RBtn
v-if="activeUploadFolder === null"
variant="outlined"
size="small"
prepend-icon="mdi-folder-upload-outline"
:disabled="uploading"
:loading="uploading"
@click="uploadDialogOpen = true"
>
{{ t("rom.upload-to-folder") }}
</RBtn>
<RBtn
v-else
variant="outlined"
size="small"
prepend-icon="mdi-cloud-upload-outline"
@@ -659,19 +672,6 @@ async function refreshRom() {
>
{{ t("common.upload") }}
</RBtn>
<RTooltip :text="t('rom.upload-to-folder')" location="bottom">
<template #activator="{ props: tipProps }">
<RBtn
v-bind="tipProps"
icon="mdi-folder-upload-outline"
variant="text"
size="small"
:aria-label="t('rom.upload-to-folder')"
:disabled="uploading"
@click="uploadDialogOpen = true"
/>
</template>
</RTooltip>
</div>
</header>

View File

@@ -48,12 +48,14 @@ const RBtn = {
template: `<button class="btn" :disabled="disabled" @click="$emit('click')"><slot /></button>`,
};
function mountDialog(initialFolder = "") {
function mountDialog() {
return mount(UploadFilesDialog, {
props: {
modelValue: true,
folders: [{ value: "hack", label: "Hack", icon: "mdi-pencil-ruler" }],
initialFolder,
folders: [
{ value: "", label: "Root", icon: "mdi-folder-home-outline" },
{ value: "hack", label: "Hack", icon: "mdi-pencil-ruler" },
],
},
global: {
stubs: {
@@ -92,14 +94,12 @@ describe("UploadFilesDialog", () => {
expect(payload.files.map((f) => f.name)).toEqual(["fix.ips"]);
});
it("preselects the active folder", async () => {
const wrapper = mountDialog("hack");
await wrapper.get(".dropzone").trigger("click");
await uploadButton(wrapper).trigger("click");
await nextTick();
it("offers a new folder ahead of the existing destinations", () => {
const wrapper = mountDialog();
const [payload] = wrapper.emitted("submit")![0] as [{ folder: string }];
expect(payload.folder).toBe("hack");
expect(
wrapper.findAll("select.dest option").map((o) => o.attributes("value")),
).toEqual(["__new__", "", "hack"]);
});
it("trims a new folder path before emitting it", async () => {
@@ -127,15 +127,16 @@ describe("UploadFilesDialog", () => {
formValid.value = true;
});
it("starts fresh every time it opens", async () => {
it("starts fresh on the root every time it opens", async () => {
const wrapper = mountDialog();
await wrapper.get("select.dest").setValue("hack");
await wrapper.get(".dropzone").trigger("click");
await wrapper.setProps({ modelValue: false });
await wrapper.setProps({ modelValue: true, initialFolder: "hack" });
await wrapper.setProps({ modelValue: true });
expect(uploadButton(wrapper).attributes("disabled")).toBeDefined();
expect(
(wrapper.get("select.dest").element as HTMLSelectElement).value,
).toBe("hack");
).toBe("");
});
});

View File

@@ -1,7 +1,7 @@
<script setup lang="ts">
// UploadFilesDialog: pick a destination inside the ROM folder and the files
// to send there. The Files tab owns the upload, and closes the dialog first.
import { RBtn, RDialog, RForm, RSelect, RTextField } from "@v2/lib";
import { RBtn, RDialog, RForm, RIcon, RSelect, RTextField } from "@v2/lib";
import { computed, ref, watch } from "vue";
import { useI18n } from "vue-i18n";
import PendingFilesDropzone from "@/v2/components/shared/PendingFilesDropzone.vue";
@@ -11,12 +11,13 @@ export interface UploadFolderOption {
/** Folder path relative to the ROM root; "" is the root itself. */
value: string;
label: string;
icon: string;
}
const props = defineProps<{
modelValue: boolean;
/** Every destination to offer, the root included. */
folders: UploadFolderOption[];
initialFolder: string;
}>();
const emit = defineEmits<{
@@ -27,23 +28,37 @@ const emit = defineEmits<{
const { t } = useI18n();
const NEW_FOLDER = "__new__";
const ROOT_FOLDER = "";
const destination = ref<string>(props.initialFolder);
const destination = ref<string>(ROOT_FOLDER);
const newFolder = ref("");
const files = ref<File[]>([]);
const formRef = ref<InstanceType<typeof RForm> | null>(null);
const destinations = computed(() => [
{ value: "", title: t("rom.folder-root") },
...props.folders.map((f) => ({ value: f.value, title: f.label })),
{ value: NEW_FOLDER, title: t("rom.upload-new-folder") },
type Destination = { value: string; title: string; icon: string };
const destinations = computed<Destination[]>(() => [
{
value: NEW_FOLDER,
title: t("rom.upload-new-folder"),
icon: "mdi-plus",
},
...props.folders.map((f) => ({
value: f.value,
title: f.label,
icon: f.icon,
})),
]);
const destinationIcon = computed(
() => destinations.value.find((d) => d.value === destination.value)?.icon,
);
const isNewFolder = (item: Destination) => item.value === NEW_FOLDER;
watch(
() => props.modelValue,
(open) => {
if (!open) return;
destination.value = props.initialFolder;
destination.value = ROOT_FOLDER;
newFolder.value = "";
files.value = [];
},
@@ -82,8 +97,23 @@ async function submit() {
v-model="destination"
:items="destinations"
:label="t('rom.upload-destination')"
:prepend-inner-icon="destinationIcon"
:divider-after="isNewFolder"
hide-details
/>
>
<template #item="{ props: itemProps, item, selected }">
<li v-bind="itemProps">
<RIcon :icon="item.raw.icon" size="16" />
<span class="r-select__item-title">{{ item.title }}</span>
<RIcon
v-if="selected"
icon="mdi-check"
class="r-select__item-check"
size="x-small"
/>
</li>
</template>
</RSelect>
<RTextField
v-if="destination === NEW_FOLDER"
v-model="newFolder"

View File

@@ -125,6 +125,9 @@ const manualItems = computed(() =>
// The filled viewer is wrapped in an overlay RDropzone (drag files onto the
// manual to add another); the header's Upload button opens its picker.
const manualDz = ref<InstanceType<typeof RDropzone> | null>(null);
const canUploadMore = computed(
() => manualEntries.value.length > 0 && canEdit.value,
);
const redownloadingManual = ref(false);
function handleManualFiles(files: File[]) {
@@ -167,10 +170,13 @@ function requestDeleteManual() {
<template>
<div class="r-v2-manual">
<!-- The subtab label in the sidebar already names the section, so the
header skips a redundant title and just hosts the entry selector
(when multiple). -->
<header v-if="manualEntries.length > 1" class="r-v2-manual__head">
header skips a redundant title. -->
<header
v-if="manualEntries.length > 1 || canUploadMore"
class="r-v2-manual__head"
>
<RSelect
v-if="manualEntries.length > 1"
v-model="selectedManualId"
:items="manualItems"
density="compact"
@@ -178,6 +184,16 @@ function requestDeleteManual() {
hide-details
class="r-v2-manual__select"
/>
<RBtn
v-if="canUploadMore"
variant="outlined"
size="small"
prepend-icon="mdi-cloud-upload-outline"
class="r-v2-manual__upload"
@click="manualDz?.open()"
>
{{ t("common.upload") }}
</RBtn>
</header>
<REmptyState
@@ -256,18 +272,6 @@ function requestDeleteManual() {
/>
</div>
</RDropzone>
<div v-if="manualEntries.length > 0 && canEdit">
<RBtn
block
variant="outlined"
size="small"
prepend-icon="mdi-cloud-upload-outline"
@click="manualDz?.open()"
>
{{ t("common.upload") }}
</RBtn>
</div>
</div>
</template>
@@ -300,6 +304,10 @@ function requestDeleteManual() {
flex-shrink: 1;
}
.r-v2-manual__upload {
margin-left: auto;
}
/* Overlay-mode RDropzone wrapping the viewer must fill the panel height so
the inner viewer can stretch to 100%. The min-height keeps the flex chain
from collapsing the viewer to zero. */

View File

@@ -231,6 +231,22 @@ async function deleteSoundtrack(fileId: number) {
<!-- Soundtrack subtab -->
<section v-show="subTab === 'soundtrack'" class="r-v2-media__panel">
<header
v-if="rom.has_soundtrack && canEdit"
class="r-v2-media__section-head"
>
<div class="r-v2-media__section-actions">
<RBtn
variant="outlined"
size="small"
prepend-icon="mdi-cloud-upload-outline"
@click="soundtrackDz?.open()"
>
{{ t("common.upload") }}
</RBtn>
</div>
</header>
<REmptyState
v-if="!rom.has_soundtrack && !canEdit"
:title="t('rom.soundtrack-empty')"
@@ -269,20 +285,6 @@ async function deleteSoundtrack(fileId: number) {
@delete-track="deleteSoundtrack"
/>
</RDropzone>
<div v-if="rom.has_soundtrack && canEdit">
<div class="r-v2-media__section-actions">
<RBtn
block
variant="outlined"
size="small"
prepend-icon="mdi-cloud-upload-outline"
@click="soundtrackDz?.open()"
>
{{ t("common.upload") }}
</RBtn>
</div>
</div>
</section>
</div>
</div>
@@ -373,9 +375,14 @@ async function deleteSoundtrack(fileId: number) {
min-height: 0;
}
/* Section footer. The sidebar's subtab label already
names the section, so the header skips the title and hosts the
contextual controls only: the action cluster pushed to the right. */
/* The sidebar's subtab label already names the section, so the header skips
the title and pushes the action cluster to the right. */
.r-v2-media__section-head {
display: flex;
align-items: center;
gap: 12px;
flex-shrink: 0;
}
.r-v2-media__section-actions {
margin-left: auto;
display: flex;

View File

@@ -131,7 +131,7 @@ describe("UploadAssetDialog", () => {
formValid.value = true;
});
it("keeps Upload disabled until a file is picked, then uploads as an archive", async () => {
it("keeps Upload disabled until a file is picked, then uploads into autosave", async () => {
const wrapper = mountDialog("save");
expect(uploadButton(wrapper).attributes("disabled")).toBeDefined();
@@ -139,29 +139,40 @@ describe("UploadAssetDialog", () => {
expect(uploadButton(wrapper).attributes("disabled")).toBeUndefined();
const payload = await submitted(wrapper);
expect(payload).toMatchObject({ type: "save", slot: null, emulator: null });
expect(payload).toMatchObject({
type: "save",
slot: "autosave",
emulator: null,
});
expect(payload!.files.map((f) => f.name)).toEqual(["game.srm"]);
});
it("offers autosave, the slots in use and a new one", async () => {
it("offers a new slot first, then autosave, the slots in use and no slot", async () => {
const wrapper = mountDialog("save", [new File(["x"], "a.srm")]);
const options = wrapper.findAll("select")[0].findAll("option");
expect(options.map((o) => o.text())).toEqual([
"play.slot-none",
"play.new-slot",
"autosave",
"main_quest",
"play.new-slot",
"play.slot-none",
]);
await choose(wrapper, 0, 2);
expect(await submitted(wrapper)).toMatchObject({ slot: "main_quest" });
});
it("uploads as an archive when no slot is picked", async () => {
const wrapper = mountDialog("save", [new File(["x"], "a.srm")]);
await choose(wrapper, 0, 3);
expect(await submitted(wrapper)).toMatchObject({ slot: null });
});
it("names a new slot and asks saves for nothing else", async () => {
const wrapper = mountDialog("save", [new File(["x"], "a.srm")]);
expect(wrapper.findAll("select")).toHaveLength(1);
await choose(wrapper, 0, 3);
await choose(wrapper, 0, 0);
await wrapper.get("input.slot-name").setValue(" speedrun ");
expect(await submitted(wrapper)).toMatchObject({
@@ -173,7 +184,7 @@ describe("UploadAssetDialog", () => {
it("does not submit while the form is invalid", async () => {
formValid.value = false;
const wrapper = mountDialog("save", [new File(["x"], "a.srm")]);
await choose(wrapper, 0, 3);
await choose(wrapper, 0, 0);
expect(await submitted(wrapper)).toBeUndefined();
});

View File

@@ -5,11 +5,13 @@ import { RBtn, RDialog, RForm, RIcon, RSelect, RTextField } from "@v2/lib";
import { computed, ref, watch } from "vue";
import { useI18n } from "vue-i18n";
import type { SaveSchema } from "@/__generated__";
import { SAVE_SLOT_MAX_LENGTH } from "@/services/api/save";
import { AUTOSAVE_SLOT, SAVE_SLOT_MAX_LENGTH } from "@/services/api/save";
import PendingFilesDropzone from "@/v2/components/shared/PendingFilesDropzone.vue";
import type { AssetType } from "@/v2/utils/assets";
import {
chosenSlot,
existingSlot,
isNewSlotChoice,
isSlotChoice,
slotChoiceKey,
slotChoiceTitle,
@@ -47,15 +49,15 @@ const emit = defineEmits<{
const { t } = useI18n();
const slot = ref<UploadSlot>(NO_SLOT);
const slot = ref<UploadSlot>(existingSlot(AUTOSAVE_SLOT));
const newSlotName = ref("");
const core = ref("");
const files = ref<File[]>([]);
const formRef = ref<InstanceType<typeof RForm> | null>(null);
const slotItems = computed<UploadSlot[]>(() => [
NO_SLOT,
...slotChoices(props.saves),
NO_SLOT,
]);
const slotTitle = (choice: UploadSlot) =>
choice.kind === "none" ? t("play.slot-none") : slotChoiceTitle(choice);
@@ -83,7 +85,7 @@ watch(
() => props.modelValue,
(open) => {
if (!open) return;
slot.value = NO_SLOT;
slot.value = existingSlot(AUTOSAVE_SLOT);
newSlotName.value = "";
core.value = "";
files.value = [];
@@ -139,6 +141,7 @@ async function submit() {
:item-title="slotTitle"
:item-value="slotKey"
return-object
:divider-after="isNewSlotChoice"
prefix-label="inline"
:hint="t('rom.upload-slot-hint')"
@update:model-value="onSlot"

View File

@@ -12,7 +12,7 @@
// Cards key HARD on `emulator` (that is what claim-time lookup uses); the
// optional `platformId` is a display/creation hint only and never scopes the
// fetch.
import { RBtn, RDialog, RIcon, RSelect } from "@v2/lib";
import { RBtn, RDialog, RSelect } from "@v2/lib";
import { computed, ref, watch } from "vue";
import { useI18n } from "vue-i18n";
import type { MemoryCardSchema } from "@/__generated__";
@@ -141,6 +141,7 @@ async function submitCreate(name: string): Promise<void> {
:placeholder="
cards.length === 0 ? t('play.no-memory-cards') : undefined
"
:info="t('play.memory-card-hint')"
@update:model-value="onSelect"
/>
<RBtn
@@ -191,11 +192,6 @@ async function submitCreate(name: string): Promise<void> {
</RBtn>
</template>
</RDialog>
<p class="r-mc-picker__hint">
<RIcon icon="mdi-information-outline" size="12" />
<span>{{ t("play.memory-card-hint") }}</span>
</p>
</div>
</template>
@@ -216,13 +212,4 @@ async function submitCreate(name: string): Promise<void> {
flex: 1 1 auto;
min-width: 0;
}
.r-mc-picker__hint {
display: flex;
align-items: center;
gap: 5px;
margin: 0;
color: var(--r-color-fg-muted);
font-size: var(--r-font-size-xs);
}
</style>

View File

@@ -445,6 +445,54 @@ export const CustomItemSlot: Story = {
}),
};
export const InlineLabelWithInfo: Story = {
name: "Label · inline + info",
render: () => ({
components: { RSelect, RIcon },
setup: () => ({
value: ref("autosave"),
items: ["autosave", "main_quest"],
}),
template: `
<div style="width:340px">
<RSelect
v-model="value"
:items="items"
prefix-label="inline"
density="compact"
info="Progress is saved as new versions in this slot."
hide-details
>
<template #prefix-label>
<RIcon icon="mdi-content-save-all-outline" size="14" />
Slot
</template>
</RSelect>
</div>
`,
}),
};
// ── Divider ───────────────────────────────────────────────────────
export const DividerAfter: Story = {
name: "Divider after an item",
render: () => ({
components: { RSelect },
setup: () => ({
value: ref("root"),
items: [
{ title: "New folder", value: "new" },
{ title: "Root", value: "root" },
{ title: "DLC", value: "dlc" },
{ title: "Updates", value: "updates" },
],
isNew: (item: { value: string }) => item.value === "new",
}),
template: `<div style="width:340px"><RSelect v-model="value" :items="items" :divider-after="isNew" label="Destination" /></div>`,
}),
};
// ── Real-world ────────────────────────────────────────────────────
export const FormRow: Story = {

View File

@@ -1,7 +1,154 @@
import { mount } from "@vue/test-utils";
import { describe, expect, it } from "vitest";
import { afterEach, describe, expect, it } from "vitest";
import { nextTick } from "vue";
import { useInputModality } from "@/v2/composables/useInputModality";
import RTooltip from "@/v2/lib/structural/RTooltip/RTooltip.vue";
import RSelect from "./RSelect.vue";
describe("RSelect append label", () => {
const { setModality } = useInputModality();
afterEach(() => setModality("mouse"));
function mountWith(options: { info?: string; slot?: string }) {
return mount(RSelect, {
props: {
items: ["autosave"],
modelValue: "autosave",
hideDetails: true,
info: options.info,
},
slots: options.slot ? { "append-label": options.slot } : {},
attachTo: document.body,
});
}
function infoOpen(wrapper: ReturnType<typeof mountWith>) {
return wrapper.getComponent(RTooltip).props("modelValue");
}
it("describes the field with the info outside any aria-hidden subtree", () => {
const wrapper = mountWith({ info: "Slot info" });
const field = wrapper.get(".r-select__field");
const id = field.attributes("aria-describedby");
const description = document.getElementById(id ?? "");
expect(description?.textContent).toBe("Slot info");
expect(description?.closest("[aria-hidden='true']")).toBeNull();
expect(
wrapper.get(".r-select__label--append").attributes("aria-hidden"),
).toBeUndefined();
wrapper.unmount();
});
it("lets a slot replace the info content", () => {
const wrapper = mountWith({ info: "Slot info", slot: "MB" });
expect(wrapper.get(".r-select__label--append").text()).toBe("MB");
wrapper.unmount();
});
it("does not open the menu when the well is clicked", async () => {
const wrapper = mountWith({ info: "Slot info" });
await wrapper.get(".r-select__label--append").trigger("click");
await nextTick();
expect(wrapper.emitted("open")).toBeUndefined();
expect(document.querySelector(".r-select__panel")).toBeNull();
wrapper.unmount();
});
it("renders no well without info or slot", () => {
const wrapper = mountWith({});
expect(wrapper.find(".r-select__label--append").exists()).toBe(false);
expect(
wrapper.get(".r-select__field").attributes("aria-describedby"),
).toBeUndefined();
wrapper.unmount();
});
it.each(["key", "pad"] as const)(
"reveals the info when the field takes %s focus",
async (modality) => {
setModality(modality);
const wrapper = mountWith({ info: "Slot info" });
await wrapper.get(".r-select__field").trigger("focus");
expect(infoOpen(wrapper)).toBe(true);
await wrapper.get(".r-select__field").trigger("blur");
expect(infoOpen(wrapper)).toBe(false);
wrapper.unmount();
},
);
it("keeps the info closed on mouse focus", async () => {
const wrapper = mountWith({ info: "Slot info" });
await wrapper.get(".r-select__field").trigger("focus");
expect(infoOpen(wrapper)).toBe(false);
wrapper.unmount();
});
it("closes the info once the menu opens", async () => {
setModality("key");
const wrapper = mountWith({ info: "Slot info" });
await wrapper.get(".r-select__field").trigger("focus");
await wrapper.get(".r-select__field").trigger("click");
expect(wrapper.emitted("open")).toHaveLength(1);
expect(infoOpen(wrapper)).toBe(false);
wrapper.unmount();
});
});
describe("RSelect dividerAfter", () => {
const items = [
{ title: "New", value: "new" },
{ title: "Root", value: "root" },
{ title: "Hack", value: "hack" },
];
async function openMenu(dividerAfter: (item: { value: string }) => boolean) {
const wrapper = mount(RSelect, {
props: { items, modelValue: "root", dividerAfter },
attachTo: document.body,
});
await wrapper.get(".r-select__field").trigger("click");
await nextTick();
return wrapper;
}
function menuRows() {
return Array.from(document.querySelectorAll(".r-select__list > li")).map(
(li) =>
li.classList.contains("r-select__divider") ? "---" : li.textContent,
);
}
it("draws a divider below the matched item without shifting indexes", async () => {
const wrapper = await openMenu((item) => item.value === "new");
expect(menuRows()).toEqual(["New", "---", "Root", "Hack"]);
const indexes = Array.from(
document.querySelectorAll("[data-r-select-index]"),
).map((li) => li.getAttribute("data-r-select-index"));
expect(indexes).toEqual(["0", "1", "2"]);
wrapper.unmount();
});
it("never leaves a divider trailing the last row", async () => {
const wrapper = await openMenu((item) => item.value === "hack");
expect(menuRows()).toEqual(["New", "Root", "Hack"]);
wrapper.unmount();
});
});
// Regression guard: `.r-select__value` is a flex row with a 6px gap (it
// spaces chips apart). A multi-select without chips renders its titles and
// the "," separator as plain spans, so hoisting them into that row put the

View File

@@ -13,7 +13,9 @@
// spread on any element you want — it carries `class` (including the
// active/selected/disabled state), `role`, `aria-*`, click/hover
// handlers, and the index data attribute. The row default is a `<li>`
// styled by `.r-select__item`.
// styled by `.r-select__item`. `dividerAfter` draws a divider below the
// rows it matches. `#append-label` adds a trailing well that mirrors the
// inline prefix label; `info` fills it with an info icon and tooltip.
import {
autoUpdate,
flip,
@@ -34,11 +36,13 @@ import {
useSlots,
watch,
} from "vue";
import { useInputModality } from "@/v2/composables/useInputModality";
import { shouldAutofocusSearch } from "@/v2/utils/autofocus";
import RDivider from "../../primitives/RDivider/RDivider.vue";
import RIcon from "../../primitives/RIcon/RIcon.vue";
import RProgressCircular from "../../primitives/RProgressCircular/RProgressCircular.vue";
import RTag from "../../primitives/RTag/RTag.vue";
import RTooltip from "../../structural/RTooltip/RTooltip.vue";
import { useRFormRegistration } from "../RForm/context";
import RTextField from "../RTextField/RTextField.vue";
@@ -130,6 +134,12 @@ interface Props {
/** Label used by the "All" row in the menu and as the activator
* display when nothing is selected. Defaults to "All". */
allOptionLabel?: string;
/** Items it matches get a divider below their row, setting them apart
* from the ones that follow. */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
dividerAfter?: (item: any) => boolean;
/** Tip revealed from an info icon in the trailing label well. */
info?: string;
}
const props = withDefaults(defineProps<Props>(), {
@@ -168,6 +178,8 @@ const props = withDefaults(defineProps<Props>(), {
chipTone: "brand",
showAllOption: false,
allOptionLabel: "All",
dividerAfter: undefined,
info: undefined,
});
const emit = defineEmits<{
@@ -699,6 +711,7 @@ function openMenu() {
if (props.disabled || props.readonly) return;
if (isOpen.value) return;
isOpen.value = true;
infoOpen.value = false;
activeIndex.value = Math.max(
0,
filteredItems.value.findIndex((it) => isSelected(it.value)),
@@ -837,11 +850,19 @@ function onSearchKey(evt: KeyboardEvent) {
// ── Focus tracking for the activator chrome ────────────────────
const focused = ref(false);
// The info icon sits inside the activator, so keyboard or pad focus on the
// field stands in for focus on the icon.
const { modality } = useInputModality();
const infoOpen = ref(false);
function onActivatorFocus(evt: FocusEvent) {
focused.value = true;
if (props.info && (modality.value === "key" || modality.value === "pad")) {
infoOpen.value = true;
}
emit("focus", evt);
}
function onActivatorBlur(evt: FocusEvent) {
infoOpen.value = false;
// If focus moves into the panel (search input), keep `focused`.
const next = evt.relatedTarget as Node | null;
if (next && panelRef.value?.contains(next)) return;
@@ -863,6 +884,15 @@ const stackedLabelOn = computed(() => props.prefixLabel === "stacked");
const hasPrependInner = computed(
() => !!props.prependInnerIcon || !!slots["prepend-inner"],
);
const hasAppendLabel = computed(() => !!slots["append-label"] || !!props.info);
const describedBy = computed(() => {
const ids = [
showDetails.value && `${fieldId}-details`,
props.info && `${fieldId}-info`,
].filter(Boolean);
return ids.length > 0 ? ids.join(" ") : undefined;
});
</script>
<template>
@@ -906,7 +936,7 @@ const hasPrependInner = computed(
:aria-expanded="isOpen"
:aria-label="effectiveAriaLabel"
:aria-invalid="hasError || undefined"
:aria-describedby="showDetails ? `${fieldId}-details` : undefined"
:aria-describedby="describedBy"
@click="toggleMenu"
@keydown="onActivatorKey"
@focus="onActivatorFocus"
@@ -1092,6 +1122,29 @@ const hasPrependInner = computed(
size="x-small"
/>
</span>
<!-- Swallows clicks so an info tooltip inside doesn't toggle the menu. -->
<span
v-if="hasAppendLabel"
class="r-select__label r-select__label--append"
@click.stop
@mousedown.stop
>
<slot name="append-label">
<RIcon icon="mdi-information-outline" size="16" />
<RTooltip
v-model="infoOpen"
activator="parent"
location="top"
open-on-tap
>
{{ info }}
</RTooltip>
</slot>
</span>
<!-- Hidden so it stays out of the field's name; aria-describedby still
reads it. -->
<span v-if="info" :id="`${fieldId}-info`" hidden>{{ info }}</span>
</button>
<!-- Details row — error or hint. -->
@@ -1184,55 +1237,65 @@ const hasPrependInner = computed(
<slot name="no-data">No options</slot>
</li>
<slot
<template
v-for="(item, i) in filteredItems"
:key="`${i}-${String(item.value)}`"
name="item"
:item="{ title: item.title, value: item.value, raw: item.raw }"
:index="i"
:active="i === activeIndex"
:selected="isSelected(item.value)"
:props="{
class: [
'r-select__item',
{
>
<slot
name="item"
:item="{ title: item.title, value: item.value, raw: item.raw }"
:index="i"
:active="i === activeIndex"
:selected="isSelected(item.value)"
:props="{
class: [
'r-select__item',
{
'r-select__item--active': i === activeIndex,
'r-select__item--selected': isSelected(item.value),
'r-select__item--disabled': item.disabled,
},
],
role: 'option',
'aria-selected': isSelected(item.value),
'aria-disabled': item.disabled || undefined,
'data-r-select-index': i,
tabindex: -1,
onClick: () => selectItem(item),
onMouseenter: () => (activeIndex = i),
}"
>
<!-- eslint-disable-next-line vuejs-accessibility/click-events-have-key-events, vuejs-accessibility/interactive-supports-focus, vuejs-accessibility/mouse-events-have-key-events -- option rows are pointer targets; the listbox-level keydown (Up/Down/Enter/Esc) drives keyboard selection and roving activeIndex -->
<li
role="option"
class="r-select__item"
:class="{
'r-select__item--active': i === activeIndex,
'r-select__item--selected': isSelected(item.value),
'r-select__item--disabled': item.disabled,
},
],
role: 'option',
'aria-selected': isSelected(item.value),
'aria-disabled': item.disabled || undefined,
'data-r-select-index': i,
tabindex: -1,
onClick: () => selectItem(item),
onMouseenter: () => (activeIndex = i),
}"
>
<!-- eslint-disable-next-line vuejs-accessibility/click-events-have-key-events, vuejs-accessibility/interactive-supports-focus, vuejs-accessibility/mouse-events-have-key-events -- option rows are pointer targets; the listbox-level keydown (Up/Down/Enter/Esc) drives keyboard selection and roving activeIndex -->
}"
:aria-selected="isSelected(item.value)"
:data-r-select-index="i"
@click="selectItem(item)"
@mouseenter="activeIndex = i"
>
<span class="r-select__item-title">{{ item.title }}</span>
<RIcon
v-if="isSelected(item.value)"
icon="mdi-check"
class="r-select__item-check"
size="x-small"
/>
</li>
</slot>
<li
role="option"
class="r-select__item"
:class="{
'r-select__item--active': i === activeIndex,
'r-select__item--selected': isSelected(item.value),
'r-select__item--disabled': item.disabled,
}"
:aria-selected="isSelected(item.value)"
:data-r-select-index="i"
@click="selectItem(item)"
@mouseenter="activeIndex = i"
v-if="dividerAfter?.(item.raw) && i < filteredItems.length - 1"
class="r-select__divider"
aria-hidden="true"
>
<span class="r-select__item-title">{{ item.title }}</span>
<RIcon
v-if="isSelected(item.value)"
icon="mdi-check"
class="r-select__item-check"
size="x-small"
/>
<RDivider />
</li>
</slot>
</template>
</ul>
</div>
</Transition>
@@ -1556,13 +1619,13 @@ const hasPrependInner = computed(
align-self: flex-start;
padding-inline-start: 2px;
}
.r-select__label--inline {
.r-select__label--inline,
.r-select__label--append {
align-self: stretch;
display: inline-flex;
align-items: center;
padding: 0 10px;
background: var(--r-color-bg-elevated);
border-right: 1px solid var(--r-color-border);
font-size: 11px;
font-weight: var(--r-font-weight-bold);
letter-spacing: 0.08em;
@@ -1573,15 +1636,32 @@ const hasPrependInner = computed(
text-overflow: ellipsis;
transition:
background var(--r-motion-fast) var(--r-motion-ease-out),
border-right-color var(--r-motion-fast) var(--r-motion-ease-out),
border-color var(--r-motion-fast) var(--r-motion-ease-out),
color var(--r-motion-fast) var(--r-motion-ease-out);
}
.r-select__label--inline {
border-right: 1px solid var(--r-color-border);
}
.r-select__label--append {
flex-shrink: 0;
border-left: 1px solid var(--r-color-border);
cursor: default;
}
.r-select--inline.r-select--focused .r-select__label--inline {
border-right-color: var(--r-tf-color);
}
.r-select--inline.r-select--error .r-select__label--inline {
border-right-color: var(--r-color-danger);
}
.r-select--focused .r-select__label--append {
border-left-color: var(--r-tf-color);
}
.r-select--error .r-select__label--append {
border-left-color: var(--r-color-danger);
}
.r-select__field:has(.r-select__label--append) {
overflow: hidden;
}
.r-select--inline .r-select__field {
padding-inline-start: 0;
overflow: hidden;

View File

@@ -28,8 +28,8 @@ describe("preferredSlot", () => {
describe("slotChoices", () => {
it("offers autosave and a new slot even when no save exists yet", () => {
expect(slotChoices([])).toEqual([
existingSlot("autosave"),
NEW_SLOT_CHOICE,
existingSlot("autosave"),
]);
});
@@ -43,18 +43,18 @@ describe("slotChoices", () => {
];
expect(slotChoices(saves)).toEqual([
NEW_SLOT_CHOICE,
existingSlot("autosave"),
existingSlot("main_quest"),
existingSlot("speedrun"),
NEW_SLOT_CHOICE,
]);
});
it("matches slot names exactly, like the backend", () => {
expect(slotChoices([save(1, "Autosave")])).toEqual([
NEW_SLOT_CHOICE,
existingSlot("autosave"),
existingSlot("Autosave"),
NEW_SLOT_CHOICE,
]);
});
});

View File

@@ -28,7 +28,7 @@ export function isSlotChoice(value: unknown): value is SlotChoice {
);
}
/** Autosave first, then every slot in use, then the entry for a new slot. */
/** The entry for a new slot first, then autosave and every slot in use. */
export function slotChoices(
saves: readonly Pick<SaveSchema, "slot">[],
): SlotChoice[] {
@@ -36,11 +36,16 @@ export function slotChoices(
.map((save) => save.slot)
.filter((slot): slot is string => !!slot && slot !== AUTOSAVE_SLOT);
return [
...[AUTOSAVE_SLOT, ...new Set(named)].map(existingSlot),
NEW_SLOT_CHOICE,
...[AUTOSAVE_SLOT, ...new Set(named)].map(existingSlot),
];
}
/** Pickers set the new-slot entry apart from the slots that already exist. */
export function isNewSlotChoice(choice: { kind: string }): boolean {
return choice.kind === "new";
}
export function slotChoiceTitle(choice: SlotChoice): string {
return choice.kind === "new" ? i18n.global.t("play.new-slot") : choice.slot;
}

View File

@@ -23,7 +23,6 @@ import {
RSpinner,
RSwitch,
RTextField,
RTooltip,
} from "@v2/lib";
import { useEventListener, useLocalStorage } from "@vueuse/core";
import type { Emitter } from "mitt";
@@ -88,6 +87,7 @@ import { suppressVirtualGamepadZoneTouch } from "@/v2/utils/playerTouchGuard";
import {
chosenSlot,
existingSlot,
isNewSlotChoice,
isSlotChoice,
preferredSlot,
slotChoiceKey,
@@ -658,37 +658,26 @@ const saveSlot = computed(() => chosenSlot(slotChoice.value, customSlot.value));
</RAlert>
<div v-if="isSavesTabSelected" class="r-v2-ejs__slot">
<div class="r-v2-ejs__slot-row">
<RSelect
class="r-v2-ejs__slot-select"
:model-value="slotChoice"
:disabled="!!boundSlot"
variant="outlined"
density="compact"
prefix-label="inline"
hide-details
:items="slotItems"
:item-title="slotChoiceTitle"
:item-value="slotChoiceKey"
return-object
@update:model-value="onSlotChoice"
>
<template #prefix-label>
<RIcon icon="mdi-content-save-all-outline" size="14" />
{{ t("play.slot") }}
</template>
</RSelect>
<button
type="button"
class="r-v2-ejs__slot-info"
:aria-label="t('play.slot-tooltip')"
>
<RIcon icon="mdi-information-outline" size="16" />
<RTooltip activator="parent" location="top" open-on-tap>
{{ t("play.slot-tooltip") }}
</RTooltip>
</button>
</div>
<RSelect
:model-value="slotChoice"
:disabled="!!boundSlot"
variant="outlined"
density="compact"
prefix-label="inline"
hide-details
:items="slotItems"
:item-title="slotChoiceTitle"
:item-value="slotChoiceKey"
return-object
:divider-after="isNewSlotChoice"
:info="t('play.slot-tooltip')"
@update:model-value="onSlotChoice"
>
<template #prefix-label>
<RIcon icon="mdi-content-save-all-outline" size="14" />
{{ t("play.slot") }}
</template>
</RSelect>
<RTextField
v-if="!boundSlot && slotChoice.kind === 'new'"
v-model="customSlot"
@@ -1033,35 +1022,6 @@ html[data-bp~="md-and-up"]
flex-direction: column;
gap: 8px;
}
.r-v2-ejs__slot-row {
display: flex;
align-items: center;
gap: 8px;
}
.r-v2-ejs__slot-select {
flex: 1 1 auto;
min-width: 0;
}
.r-v2-ejs__slot-info {
appearance: none;
position: relative;
display: inline-flex;
padding: 0;
border: 0;
background: none;
color: var(--r-color-fg-secondary);
border-radius: var(--r-radius-pill);
cursor: pointer;
}
/* 44px hit area around the 16px icon without growing the row. */
.r-v2-ejs__slot-info::before {
content: "";
position: absolute;
inset: -14px;
}
.r-v2-ejs__slot-info:hover {
color: var(--r-color-fg);
}
.r-v2-ejs__assets {
flex: 1;
min-height: 0;

View File

@@ -5,7 +5,7 @@
//
// Provider / region / language identifiers are proper nouns or codes, so
// they stay as data constants; only descriptive prose goes through i18n.
import { RAlert, RIcon, RSelect, RBtn, RSpinner } from "@v2/lib";
import { RAlert, RSelect, RBtn, RSpinner } from "@v2/lib";
import { storeToRefs } from "pinia";
import { computed, onBeforeUnmount, onMounted, reactive, ref } from "vue";
import { useI18n } from "vue-i18n";
@@ -503,13 +503,10 @@ onBeforeUnmount(() =>
searchable
:disabled="!canEdit"
:placeholder="t('settings.scan-media-placeholder')"
:info="t('settings.scan-media-note')"
hide-details
@update:model-value="setMedia"
/>
<p class="r-v2-scan-settings__note">
<RIcon icon="mdi-information-outline" size="13" />
{{ t("settings.scan-media-note") }}
</p>
</div>
</SettingsSection>
@@ -618,7 +615,6 @@ onBeforeUnmount(() =>
color: var(--r-color-fg-muted);
font-size: 13px;
line-height: 1.5;
max-width: 680px;
}
/* When a description sits directly above a field block, drop its bottom
padding so the field's own padding provides the gap. */
@@ -636,15 +632,6 @@ onBeforeUnmount(() =>
border-top: 1px solid var(--r-color-border);
}
.r-v2-scan-settings__note {
margin: 0;
display: flex;
align-items: center;
gap: 6px;
font-size: 12px;
color: var(--r-color-fg-faint);
}
.r-v2-scan-settings__toggle-grid {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));