fix: reword folder grouping prompt away from "monorepo"
Reword the nested repository import dialog so it asks users whether to group discovered repositories rather than asserting they are a monorepo. Also keeps locale catalogs aligned with live nested-import strings and updates Electron folder-import coverage for the new affirmative action label.
This commit is contained in:
parent
b21f8cd230
commit
23d14aaa18
|
|
@ -100,22 +100,22 @@ function renderNestedStep(repoCount: number): string {
|
|||
}
|
||||
|
||||
describe('AddRepoDialogStepContent nested imports', () => {
|
||||
it('asks the monorepo question when no repos exist yet', () => {
|
||||
it('asks the grouping question when no repos exist yet', () => {
|
||||
const html = renderNestedStep(0)
|
||||
|
||||
expect(html).toContain('Is this a monorepo?')
|
||||
expect(html).toContain('aria-label="Monorepo name"')
|
||||
expect(html).toContain('Yes, import as monorepo')
|
||||
expect(html).toContain('Group these repositories?')
|
||||
expect(html).toContain('aria-label="Group name"')
|
||||
expect(html).toContain('Yes, import as group')
|
||||
expect(html).toContain('No, import separately')
|
||||
expect(html).not.toContain('>Import</button>')
|
||||
})
|
||||
|
||||
it('shows the same monorepo import controls after a repo already exists', () => {
|
||||
it('shows the same grouping import controls after a repo already exists', () => {
|
||||
const html = renderNestedStep(1)
|
||||
|
||||
expect(html).toContain('Is this a monorepo?')
|
||||
expect(html).toContain('aria-label="Monorepo name"')
|
||||
expect(html).toContain('Yes, import as monorepo')
|
||||
expect(html).toContain('Group these repositories?')
|
||||
expect(html).toContain('aria-label="Group name"')
|
||||
expect(html).toContain('Yes, import as group')
|
||||
expect(html).toContain('No, import separately')
|
||||
expect(html).not.toContain('>Import</button>')
|
||||
})
|
||||
|
|
|
|||
|
|
@ -72,19 +72,19 @@ describe('AddRepoNestedImportStep', () => {
|
|||
container = null
|
||||
})
|
||||
|
||||
it('asks whether the selected folder is a monorepo', () => {
|
||||
it('asks whether the selected folder should be grouped', () => {
|
||||
const html = renderStepMarkup()
|
||||
|
||||
expect(html).toContain('Import repositories from folder')
|
||||
expect(html).toContain('Found 3 repositories in')
|
||||
expect(html).toContain('/workspace/platform')
|
||||
expect(html).toContain('aria-label="Monorepo name"')
|
||||
expect(html).toContain('aria-label="Group name"')
|
||||
expect(html).not.toContain('What is a')
|
||||
expect(html).toContain('Is this a monorepo?')
|
||||
expect(html).toContain('Group these repositories?')
|
||||
expect(html).toContain('Choose this if these projects belong together')
|
||||
expect(html).toContain('Orca will group them and let you work from the parent folder')
|
||||
expect(html).toContain('No, import separately')
|
||||
expect(html).toContain('Yes, import as monorepo')
|
||||
expect(html).toContain('Yes, import as group')
|
||||
expect(html).toContain('payments/api')
|
||||
expect(html).toContain('billing/api')
|
||||
expect(html).not.toContain('disabled=""')
|
||||
|
|
@ -95,14 +95,14 @@ describe('AddRepoNestedImportStep', () => {
|
|||
it('disables both import actions while scanning', () => {
|
||||
const html = renderStepMarkup({ scanInProgress: true })
|
||||
|
||||
expect(html).toContain('Is this a monorepo?')
|
||||
expect(html).toContain('Group these repositories?')
|
||||
expect(html).toContain('No, import separately')
|
||||
expect(html).toContain('Yes, import as monorepo')
|
||||
expect(html).toContain('Yes, import as group')
|
||||
expect(html).toMatch(/<button[^>]*disabled=""[^>]*>No, import separately<\/button>/)
|
||||
expect(html).toMatch(/<button[^>]*disabled=""[^>]*>Yes, import as monorepo<\/button>/)
|
||||
expect(html).toMatch(/<button[^>]*disabled=""[^>]*>Yes, import as group<\/button>/)
|
||||
})
|
||||
|
||||
it('maps the monorepo choice to grouped import and the non-monorepo choice to separate import', () => {
|
||||
it('maps the group choice to grouped import and the separate choice to separate import', () => {
|
||||
const onImport = vi.fn()
|
||||
const host = document.createElement('div')
|
||||
container = host
|
||||
|
|
@ -130,7 +130,7 @@ describe('AddRepoNestedImportStep', () => {
|
|||
})
|
||||
|
||||
act(() => {
|
||||
findButton(host, 'Yes, import as monorepo').click()
|
||||
findButton(host, 'Yes, import as group').click()
|
||||
findButton(host, 'No, import separately').click()
|
||||
})
|
||||
|
||||
|
|
@ -174,13 +174,11 @@ describe('AddRepoNestedImportStep', () => {
|
|||
})
|
||||
|
||||
act(() => {
|
||||
findButton(host, 'Yes, import as monorepo').click()
|
||||
findButton(host, 'Yes, import as group').click()
|
||||
})
|
||||
|
||||
expect(onImport).toHaveBeenCalledWith('group')
|
||||
expect(
|
||||
findButton(host, 'Yes, import as monorepo').querySelector('.animate-spin')
|
||||
).not.toBeNull()
|
||||
expect(findButton(host, 'Yes, import as group').querySelector('.animate-spin')).not.toBeNull()
|
||||
expect(findButton(host, 'No, import separately').querySelector('.animate-spin')).toBeNull()
|
||||
})
|
||||
})
|
||||
|
|
|
|||
|
|
@ -105,13 +105,13 @@ export function AddRepoNestedImportStep({
|
|||
<p className="text-sm font-medium text-foreground">
|
||||
{translate(
|
||||
'auto.components.sidebar.AddRepoNestedImportStep.fb33359f69',
|
||||
'Is this a monorepo?'
|
||||
'Group these repositories?'
|
||||
)}
|
||||
</p>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
{translate(
|
||||
'auto.components.sidebar.AddRepoNestedImportStep.d75170194e',
|
||||
"Import them as a group if they're a monorepo or otherwise belong together. Orca will group them and let you work from the parent folder."
|
||||
'Choose this if these projects belong together — a monorepo, or just a set of related repos. Orca will group them and let you work from the parent folder.'
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
|
|
@ -156,7 +156,7 @@ export function AddRepoNestedImportStep({
|
|||
{showGroupSpinner ? <Loader2 className="size-3.5 animate-spin" /> : null}
|
||||
{translate(
|
||||
'auto.components.sidebar.AddRepoNestedImportStep.a0bc4d1f8e',
|
||||
'Import as group'
|
||||
'Yes, import as group'
|
||||
)}
|
||||
</Button>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -3384,22 +3384,17 @@
|
|||
"496f68cf8c": "Scanning repositories. Click to stop.",
|
||||
"a32bef9516": "Stop scanning",
|
||||
"2f8298f3c3": "Stop scan",
|
||||
"c157f31a95": "Import as group",
|
||||
"40199ef7b3": "Group name",
|
||||
"b20bb7c24f": "Keeps these repos together in one group. Best for related repos like microservices.",
|
||||
"787412361a": "What is a group name?",
|
||||
"5f857ba8e6": "in",
|
||||
"4df0d08cc5": "Found",
|
||||
"8db50afe1a": "Import repositories from folder",
|
||||
"5b2e6fe3c8": "Import separately",
|
||||
"cf9d382ca1": "Import",
|
||||
"220dd32d83": "Scanning...",
|
||||
"fb33359f69": "Is this a monorepo?",
|
||||
"d75170194e": "Choose this if these projects belong together. Orca will group them and let you work from the parent folder.",
|
||||
"39d51212cc": "Monorepo name",
|
||||
"e907ec8935": "What is a monorepo name?",
|
||||
"fb33359f69": "Group these repositories?",
|
||||
"d75170194e": "Choose this if these projects belong together — a monorepo, or just a set of related repos. Orca will group them and let you work from the parent folder.",
|
||||
"39d51212cc": "Group name",
|
||||
"aa0247680d": "No, import separately",
|
||||
"a0bc4d1f8e": "Yes, import as monorepo",
|
||||
"a0bc4d1f8e": "Yes, import as group",
|
||||
"8401a7a0d0": "1 repository",
|
||||
"d4f1df62ef": "{{value0}} repositories",
|
||||
"b4263a2ac4": "Found {{value0}} in {{value1}}.",
|
||||
|
|
|
|||
|
|
@ -3378,26 +3378,21 @@
|
|||
"496f68cf8c": "Escaneo de repositorios. Haga clic para detener.",
|
||||
"a32bef9516": "Dejar de escanear",
|
||||
"2f8298f3c3": "Detener escaneo",
|
||||
"c157f31a95": "Importar como grupo",
|
||||
"40199ef7b3": "Nombre del grupo",
|
||||
"787412361a": "¿Qué es el nombre de un grupo?",
|
||||
"5f857ba8e6": "en",
|
||||
"4df0d08cc5": "Encontró",
|
||||
"8db50afe1a": "Importar repositorios desde la carpeta",
|
||||
"5b2e6fe3c8": "Importar por separado",
|
||||
"cf9d382ca1": "Importar",
|
||||
"220dd32d83": "Exploración...",
|
||||
"fb33359f69": "¿Es esto un monorepo?",
|
||||
"d75170194e": "Impórtalos como grupo si son un monorepo o si pertenecen juntos. Orca los agrupará y te permitirá trabajar desde la carpeta principal.",
|
||||
"fb33359f69": "¿Agrupar estos repositorios?",
|
||||
"d75170194e": "Elige esto si estos proyectos van juntos: un monorepo o simplemente un conjunto de repositorios relacionados. Orca los agrupará y te permitirá trabajar desde la carpeta principal.",
|
||||
"39d51212cc": "Nombre del grupo",
|
||||
"aa0247680d": "No, importar por separado",
|
||||
"a0bc4d1f8e": "Importar como grupo",
|
||||
"a0bc4d1f8e": "Sí, importar como grupo",
|
||||
"8401a7a0d0": "1 repositorio",
|
||||
"d4f1df62ef": "{{value0}} repositorios",
|
||||
"b4263a2ac4": "Se encontraron {{value0}} en {{value1}}.",
|
||||
"24eda6c8b2": "Explorando... {{value0}}",
|
||||
"b20bb7c24f": "Keeps these repos together in one group. Best for related repos like microservices.",
|
||||
"e907ec8935": "What is a monorepo name?"
|
||||
"24eda6c8b2": "Explorando... {{value0}}"
|
||||
},
|
||||
"AddRepoRemoteStep": {
|
||||
"5b205b5281": "Detener escaneo",
|
||||
|
|
|
|||
|
|
@ -3359,26 +3359,21 @@
|
|||
"496f68cf8c": "repos をスキャンしています。クリックして停止します。",
|
||||
"a32bef9516": "スキャンを停止する",
|
||||
"2f8298f3c3": "スキャンの停止",
|
||||
"c157f31a95": "グループとしてインポート",
|
||||
"40199ef7b3": "グループ名",
|
||||
"787412361a": "グループ名とは何ですか?",
|
||||
"5f857ba8e6": "で",
|
||||
"4df0d08cc5": "見つかった",
|
||||
"8db50afe1a": "フォルダーから repos をインポートする",
|
||||
"5b2e6fe3c8": "個別にインポート",
|
||||
"cf9d382ca1": "インポート",
|
||||
"220dd32d83": "スキャン中...",
|
||||
"fb33359f69": "これはモノレポですか?",
|
||||
"d75170194e": "モノレポ、または一緒に扱うべきプロジェクトの場合は、グループとしてインポートします。Orca がグループ化し、親フォルダーから作業できるようにします。",
|
||||
"fb33359f69": "これらのリポジトリをグループ化しますか?",
|
||||
"d75170194e": "これらのプロジェクトをまとめたい場合(モノレポでも、関連するリポジトリの集まりでも)に選択します。Orca がグループ化し、親フォルダーから作業できるようにします。",
|
||||
"39d51212cc": "グループ名",
|
||||
"aa0247680d": "いいえ、個別にインポート",
|
||||
"a0bc4d1f8e": "グループとしてインポート",
|
||||
"a0bc4d1f8e": "はい、グループとしてインポート",
|
||||
"8401a7a0d0": "1 個の repos",
|
||||
"d4f1df62ef": "{{value0}} 個の repos",
|
||||
"b4263a2ac4": "{{value1}} で {{value0}} が見つかりました。",
|
||||
"24eda6c8b2": "スキャン中... {{value0}}",
|
||||
"b20bb7c24f": "Keeps these repos together in one group. Best for related repos like microservices.",
|
||||
"e907ec8935": "What is a monorepo name?"
|
||||
"24eda6c8b2": "スキャン中... {{value0}}"
|
||||
},
|
||||
"AddRepoRemoteStep": {
|
||||
"5b205b5281": "スキャンの停止",
|
||||
|
|
|
|||
|
|
@ -3359,26 +3359,21 @@
|
|||
"496f68cf8c": "repos를 스캔하는 중입니다. 중지하려면 클릭하세요.",
|
||||
"a32bef9516": "스캔 중지",
|
||||
"2f8298f3c3": "스캔 중지",
|
||||
"c157f31a95": "그룹으로 가져오기",
|
||||
"40199ef7b3": "그룹 이름",
|
||||
"787412361a": "그룹 이름은 무엇입니까?",
|
||||
"5f857ba8e6": "~에",
|
||||
"4df0d08cc5": "발견됨",
|
||||
"8db50afe1a": "폴더에서 repos 가져오기",
|
||||
"5b2e6fe3c8": "별도로 가져오기",
|
||||
"cf9d382ca1": "가져오기",
|
||||
"220dd32d83": "스캔 중...",
|
||||
"fb33359f69": "이 폴더가 모노 repo 인가요?",
|
||||
"d75170194e": "모노레포이거나 함께 속한 프로젝트라면 그룹으로 가져오세요. Orca가 그룹으로 묶고 상위 폴더에서 작업할 수 있게 합니다.",
|
||||
"fb33359f69": "이 저장소들을 그룹으로 묶을까요?",
|
||||
"d75170194e": "이 프로젝트들이 함께 속한 경우(모노레포이거나 단순히 관련된 저장소 모음) 이 옵션을 선택하세요. Orca가 그룹으로 묶고 상위 폴더에서 작업할 수 있게 합니다.",
|
||||
"39d51212cc": "그룹 이름",
|
||||
"aa0247680d": "아니요, 별도로 가져오기",
|
||||
"a0bc4d1f8e": "그룹으로 가져오기",
|
||||
"a0bc4d1f8e": "예, 그룹으로 가져오기",
|
||||
"8401a7a0d0": "repos 1개",
|
||||
"d4f1df62ef": "repos {{value0}}개",
|
||||
"b4263a2ac4": "{{value1}}에서 {{value0}}을(를) 찾았습니다.",
|
||||
"24eda6c8b2": "스캔 중... {{value0}}",
|
||||
"b20bb7c24f": "이 리포지토리들을 하나의 그룹으로 묶어 둡니다. 마이크로서비스처럼 서로 관련된 리포지토리에 적합합니다.",
|
||||
"e907ec8935": "모노 repo 이름이란?"
|
||||
"24eda6c8b2": "스캔 중... {{value0}}"
|
||||
},
|
||||
"AddRepoRemoteStep": {
|
||||
"5b205b5281": "스캔 중지",
|
||||
|
|
|
|||
|
|
@ -3358,26 +3358,21 @@
|
|||
"496f68cf8c": "扫描存储库。单击停止。",
|
||||
"a32bef9516": "停止扫描",
|
||||
"2f8298f3c3": "停止扫描",
|
||||
"c157f31a95": "作为组导入",
|
||||
"40199ef7b3": "团体名称",
|
||||
"787412361a": "什么是群组名称?",
|
||||
"5f857ba8e6": "在",
|
||||
"4df0d08cc5": "成立",
|
||||
"8db50afe1a": "从文件夹导入存储库",
|
||||
"5b2e6fe3c8": "单独导入",
|
||||
"cf9d382ca1": "导入",
|
||||
"220dd32d83": "扫描...",
|
||||
"fb33359f69": "这是 Monorepo 吗?",
|
||||
"d75170194e": "如果它们是 Monorepo,或本来就应该放在一起,请将它们作为组导入。Orca 会将它们分组,并让你从父文件夹开始工作。",
|
||||
"fb33359f69": "将这些仓库分组吗?",
|
||||
"d75170194e": "如果这些项目应放在一起(可以是 Monorepo,也可以只是一组相关仓库),请选择此项。Orca 会将它们分组,并让你从父文件夹开始工作。",
|
||||
"39d51212cc": "组名称",
|
||||
"aa0247680d": "否,单独导入",
|
||||
"a0bc4d1f8e": "作为组导入",
|
||||
"a0bc4d1f8e": "是,作为组导入",
|
||||
"8401a7a0d0": "1 个仓库",
|
||||
"d4f1df62ef": "{{value0}} 个仓库",
|
||||
"b4263a2ac4": "在 {{value1}} 中找到 {{value0}}。",
|
||||
"24eda6c8b2": "正在扫描... {{value0}}",
|
||||
"b20bb7c24f": "Keeps these repos together in one group. Best for related repos like microservices.",
|
||||
"e907ec8935": "What is a monorepo name?"
|
||||
"24eda6c8b2": "正在扫描... {{value0}}"
|
||||
},
|
||||
"AddRepoRemoteStep": {
|
||||
"5b205b5281": "停止扫描",
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import { test, expect } from './helpers/orca-app'
|
|||
import { waitForSessionReady } from './helpers/store'
|
||||
|
||||
const tempRoots: string[] = []
|
||||
const IMPORT_AS_MONOREPO_BUTTON_NAME = 'Yes, import as monorepo'
|
||||
const IMPORT_AS_GROUP_BUTTON_NAME = 'Yes, import as group'
|
||||
|
||||
function initializeGitRepo(repoPath: string): void {
|
||||
mkdirSync(repoPath, { recursive: true })
|
||||
|
|
@ -133,11 +133,11 @@ async function installCancellableNestedScanMock(
|
|||
}, scan)
|
||||
}
|
||||
|
||||
function getImportAsMonorepoButton(importDialog: Locator): Locator {
|
||||
function getImportAsGroupButton(importDialog: Locator): Locator {
|
||||
// Why: this test should fail on import-dialog copy drift instead of falling
|
||||
// back to a retired accessible label.
|
||||
return importDialog.getByRole('button', {
|
||||
name: IMPORT_AS_MONOREPO_BUTTON_NAME,
|
||||
name: IMPORT_AS_GROUP_BUTTON_NAME,
|
||||
exact: true
|
||||
})
|
||||
}
|
||||
|
|
@ -177,7 +177,7 @@ test('prioritizes shallow sibling repositories in a bounded nested scan', async
|
|||
.filter({ hasText: 'z-web-client' })
|
||||
.locator('input[type="checkbox"]')
|
||||
.check()
|
||||
await getImportAsMonorepoButton(importDialog).click()
|
||||
await getImportAsGroupButton(importDialog).click()
|
||||
|
||||
await expect
|
||||
.poll(
|
||||
|
|
@ -257,13 +257,13 @@ test('can stop a nested repo scan and import repositories found so far', async (
|
|||
name: /Import repositories from folder/i
|
||||
})
|
||||
await expect(importDialog.getByText(/Scanning\.\.\.\s*Found 1 repository in/)).toBeVisible()
|
||||
await expect(getImportAsMonorepoButton(importDialog)).toBeDisabled()
|
||||
await expect(getImportAsGroupButton(importDialog)).toBeDisabled()
|
||||
await importDialog.getByRole('button', { name: /Stop scan/i }).click()
|
||||
await expect(importDialog.getByText('Scan stopped early.')).toBeVisible()
|
||||
await expect(importDialog.getByText(/Found 1 repository in/)).toBeVisible()
|
||||
await expect(getImportAsMonorepoButton(importDialog)).toBeEnabled()
|
||||
await expect(getImportAsGroupButton(importDialog)).toBeEnabled()
|
||||
|
||||
await getImportAsMonorepoButton(importDialog).click()
|
||||
await getImportAsGroupButton(importDialog).click()
|
||||
|
||||
await expect
|
||||
.poll(
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import { test, expect } from './helpers/orca-app'
|
|||
import { waitForSessionReady } from './helpers/store'
|
||||
import type { ElectronApplication, Locator } from '@stablyai/playwright-test'
|
||||
|
||||
const IMPORT_AS_MONOREPO_BUTTON_NAME = 'Yes, import as monorepo'
|
||||
const IMPORT_AS_GROUP_BUTTON_NAME = 'Yes, import as group'
|
||||
|
||||
const tempRoots: string[] = []
|
||||
|
||||
|
|
@ -95,11 +95,11 @@ async function chooseFolderInNativeDialog(
|
|||
}, folderPath)
|
||||
}
|
||||
|
||||
function getImportAsMonorepoButton(importDialog: Locator): Locator {
|
||||
function getImportAsGroupButton(importDialog: Locator): Locator {
|
||||
// Why: the current accessible action is intentional; accepting retired
|
||||
// labels would hide deterministic dialog copy drift.
|
||||
return importDialog.getByRole('button', {
|
||||
name: IMPORT_AS_MONOREPO_BUTTON_NAME,
|
||||
name: IMPORT_AS_GROUP_BUTTON_NAME,
|
||||
exact: true
|
||||
})
|
||||
}
|
||||
|
|
@ -129,8 +129,8 @@ test.describe('Folder setup', () => {
|
|||
).toBeVisible()
|
||||
await expect(importDialog.getByText('api-service', { exact: true }).first()).toBeVisible()
|
||||
await expect(importDialog.getByText('web-client', { exact: true }).first()).toBeVisible()
|
||||
await expect(getImportAsMonorepoButton(importDialog)).toBeEnabled()
|
||||
await getImportAsMonorepoButton(importDialog).click()
|
||||
await expect(getImportAsGroupButton(importDialog)).toBeEnabled()
|
||||
await getImportAsGroupButton(importDialog).click()
|
||||
|
||||
await expect
|
||||
.poll(
|
||||
|
|
@ -217,7 +217,7 @@ test.describe('Folder setup', () => {
|
|||
.locator('input[type="checkbox"]')
|
||||
.check()
|
||||
}
|
||||
await getImportAsMonorepoButton(importDialog).click()
|
||||
await getImportAsGroupButton(importDialog).click()
|
||||
|
||||
await expect
|
||||
.poll(
|
||||
|
|
|
|||
Loading…
Reference in New Issue