fix(#76): keep embedded Preview from stacking freshness notices

Weekend shell already discloses context availability; a second Preview banner
from shared championship headers produced conflicting Partial/Stale vocabulary.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-12 20:32:44 -04:00
parent 5534ebf82c
commit eabf87a2b8
4 changed files with 80 additions and 3 deletions

View File

@@ -455,7 +455,8 @@ export function RacePreviewPage({
data-meeting-key={previewMeeting.meeting_key}
data-embedded={embedded ? 'true' : undefined}
>
{dataNotice && (
{/* Weekend shell owns availability disclosure when Preview is embedded. */}
{!embedded && dataNotice && (
<DataNotice
availability={dataNotice}
message={noticeMessage(dataNotice)}

View File

@@ -298,6 +298,8 @@ describe('RacePreviewPage', () => {
expect(mockFetchMeetings).not.toHaveBeenCalledWith(2099, expect.anything(), expect.anything())
expect(mockFetchSessions).toHaveBeenCalledWith(100, 'auto', expect.anything())
expect(screen.queryByTestId('preview-header')).not.toBeInTheDocument()
// Weekend shell owns availability disclosure — no stacked Preview notice.
expect(screen.queryByTestId('preview-data-notice')).not.toBeInTheDocument()
})
it('sanitizes raw HTTP errors and offers a guarded keyboard Retry', async () => {

View File

@@ -404,6 +404,9 @@ describe('WeekendPage canonical contract rendering', () => {
await waitFor(() => expect(screen.getByTestId('preview-page')).toBeInTheDocument())
expect(screen.getByTestId('preview-page')).toHaveAttribute('data-meeting-key', '2')
expect(screen.getByTestId('preview-page')).toHaveAttribute('data-embedded', 'true')
// Single shell notice — Preview must not stack a second freshness banner.
expect(screen.getByTestId('weekend-data-notice')).toHaveTextContent(/Partial/i)
expect(screen.queryByTestId('preview-data-notice')).not.toBeInTheDocument()
// Canonical identity was passed — Preview must not fan out to seasons /
// current-season meetings selection. Prior-year lookup for "Last year here"
// remains an intentional supplement.