mirror of
https://github.com/supabase/supabase.git
synced 2026-09-06 09:59:03 +08:00
Informational banner for the `logs.all` Management API removal on Sept 23, in the Logs and Observability sections. * Untargeted. Whether a project calls the endpoint is behaviour that no API response carries, so precise targeting needs a mgmt-api change (we aimed for speed and less complexity here). Copy is informational rather than "action required" since most viewers won't be affected. * Uses `BannerStack` (bottom-right card) rather than the top header banner, at priority 4 so it renders as the front card. Note this pushes `database-connections-banner` (p2) and `index-advisor-banner` (p3) into peek slivers on Observability. * Short Notice card: title, one line of copy with `logs.all` inline, and a Learn more link to the changelog. * Waits for localStorage before showing, and BannerStack ignores stale dismiss timers when a banner is revived (avoids flash-then-disappear on refresh). * Dismiss is browser-level; self-expires Sept 24 via `LogsAllDeprecationExpiry`. * Cleanup tracked in GROWTH-1104. * Tested in staging. Check in: - /project/_/logs (unified logs) - /project/_/logs/explorer - /project/_/observability | After | | --- | | <img width="626" height="528" alt="CleanShot 2026-08-20 at 12 29 49@2x" src="https://github.com/user-attachments/assets/2044966d-bc83-4f88-ac75-1b8ff80be08d" /> | <img width="622" height="440" alt="CleanShot 2026-08-20 at 12 28 33@2x" src="https://github.com/user-attachments/assets/1dc768cd-837c-4a5a-a3fa-7b6986fe5876" /> | Resolves GROWTH-1093. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## New Features * Added a dismissible notice about the `logs.all` endpoint retirement on September 23, 2026. * The notice appears on relevant Logs and Observability pages with streamlined migration guidance. * Clarified that dashboard logs remain unchanged. * Dismissal preferences are saved, and notices remain visible or are removed reliably during navigation. ## Telemetry * Added tracking for notice display and dismissal interactions. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Danny White <3104761+dnywh@users.noreply.github.com> Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Danny White <dnywh@users.noreply.github.com>
79 lines
1.9 KiB
TypeScript
79 lines
1.9 KiB
TypeScript
import { act, renderHook } from '@testing-library/react'
|
|
import { type PropsWithChildren } from 'react'
|
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
|
|
|
import { BANNER_ID, BannerStackProvider, useBannerStack } from './BannerStackProvider'
|
|
|
|
const wrapper = ({ children }: PropsWithChildren) => (
|
|
<BannerStackProvider>{children}</BannerStackProvider>
|
|
)
|
|
|
|
describe('BannerStackProvider', () => {
|
|
beforeEach(() => {
|
|
vi.useFakeTimers()
|
|
})
|
|
|
|
afterEach(() => {
|
|
vi.useRealTimers()
|
|
})
|
|
|
|
it('keeps a banner that is revived before the dismiss animation finishes', () => {
|
|
const { result } = renderHook(() => useBannerStack(), { wrapper })
|
|
|
|
act(() => {
|
|
result.current.addBanner({
|
|
id: BANNER_ID.LOGS_ALL_DEPRECATION,
|
|
isDismissed: false,
|
|
content: null,
|
|
})
|
|
})
|
|
|
|
act(() => {
|
|
result.current.dismissBanner(BANNER_ID.LOGS_ALL_DEPRECATION)
|
|
})
|
|
|
|
act(() => {
|
|
result.current.addBanner({
|
|
id: BANNER_ID.LOGS_ALL_DEPRECATION,
|
|
isDismissed: false,
|
|
content: null,
|
|
})
|
|
})
|
|
|
|
act(() => {
|
|
vi.advanceTimersByTime(300)
|
|
})
|
|
|
|
expect(result.current.banners).toEqual([
|
|
expect.objectContaining({
|
|
id: BANNER_ID.LOGS_ALL_DEPRECATION,
|
|
isDismissed: false,
|
|
}),
|
|
])
|
|
})
|
|
|
|
it('removes a banner after the dismiss animation when it stays dismissed', () => {
|
|
const { result } = renderHook(() => useBannerStack(), { wrapper })
|
|
|
|
act(() => {
|
|
result.current.addBanner({
|
|
id: BANNER_ID.LOGS_ALL_DEPRECATION,
|
|
isDismissed: false,
|
|
content: null,
|
|
})
|
|
})
|
|
|
|
act(() => {
|
|
result.current.dismissBanner(BANNER_ID.LOGS_ALL_DEPRECATION)
|
|
})
|
|
|
|
expect(result.current.banners[0]?.isDismissed).toBe(true)
|
|
|
|
act(() => {
|
|
vi.advanceTimersByTime(300)
|
|
})
|
|
|
|
expect(result.current.banners).toEqual([])
|
|
})
|
|
})
|