Refine SEO, uploads, and deploy handling

This commit is contained in:
2026-05-02 10:48:08 +02:00
parent b6be6ed2ac
commit a9dfa6ea11
97 changed files with 373 additions and 327 deletions

View File

@@ -661,8 +661,8 @@ it('public collection search exposes noindex seo props on filtered pages', funct
->component('Collection/CollectionFeaturedIndex')
->where('seo.robots', 'noindex,follow')
->where('seo.canonical', $url)
->where('seo.title', 'Search Collections — Skinbase Nova')
->where('seo.description', 'Search results for "SEO Search Target" across public Skinbase Nova collections.'));
->where('seo.title', 'Search Collections — Skinbase')
->where('seo.description', 'Search results for "SEO Search Target" across public Skinbase collections.'));
});
it('saved collections support private saved notes', function () {

View File

@@ -16,7 +16,7 @@ beforeEach(function (): void {
function homepageAnnouncement(array $overrides = []): HomepageAnnouncement
{
return HomepageAnnouncement::query()->create(array_merge([
'title' => 'Skinbase Nova is live.',
'title' => 'Skinbase is live.',
'subtitle' => 'A new chapter for the Skinbase creative community.',
'badge_text' => 'Launch Day · 1 May 2026',
'content_html' => '<p><strong>Today, 1 May 2026, Skinbase begins a new chapter.</strong></p>',

View File

@@ -63,8 +63,8 @@ it('renders published news across public discovery routes', function (): void {
'slug' => 'release',
]);
$article = publishedNewsArticle($author, $category, [
'title' => 'Skinbase Nova Newsroom',
'slug' => 'skinbase-nova-newsroom',
'title' => 'Skinbase Newsroom',
'slug' => 'skinbase-newsroom',
]);
$article->tags()->sync([$tag->id]);
@@ -80,29 +80,29 @@ it('renders published news across public discovery routes', function (): void {
$this->get(route('news.index'))
->assertOk()
->assertSee('Skinbase Nova Newsroom')
->assertSee('Skinbase Newsroom')
->assertDontSee('Hidden Draft');
$this->get(route('news.show', ['slug' => $article->slug]))
->assertOk()
->assertSee('Skinbase Nova Newsroom')
->assertSee('Skinbase Newsroom')
->assertSee('News Author');
$this->get(route('news.category', ['slug' => $category->slug]))
->assertOk()
->assertSee('Skinbase Nova Newsroom');
->assertSee('Skinbase Newsroom');
$this->get(route('news.tag', ['slug' => $tag->slug]))
->assertOk()
->assertSee('Skinbase Nova Newsroom');
->assertSee('Skinbase Newsroom');
$this->get(route('news.archive', ['year' => $article->published_at->year, 'month' => $article->published_at->month]))
->assertOk()
->assertSee('Skinbase Nova Newsroom');
->assertSee('Skinbase Newsroom');
$this->get(route('news.author', ['username' => $author->username]))
->assertOk()
->assertSee('Skinbase Nova Newsroom');
->assertSee('Skinbase Newsroom');
});
it('renders a public news article when anonymous sessions are skipped', function (): void {

View File

@@ -983,8 +983,8 @@ describe('AiBiographyGenerator v1.1 — retry', function () {
]);
$requests = [];
$firstAttempt = 'szerencsefia has been a member of Skinbase Nova since 2007. They have uploaded one public artwork categorized under GTK+.';
$retryAttempt = 'szerencsefia has been part of Skinbase Nova since 2007. They have one public artwork on the platform, and that published work is categorized under GTK+, giving a modest but concrete snapshot of their public activity.';
$firstAttempt = 'szerencsefia has been a member of Skinbase since 2007. They have uploaded one public artwork categorized under GTK+.';
$retryAttempt = 'szerencsefia has been part of Skinbase since 2007. They have one public artwork on the platform, and that published work is categorized under GTK+, giving a modest but concrete snapshot of their public activity.';
Http::fake(function ($request) use (&$requests, $firstAttempt, $retryAttempt) {
$requests[] = $request->data();
@@ -1424,7 +1424,7 @@ describe('GenerateAiBiographyCommand v1.1 — missing batch', function () {
expect($output)->toContain('Prompt preview');
expect($output)->toContain('Provider : vision_gateway');
expect($output)->toContain('System prompt:');
expect($output)->toContain('You are a concise writing assistant for Skinbase Nova');
expect($output)->toContain('You are a concise writing assistant for Skinbase');
expect($output)->toContain('User prompt:');
expect($output)->toContain('Write a creator biography in 70 to 130 words');
});

View File

@@ -698,7 +698,7 @@ it('stores a world draft through the studio flow', function (): void {
'badge_label' => 'Editorial pick',
'badge_description' => 'Featured by the Nova editorial team.',
'badge_url' => 'https://skinbase.test/badges/retro',
'seo_title' => 'Retro Month 2026 - Skinbase Nova',
'seo_title' => 'Retro Month 2026 - Skinbase',
'seo_description' => 'Retro Month seasonal campaign',
'published_at' => '2026-03-20T10:00',
'related_tags_json' => ['retro', 'demoscene'],

View File

@@ -0,0 +1,58 @@
<?php
declare(strict_types=1);
use Illuminate\Foundation\Testing\RefreshDatabase;
use App\Models\User;
uses(RefreshDatabase::class);
it('renders seo tags on public blade pages', function (): void {
$response = $this->get('/');
$response->assertOk();
$html = $response->getContent();
$this->assertNotFalse($html);
$this->assertStringContainsString('<title>', $html);
$this->assertStringContainsString('meta name="description"', $html);
$this->assertStringContainsString('meta property="og:title"', $html);
$this->assertStringContainsString('meta name="twitter:card"', $html);
});
it('renders seo tags on auth blade pages', function (): void {
$response = $this->get('/login');
$response->assertOk();
$html = $response->getContent();
$this->assertNotFalse($html);
$this->assertStringContainsString('<title>', $html);
$this->assertStringContainsString('meta name="description"', $html);
$this->assertStringContainsString('meta property="og:title"', $html);
$this->assertStringContainsString('meta name="robots" content="noindex,nofollow"', $html);
});
it('renders seo tags on upload and studio pages', function (): void {
$user = User::factory()->create();
$uploadResponse = $this->actingAs($user)->get('/upload');
$uploadResponse->assertOk();
$uploadHtml = $uploadResponse->getContent();
$this->assertNotFalse($uploadHtml);
$this->assertStringContainsString('<title>Upload Artwork — Creator Studio</title>', $uploadHtml);
$this->assertStringContainsString('meta name="description"', $uploadHtml);
$this->assertStringContainsString('meta property="og:title"', $uploadHtml);
$this->assertStringContainsString('meta name="robots" content="noindex, nofollow"', $uploadHtml);
$studioResponse = $this->actingAs($user)->get('/studio/artworks');
$studioResponse->assertOk();
$studioHtml = $studioResponse->getContent();
$this->assertNotFalse($studioHtml);
$this->assertStringContainsString('Creator Studio', $studioHtml);
$this->assertStringContainsString('meta name="description"', $studioHtml);
$this->assertStringContainsString('meta property="og:title"', $studioHtml);
$this->assertStringContainsString('meta name="robots" content="noindex, nofollow"', $studioHtml);
});

View File

@@ -21,14 +21,15 @@ it('persists a normalized embedding and upserts the artwork to the vector gatewa
config()->set('vision.vector_gateway.enabled', true);
config()->set('vision.vector_gateway.base_url', 'https://vision.local');
config()->set('vision.vector_gateway.api_key', 'test-key');
config()->set('vision.vector_gateway.upsert_endpoint', '/vectors/upsert');
config()->set('vision.vector_gateway.upsert_file_endpoint', '/vectors/upsert/file');
config()->set('cdn.files_url', 'https://files.local');
Http::fake([
'https://clip.local/embed' => Http::response([
'embedding' => [3.0, 4.0],
], 200),
'https://vision.local/vectors/upsert' => Http::response([
'https://files.local/*' => Http::response('fake-image-bytes', 200),
'https://vision.local/vectors/upsert/file' => Http::response([
'status' => 'ok',
], 200),
]);
@@ -62,11 +63,7 @@ it('persists a normalized embedding and upserts the artwork to the vector gatewa
$artwork->tags()->attach($tag->id, ['source' => 'ai', 'confidence' => 0.91]);
$job = new GenerateArtworkEmbeddingJob($artwork->id, 'aabbccddeeff1122');
$job->handle(
app(\App\Services\Vision\ArtworkEmbeddingClient::class),
app(\App\Services\Vision\ArtworkVisionImageUrl::class),
app(\App\Services\Vision\ArtworkVectorIndexService::class),
);
app()->call([$job, 'handle']);
$embedding = ArtworkEmbedding::query()->where('artwork_id', $artwork->id)->first();
$artwork->refresh();
@@ -81,26 +78,11 @@ it('persists a normalized embedding and upserts the artwork to the vector gatewa
expect(round((float) $vector[0], 4))->toBe(0.6)
->and(round((float) $vector[1], 4))->toBe(0.8);
Http::assertSent(function (\Illuminate\Http\Client\Request $request) use ($artwork): bool {
if ($request->url() !== 'https://vision.local/vectors/upsert') {
return false;
}
$data = $request->data();
return ($data['id'] ?? null) === (string) $artwork->id
&& ($data['url'] ?? null) === 'https://files.local/artworks/md/aa/bb/aabbccddeeff1122.webp'
&& ($data['metadata']['content_type'] ?? null) === 'Wallpapers'
&& ($data['metadata']['category'] ?? null) === 'Abstract'
&& ($data['metadata']['tags'] ?? null) === ['neon']
&& ($data['metadata']['user_id'] ?? null) === (string) $artwork->user_id
&& ($data['metadata']['is_public'] ?? null) === true
&& ($data['metadata']['is_deleted'] ?? null) === false
&& ($data['metadata']['is_nsfw'] ?? null) === false
&& isset($data['metadata']['category_id'])
&& isset($data['metadata']['content_type_id'])
&& array_key_exists('status', $data['metadata']);
Http::assertSent(function (\Illuminate\Http\Client\Request $request): bool {
return str_contains($request->url(), 'vision.local/vectors/upsert');
});
Http::assertSentCount(3);
});
it('keeps the local embedding when vector upsert fails', function () {
@@ -111,14 +93,15 @@ it('keeps the local embedding when vector upsert fails', function () {
config()->set('vision.vector_gateway.enabled', true);
config()->set('vision.vector_gateway.base_url', 'https://vision.local');
config()->set('vision.vector_gateway.api_key', 'test-key');
config()->set('vision.vector_gateway.upsert_endpoint', '/vectors/upsert');
config()->set('vision.vector_gateway.upsert_file_endpoint', '/vectors/upsert/file');
config()->set('cdn.files_url', 'https://files.local');
Http::fake([
'https://clip.local/embed' => Http::response([
'embedding' => [1.0, 2.0, 2.0],
], 200),
'https://vision.local/vectors/upsert' => Http::response([
'https://files.local/*' => Http::response('fake-image-bytes', 200),
'https://vision.local/vectors/upsert/file' => Http::response([
'message' => 'gateway error',
], 500),
]);
@@ -132,16 +115,12 @@ it('keeps the local embedding when vector upsert fails', function () {
]);
$job = new GenerateArtworkEmbeddingJob($artwork->id, '1122334455667788');
$job->handle(
app(\App\Services\Vision\ArtworkEmbeddingClient::class),
app(\App\Services\Vision\ArtworkVisionImageUrl::class),
app(\App\Services\Vision\ArtworkVectorIndexService::class),
);
app()->call([$job, 'handle']);
$artwork->refresh();
expect(ArtworkEmbedding::query()->where('artwork_id', $artwork->id)->exists())->toBeTrue()
->and($artwork->last_vector_indexed_at)->toBeNull();
Http::assertSentCount(2);
Http::assertSentCount(3);
});

View File

@@ -5,33 +5,17 @@ declare(strict_types=1);
use App\Models\Artwork;
use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Http;
use function Pest\Laravel\actingAs;
use function Pest\Laravel\postJson;
uses(RefreshDatabase::class);
it('returns normalized synchronous vision tag suggestions for the artwork owner', function (): void {
it('returns a disabled payload for the artwork owner while synchronous vision suggestions are off', function (): void {
config()->set('vision.enabled', true);
config()->set('vision.gateway.base_url', 'https://vision.local');
config()->set('cdn.files_url', 'https://files.local');
$user = User::factory()->create();
$artwork = Artwork::factory()->create([
'user_id' => $user->id,
'hash' => 'aabbcc112233',
]);
Http::fake([
'https://vision.local/analyze/all' => Http::response([
'clip' => [
['tag' => 'Neon City', 'confidence' => 0.91],
['tag' => 'Night Sky', 'confidence' => 0.77],
],
'yolo' => [
['label' => 'car', 'confidence' => 0.65],
],
], 200),
]);
actingAs($user);
@@ -39,24 +23,18 @@ it('returns normalized synchronous vision tag suggestions for the artwork owner'
$response = postJson('/api/uploads/' . $artwork->id . '/vision-suggest?limit=10');
$response->assertOk()
->assertJsonPath('vision_enabled', true)
->assertJsonPath('source', 'gateway_sync')
->assertJsonPath('tags.0.slug', 'neon-city')
->assertJsonPath('tags.0.source', 'clip')
->assertJsonPath('tags.1.slug', 'night-sky')
->assertJsonPath('tags.2.slug', 'car');
->assertJsonPath('vision_enabled', false)
->assertJsonPath('reason', 'disabled')
->assertJsonPath('tags', []);
});
it('returns 404 when a non-owner requests upload vision suggestions', function (): void {
config()->set('vision.enabled', true);
config()->set('vision.gateway.base_url', 'https://vision.local');
config()->set('cdn.files_url', 'https://files.local');
$owner = User::factory()->create();
$viewer = User::factory()->create();
$artwork = Artwork::factory()->create([
'user_id' => $owner->id,
'hash' => 'aabbcc112233',
]);
actingAs($viewer);

View File

@@ -88,7 +88,7 @@ afterEach(function (): void {
function announcementPayload(array $overrides = []): array
{
return array_merge([
'title' => 'Skinbase Nova is live.',
'title' => 'Skinbase is live.',
'subtitle' => 'A new chapter for the Skinbase creative community.',
'badge_text' => 'Launch Day · 1 May 2026',
'content_html' => '<p><strong>Today, 1 May 2026, Skinbase begins a new chapter.</strong></p>',
@@ -196,7 +196,7 @@ it('homepage payload includes the announcement prop', function (): void {
'announcement' => [
'id' => 42,
'dismiss_version' => 1,
'title' => 'Skinbase Nova is live.',
'title' => 'Skinbase is live.',
'subtitle' => 'A new chapter.',
'badge_text' => 'Launch',
'content_html' => '<p>Hello</p>',