From f972a41e453fb688cc020a3eb018651d7fa9262c Mon Sep 17 00:00:00 2001 From: nitrix Date: Thu, 12 Mar 2026 23:06:03 +0100 Subject: [PATCH] Extract BackLink component into App layout Move back navigation (chevron + "fete" brand) from per-view definitions into a shared BackLink component rendered in App.vue. Shown on all pages except home. Hero overlay gets pointer-events: none so the link stays clickable on the event detail page. Co-Authored-By: Claude Opus 4.6 --- frontend/e2e/watch-event.spec.ts | 10 ++++---- frontend/src/App.vue | 19 ++++++++++++++- frontend/src/components/BackLink.vue | 28 ++++++++++++++++++++++ frontend/src/views/EventCreateView.vue | 22 +++-------------- frontend/src/views/EventDetailView.vue | 33 ++------------------------ 5 files changed, 56 insertions(+), 56 deletions(-) create mode 100644 frontend/src/components/BackLink.vue diff --git a/frontend/e2e/watch-event.spec.ts b/frontend/e2e/watch-event.spec.ts index d919967..a976e74 100644 --- a/frontend/e2e/watch-event.spec.ts +++ b/frontend/e2e/watch-event.spec.ts @@ -65,7 +65,7 @@ test.describe('US1: Watch event from detail page', () => { await expect(bookmark).toHaveAttribute('aria-label', 'Stop watching this event') // Navigate to event list via back link - await page.locator('.detail__back').click() + await page.getByLabel('Back to home').click() // Event appears with "Watching" label await expect(page.getByText('Summer BBQ')).toBeVisible() @@ -89,7 +89,7 @@ test.describe('US2: Un-watch event from detail page', () => { await expect(bookmark).toHaveAttribute('aria-label', 'Watch this event') // Navigate to event list via back link (avoid page.goto re-running addInitScript) - await page.locator('.detail__back').click() + await page.getByLabel('Back to home').click() // Event is gone await expect(page.getByText('Summer BBQ')).not.toBeVisible() @@ -109,7 +109,7 @@ test.describe('US3: Bookmark reflects attending status', () => { await expect(bookmark).not.toBeVisible() // Navigate to list via back link - await page.locator('.detail__back').click() + await page.getByLabel('Back to home').click() await expect(page.getByText('Attending')).toBeVisible() await expect(page.getByText('Watching')).not.toBeVisible() }) @@ -137,7 +137,7 @@ test.describe('US4: RSVP cancellation preserves watch status', () => { await expect(bookmark).toHaveAttribute('aria-label', 'Stop watching this event') // Navigate to list via back link - await page.locator('.detail__back').click() + await page.getByLabel('Back to home').click() await expect(page.getByText('Watching')).toBeVisible() await expect(page.getByText('Attending')).not.toBeVisible() }) @@ -211,7 +211,7 @@ test.describe('US7: Watcher upgrades to attendee', () => { await expect(bookmark).not.toBeVisible() // Navigate to list via back link - await page.locator('.detail__back').click() + await page.getByLabel('Back to home').click() await expect(page.getByText('Attending')).toBeVisible() await expect(page.getByText('Watching')).not.toBeVisible() }) diff --git a/frontend/src/App.vue b/frontend/src/App.vue index c80ecb7..9d0fb1a 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -1,9 +1,26 @@ + + diff --git a/frontend/src/components/BackLink.vue b/frontend/src/components/BackLink.vue new file mode 100644 index 0000000..9c10e26 --- /dev/null +++ b/frontend/src/components/BackLink.vue @@ -0,0 +1,28 @@ + + + + + diff --git a/frontend/src/views/EventCreateView.vue b/frontend/src/views/EventCreateView.vue index fcbf49a..66ea6a1 100644 --- a/frontend/src/views/EventCreateView.vue +++ b/frontend/src/views/EventCreateView.vue @@ -1,9 +1,6 @@