mirror of
https://github.com/stablyai/orca.git
synced 2026-10-31 00:57:45 +00:00
fix(wsl-mover): add-host copy says bridge projects move automatically (#35330)
* fix(wsl-mover): add-host copy says bridge projects move automatically, in every locale * fix(wsl-mover): add-host copy scopes the move to this distro and keeps Windows-drive projects here * test(wsl-mover): sweep every locale's old 'until you move them' wording
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { readdirSync, readFileSync } from 'node:fs'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { renderToStaticMarkup } from 'react-dom/server'
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import type { WslHostDistro } from '../../../../shared/wsl-host-types'
|
||||
@@ -15,6 +17,14 @@ const debian: WslHostDistro = { name: 'Debian', state: 'stopped', version: 2, en
|
||||
const legacy: WslHostDistro = { name: 'Legacy', state: 'running', version: 1, environmentId: null }
|
||||
const added: WslHostDistro = { ...ubuntu, name: 'Arch', environmentId: 'wsl:arch' }
|
||||
|
||||
const LOCALES_DIR = fileURLToPath(new URL('../../i18n/locales/', import.meta.url))
|
||||
const LOCALE_FILES = readdirSync(LOCALES_DIR).filter((file) => file.endsWith('.json'))
|
||||
|
||||
function readLocaleDescription(file: string): string {
|
||||
const catalog = JSON.parse(readFileSync(`${LOCALES_DIR}${file}`, 'utf8'))
|
||||
return String(catalog.auto.components.sidebar.AddWslHostFormPanel.description)
|
||||
}
|
||||
|
||||
function render(props: Partial<Parameters<typeof AddWslHostFormPanel>[0]> = {}): string {
|
||||
return renderToStaticMarkup(
|
||||
<AddWslHostFormPanel
|
||||
@@ -43,11 +53,43 @@ describe('AddWslHostFormPanel', () => {
|
||||
expect([ubuntu, debian, legacy, added].map(canAddWslDistro)).toEqual([true, true, false, false])
|
||||
})
|
||||
|
||||
it('does not promise bridge projects stay put once they can move to the host', () => {
|
||||
// "Use it for new projects; ... keep working as they are" contradicted the mover.
|
||||
it('says bridge projects move to the host on their own, and how to bring one back', () => {
|
||||
// Verify bug 9: "keep working as they are" and "until you move them" both contradicted the
|
||||
// automatic mover, which moves them once their terminals are idle.
|
||||
const html = render()
|
||||
expect(html).not.toContain('Use it for new projects')
|
||||
expect(html).toContain('until you move them to this host')
|
||||
expect(html).not.toContain('until you move them')
|
||||
expect(html).toContain('move to this host automatically once their terminals are idle')
|
||||
// Only this distro's projects move; Windows-drive ones never do (move scope refuses /mnt).
|
||||
expect(html).toContain('Projects in this distro that you opened through')
|
||||
expect(html).toContain('projects on a Windows drive (/mnt/…) stay on this computer')
|
||||
expect(html).toContain('bring a moved project back from the sidebar')
|
||||
})
|
||||
|
||||
it('carries the same promise in every locale, none still saying projects stay put', () => {
|
||||
const stale = [
|
||||
'new projects',
|
||||
'neue Projekte',
|
||||
'novos projetos',
|
||||
'новых проектов',
|
||||
'Yeni projeler',
|
||||
'新專案',
|
||||
// Each locale's old "until you move them", as the catalog carried it before verify bug 9.
|
||||
'until you move',
|
||||
'hasta que los muevas',
|
||||
"jusqu'à ce que vous les déplaciez",
|
||||
'移動するまで',
|
||||
'옮기기 전까지',
|
||||
'直到你将它们移到'
|
||||
]
|
||||
for (const file of LOCALE_FILES) {
|
||||
const description = readLocaleDescription(file)
|
||||
expect(description).toContain('wsl.localhost')
|
||||
expect(description).toContain('/mnt/…')
|
||||
for (const phrase of stale) {
|
||||
expect(description).not.toContain(phrase)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
it('spells out the WSL 2 conversion for a WSL 1 distro the list cannot offer', () => {
|
||||
|
||||
@@ -70,7 +70,7 @@ export function AddWslHostFormPanel({
|
||||
<DialogDescription>
|
||||
{translate(
|
||||
'auto.components.sidebar.AddWslHostFormPanel.description',
|
||||
'Orca runs its server inside the distro, so git, files and terminals run natively in Linux. Projects you opened through \\\\wsl.localhost keep working as they are until you move them to this host.'
|
||||
'Orca runs its server inside the distro, so git, files and terminals run natively in Linux. Projects in this distro that you opened through \\\\wsl.localhost move to this host automatically once their terminals are idle; projects on a Windows drive (/mnt/…) stay on this computer. You can bring a moved project back from the sidebar.'
|
||||
)}
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
|
||||
@@ -6541,7 +6541,7 @@
|
||||
"running": "Läuft",
|
||||
"stopped": "Gestoppt",
|
||||
"title": "WSL-Distribution hinzufügen",
|
||||
"description": "Orca führt seinen Server innerhalb der Distribution aus, sodass git, Dateien und Terminals nativ unter Linux laufen. Für neue Projekte verwenden; über \\\\wsl.localhost geöffnete Projekte funktionieren wie bisher.",
|
||||
"description": "Orca führt seinen Server innerhalb der Distribution aus, sodass git, Dateien und Terminals nativ unter Linux laufen. Projekte in dieser Distribution, die über \\\\wsl.localhost geöffnet wurden, werden automatisch auf diesen Host verschoben, sobald ihre Terminals inaktiv sind; Projekte auf einem Windows-Laufwerk (/mnt/…) bleiben auf diesem Computer. Ein verschobenes Projekt lässt sich über die Seitenleiste auf diesen Computer zurückholen.",
|
||||
"distro": "Distribution",
|
||||
"loading": "WSL-Distributionen werden gesucht…",
|
||||
"placeholder": "Distribution auswählen",
|
||||
|
||||
@@ -6559,7 +6559,7 @@
|
||||
"running": "Running",
|
||||
"stopped": "Stopped",
|
||||
"title": "Add WSL distro",
|
||||
"description": "Orca runs its server inside the distro, so git, files and terminals run natively in Linux. Projects you opened through \\\\wsl.localhost keep working as they are until you move them to this host.",
|
||||
"description": "Orca runs its server inside the distro, so git, files and terminals run natively in Linux. Projects in this distro that you opened through \\\\wsl.localhost move to this host automatically once their terminals are idle; projects on a Windows drive (/mnt/…) stay on this computer. You can bring a moved project back from the sidebar.",
|
||||
"distro": "Distro",
|
||||
"loading": "Looking for WSL distros…",
|
||||
"placeholder": "Choose a distro",
|
||||
|
||||
@@ -6203,7 +6203,7 @@
|
||||
"running": "En ejecución",
|
||||
"stopped": "Detenida",
|
||||
"title": "Agregar distro WSL",
|
||||
"description": "Orca ejecuta su servidor dentro de la distro, así que git, los archivos y las terminales se ejecutan de forma nativa en Linux. Los proyectos que abriste a través de \\\\wsl.localhost siguen funcionando tal como están hasta que los muevas a este host.",
|
||||
"description": "Orca ejecuta su servidor dentro de la distro, así que git, los archivos y las terminales se ejecutan de forma nativa en Linux. Los proyectos de esta distro que abriste a través de \\\\wsl.localhost se mueven a este host automáticamente cuando sus terminales están inactivas; los proyectos en una unidad de Windows (/mnt/…) se quedan en este equipo. Puedes devolver un proyecto movido desde la barra lateral.",
|
||||
"distro": "Distro",
|
||||
"loading": "Buscando distros WSL…",
|
||||
"placeholder": "Elige una distro",
|
||||
|
||||
@@ -6380,7 +6380,7 @@
|
||||
"running": "En cours",
|
||||
"stopped": "Arrêtée",
|
||||
"title": "Ajouter une distro WSL",
|
||||
"description": "Orca exécute son serveur dans la distro, de sorte que git, les fichiers et les terminaux s'exécutent nativement sous Linux. Les projets que vous avez ouverts via \\\\wsl.localhost continuent de fonctionner tels quels jusqu'à ce que vous les déplaciez vers cet hôte.",
|
||||
"description": "Orca exécute son serveur dans la distro, de sorte que git, les fichiers et les terminaux s'exécutent nativement sous Linux. Les projets de cette distro que vous avez ouverts via \\\\wsl.localhost sont déplacés automatiquement vers cet hôte dès que leurs terminaux sont inactifs ; les projets situés sur un lecteur Windows (/mnt/…) restent sur cet ordinateur. Vous pouvez ramener un projet déplacé depuis la barre latérale.",
|
||||
"distro": "Distro",
|
||||
"loading": "Recherche des distros WSL…",
|
||||
"placeholder": "Choisissez une distro",
|
||||
|
||||
@@ -6201,7 +6201,7 @@
|
||||
"running": "実行中",
|
||||
"stopped": "停止中",
|
||||
"title": "WSL ディストリビューションを追加",
|
||||
"description": "Orca はディストリビューション内でサーバーを実行するため、git、ファイル、ターミナルは Linux 上でネイティブに動作します。\\\\wsl.localhost 経由で開いたプロジェクトは、このホストに移動するまでそのまま動作し続けます。",
|
||||
"description": "Orca はディストリビューション内でサーバーを実行するため、git、ファイル、ターミナルは Linux 上でネイティブに動作します。このディストリビューション内で \\\\wsl.localhost 経由で開いたプロジェクトは、ターミナルがアイドル状態になると自動的にこのホストへ移動します。Windows ドライブ (/mnt/…) 上のプロジェクトはこのコンピューターに残ります。移動したプロジェクトはサイドバーから戻せます。",
|
||||
"distro": "ディストリビューション",
|
||||
"loading": "WSL ディストリビューションを探しています…",
|
||||
"placeholder": "ディストリビューションを選択",
|
||||
|
||||
@@ -6201,7 +6201,7 @@
|
||||
"running": "실행 중",
|
||||
"stopped": "중지됨",
|
||||
"title": "WSL 배포판 추가",
|
||||
"description": "Orca는 배포판 안에서 서버를 실행하므로 git, 파일, 터미널이 Linux에서 네이티브로 실행됩니다. \\\\wsl.localhost를 통해 연 프로젝트는 이 호스트로 옮기기 전까지 그대로 계속 작동합니다.",
|
||||
"description": "Orca는 배포판 안에서 서버를 실행하므로 git, 파일, 터미널이 Linux에서 네이티브로 실행됩니다. 이 배포판에서 \\\\wsl.localhost를 통해 연 프로젝트는 터미널이 유휴 상태가 되면 자동으로 이 호스트로 옮겨지며, Windows 드라이브(/mnt/…)에 있는 프로젝트는 이 컴퓨터에 남습니다. 옮겨진 프로젝트는 사이드바에서 다시 가져올 수 있습니다.",
|
||||
"distro": "배포판",
|
||||
"loading": "WSL 배포판 찾는 중…",
|
||||
"placeholder": "배포판 선택",
|
||||
|
||||
@@ -11331,7 +11331,7 @@
|
||||
"running": "Em execução",
|
||||
"stopped": "Parada",
|
||||
"title": "Adicionar distribuição WSL",
|
||||
"description": "O Orca executa seu servidor dentro da distribuição, para que git, arquivos e terminais funcionem nativamente no Linux. Use para novos projetos; os projetos que você abriu por \\\\wsl.localhost continuam funcionando como estão.",
|
||||
"description": "O Orca executa seu servidor dentro da distribuição, para que git, arquivos e terminais funcionem nativamente no Linux. Os projetos desta distribuição que você abriu por \\\\wsl.localhost são movidos automaticamente para este host quando seus terminais ficam ociosos; projetos em uma unidade do Windows (/mnt/…) permanecem neste computador. Você pode trazer de volta um projeto movido pela barra lateral.",
|
||||
"distro": "Distribuição",
|
||||
"loading": "Procurando distribuições WSL…",
|
||||
"placeholder": "Escolha uma distribuição",
|
||||
|
||||
@@ -6546,7 +6546,7 @@
|
||||
"running": "Работает",
|
||||
"stopped": "Остановлен",
|
||||
"title": "Добавить дистрибутив WSL",
|
||||
"description": "Orca запускает сервер внутри дистрибутива, поэтому Git, файлы и терминалы работают непосредственно в Linux. Используйте его для новых проектов; проекты, открытые через \\\\wsl.localhost, продолжат работать как раньше.",
|
||||
"description": "Orca запускает сервер внутри дистрибутива, поэтому Git, файлы и терминалы работают непосредственно в Linux. Проекты этого дистрибутива, открытые через \\\\wsl.localhost, автоматически переносятся на этот хост, когда их терминалы простаивают; проекты на диске Windows (/mnt/…) остаются на этом компьютере. Перенесённый проект можно вернуть из боковой панели.",
|
||||
"distro": "Дистрибутив",
|
||||
"loading": "Поиск дистрибутивов WSL…",
|
||||
"placeholder": "Выберите дистрибутив",
|
||||
|
||||
@@ -6506,7 +6506,7 @@
|
||||
"running": "Çalışıyor",
|
||||
"stopped": "Durduruldu",
|
||||
"title": "WSL dağıtımı ekle",
|
||||
"description": "Orca sunucusunu dağıtım içinde çalıştırır; böylece git, dosyalar ve terminaller doğrudan Linux'ta çalışır. Yeni projeler için kullanın; \\\\wsl.localhost üzerinden açtığınız projeler mevcut hâliyle çalışmaya devam eder.",
|
||||
"description": "Orca sunucusunu dağıtım içinde çalıştırır; böylece git, dosyalar ve terminaller doğrudan Linux'ta çalışır. Bu dağıtımda \\\\wsl.localhost üzerinden açtığınız projeler, terminalleri boşta kaldığında otomatik olarak bu ana bilgisayara taşınır; Windows sürücüsündeki (/mnt/…) projeler bu bilgisayarda kalır. Taşınan bir projeyi kenar çubuğundan geri getirebilirsiniz.",
|
||||
"distro": "Dağıtım",
|
||||
"loading": "WSL dağıtımları aranıyor…",
|
||||
"placeholder": "Dağıtım seçin",
|
||||
|
||||
@@ -6495,7 +6495,7 @@
|
||||
"running": "執行中",
|
||||
"stopped": "已停止",
|
||||
"title": "新增 WSL 發行版",
|
||||
"description": "Orca 在發行版內執行其伺服器,因此 git、檔案和終端機都在 Linux 中原生執行。請將其用於新專案;透過 \\\\wsl.localhost 開啟的專案會照常工作。",
|
||||
"description": "Orca 在發行版內執行其伺服器,因此 git、檔案和終端機都在 Linux 中原生執行。此發行版中透過 \\\\wsl.localhost 開啟的專案會在其終端機閒置時自動移到此主機;位於 Windows 磁碟機 (/mnt/…) 上的專案會留在此電腦。你可以從側邊欄將已移動的專案移回。",
|
||||
"distro": "發行版",
|
||||
"loading": "正在查詢 WSL 發行版…",
|
||||
"placeholder": "選擇發行版",
|
||||
|
||||
@@ -6201,7 +6201,7 @@
|
||||
"running": "运行中",
|
||||
"stopped": "已停止",
|
||||
"title": "添加 WSL 发行版",
|
||||
"description": "Orca 在发行版内运行其服务器,因此 git、文件和终端都在 Linux 中原生运行。通过 \\\\wsl.localhost 打开的项目会照常工作,直到你将它们移到此主机。",
|
||||
"description": "Orca 在发行版内运行其服务器,因此 git、文件和终端都在 Linux 中原生运行。此发行版中通过 \\\\wsl.localhost 打开的项目会在其终端空闲时自动移到此主机;位于 Windows 驱动器 (/mnt/…) 上的项目会留在此电脑。你可以从侧边栏将已移动的项目移回。",
|
||||
"distro": "发行版",
|
||||
"loading": "正在查找 WSL 发行版…",
|
||||
"placeholder": "选择发行版",
|
||||
|
||||
Reference in New Issue
Block a user