fix: polish workspace files and editor shell

This commit is contained in:
2026-06-19 23:37:10 +08:00
parent a6412fa070
commit 5c979174f1
23 changed files with 497 additions and 249 deletions
+23
View File
@@ -27,6 +27,19 @@ test.describe('G: Files Plugin', () => {
await expect(sidebarItem).toHaveCount(0);
});
test('workspace Files view is scoped to selected workspace folder', async ({ page }) => {
await page.locator('.wt-label').filter({ hasText: 'Alpha Case' }).click();
await expect(page.locator('.workspace-host')).toBeVisible({ timeout: 10000 });
await expect(page.locator('.files-item-name').filter({ hasText: 'alpha-only.txt' })).toBeVisible({ timeout: 10000 });
await expect(page.locator('.files-item-name').filter({ hasText: 'beta-only.txt' })).toHaveCount(0);
await page.locator('.wt-label').filter({ hasText: 'Beta Case' }).click();
await expect(page.locator('.files-item-name').filter({ hasText: 'beta-only.txt' })).toBeVisible({ timeout: 10000 });
await expect(page.locator('.files-item-name').filter({ hasText: 'alpha-only.txt' })).toHaveCount(0);
});
test('open .txt via workbench from files context shows default-editor', async ({ page }) => {
await page.evaluate(async () => {
const [result, err] = await window.go.api.App.OpenWorkbenchResource('verstak.files', {
@@ -42,6 +55,11 @@ test.describe('G: Files Plugin', () => {
const editor = page.locator('[data-editor-mode="text"]');
await expect(editor).toBeVisible({ timeout: 10000 });
await expect(editor).toHaveAttribute('data-resource-path', 'Docs/todo.txt');
const textarea = page.locator('.de-textarea');
await expect(textarea).toBeVisible({ timeout: 10000 });
const textareaBox = await textarea.boundingBox();
expect(textareaBox.height).toBeGreaterThan(300);
});
test('open .md via workbench from files context shows generic-markdown', async ({ page }) => {
@@ -59,6 +77,11 @@ test.describe('G: Files Plugin', () => {
const workbench = page.locator('.workbench-host');
await expect(workbench).toBeVisible({ timeout: 10000 });
await expect(workbench.locator('.workbench-title')).toHaveText('Docs/readme.md');
const preview = page.locator('.de-preview');
await expect(preview).toBeVisible({ timeout: 10000 });
const previewBox = await preview.boundingBox();
expect(previewBox.height).toBeGreaterThan(300);
});
test('open notes markdown via workbench from files context shows notes-markdown', async ({ page }) => {
@@ -81,4 +81,15 @@ test.describe('E: Plugin Manager layout', () => {
await expect(selected).toHaveCount(1);
await expect(selected).toHaveText('Beta Case');
});
test('shell icons render through bundled Lucide SVG components', async ({ page }) => {
const logo = page.locator('.sidebar-logo');
await expect(logo).toBeVisible();
await expect(logo).toHaveClass(/lucide/);
await page.locator('.wt-label').filter({ hasText: 'Alpha Case' }).click();
const workspaceIcon = page.locator('.wt-node-icon').first();
await expect(workspaceIcon).toBeVisible();
await expect(workspaceIcon).toHaveClass(/lucide/);
});
});