diff --git a/src/views/projects/Source.svelte b/src/views/projects/Source.svelte index ffb0911f4..828ec3a1e 100644 --- a/src/views/projects/Source.svelte +++ b/src/views/projects/Source.svelte @@ -6,14 +6,12 @@ import { HttpdClient } from "@httpd-client"; import Button from "@app/components/Button.svelte"; - import File from "@app/components/File.svelte"; import Header from "./Source/Header.svelte"; import Layout from "./Layout.svelte"; import Placeholder from "@app/components/Placeholder.svelte"; import BlobComponent from "./Source/Blob.svelte"; import TreeComponent from "./Source/Tree.svelte"; - import FilePath from "@app/components/FilePath.svelte"; export let baseUrl: BaseUrl; export let rawPath: (commit?: string) => string; @@ -98,6 +96,11 @@ min-width: var(--content-min-width); width: 100%; } + .placeholder { + padding: 4rem 0; + border: 1px solid var(--color-border-hint); + border-radius: var(--border-radius-small); + } .source-tree { overflow-x: hidden; @@ -209,20 +212,19 @@ blob={blobResult.blob} highlighted={blobResult.highlighted} rawPath={rawPath(tree.lastCommit.id)} /> + {:else if path === "/"} +
+ +
{:else} - - -
- -
-
+
+ +
{/if} {:else} -
- +
+
{/if}
diff --git a/tests/visual/project.spec.ts b/tests/visual/project.spec.ts index 2ab80139f..c329326c5 100644 --- a/tests/visual/project.spec.ts +++ b/tests/visual/project.spec.ts @@ -4,6 +4,7 @@ import { cobUrl, sourceBrowsingUrl, aliceRemote, + markdownUrl, } from "@tests/support/fixtures.js"; test("source page", async ({ page }) => { @@ -84,6 +85,13 @@ test("project not found", async ({ page }) => { await expect(page).toHaveScreenshot(); }); +test("readme not found", async ({ page }) => { + await page.goto(`${markdownUrl}/tree`, { + waitUntil: "networkidle", + }); + await expect(page).toHaveScreenshot(); +}); + test("file not found", async ({ page }) => { await page.goto(`${sourceBrowsingUrl}/tree/this.file.does.not.exist`, { waitUntil: "networkidle",