mirror of
https://github.com/supabase/supabase.git
synced 2026-10-08 02:45:07 +03:00
* feat(docs): main troubleshooting page * feat(docs): global troubleshooting page layout * feat(docs): global troubleshooting page filter logic * enhance(docs): troubleshooting page ui & filters Improve UX and accessibility of global troubleshooting search page. - Implement TroubleshootingFilterStateProvider for managing filter state - Add TroubleshootingFilterEmptyState component - Improve TroubleshootingFilter UI with applied filters display - Update TroubleshootingPreview component with better layout and accessibility - Add TroubleshootingEntryAssociatedErrors component for displaying related errors - Refactor Troubleshooting utils and schemas - Update troubleshooting content template * feat(docs): individual troubleshooting pages Add individual pages for detailed information on troubleshooting entries. Small fixes to UI for troubleshooting displays. - Wrap GlobalTroubleshootingPage with SidebarSkeleton - Add TroubleshootingErrorListDetailed component for detailed error display - Implement TroubleshootingBackLink component for navigation - Update TroubleshootingPreview to use Next.js Link and include parent page - Refactor Footer component to accept className prop - Add hideFooter option to SidebarSkeleton - Minor updates to TopNavBar and other utility functions * fix: minor styling issues * tweak(troubleshooting docs): use breadcrumbs * tweak(troubleshooting docs): use sidebar for filter * enhance(troubleshooting docs): navigation, keywords Better navigation for individual troubleshooting entries, using a version of the sidebar + keywords handling via search params for good linking behavior Details: - Add TroubleshootingSidebar to TroubleshootingPage - Implement query state management for keywords using nuqs - Improve accessibility and styling of troubleshooting components - Update empty state handling and related keywords display - Upgrade nuqs package to version 1.19.1 * fix(docs): wrap useSearchParams in Suspense * seo(docs): add canonical link to troubleshooting * enhance(docs,troubleshooting): auto-reveal errors On troubleshooting search pages, if the searched term matches a hidden error, auto-reveal it when searching. When the search term is cleared, hide programmatically-opened errors while preserving user-opened ones. * enhance(docs,troubleshooting): search bar Add search bar to individual troubleshooting pages * fix(docs): breadcrumb links Fix breadcrumb linking so it uses next/link instead of reloading entire app on navigation. * fix(docs): typo * enh(docs): new troubleshooting design * enh(docs): use new multi-select * enh(docs): troubleshooting responsive styles * Update apps/docs/content/troubleshooting/monitor-supavisor-postgres-connections.mdx
25 lines
1.0 KiB
TypeScript
25 lines
1.0 KiB
TypeScript
import { createSerializer, parseAsArrayOf, parseAsString } from 'nuqs'
|
|
|
|
import { ITroubleshootingEntry } from './Troubleshooting.utils'
|
|
|
|
export const TROUBLESHOOTING_CONTAINER_ID = 'sb-docs-troubleshooting-container'
|
|
export const TROUBLESHOOTING_DATA_ATTRIBUTES = {
|
|
QUERY_ATTRIBUTE: 'data-sb-docs-troubleshooting',
|
|
QUERY_VALUE_ENTRY: 'entry',
|
|
PRODUCTS_LIST_ATTRIBUTE: 'data-products',
|
|
KEYWORDS_LIST_ATTRIBUTE: 'data-keywords',
|
|
ERRORS_LIST_ATTRIBUTE: 'data-errors',
|
|
}
|
|
|
|
export function formatError(error: ITroubleshootingEntry['data']['errors'][number]) {
|
|
return `${error.http_status_code ?? ''}${!!error.http_status_code && !!error.code && ' '}${error.code ?? ''}`
|
|
}
|
|
|
|
export const troubleshootingSearchParams = {
|
|
search: parseAsString.withDefault(''),
|
|
products: parseAsArrayOf(parseAsString).withDefault([]),
|
|
tags: parseAsArrayOf(parseAsString).withDefault([]),
|
|
errorCodes: parseAsArrayOf(parseAsString).withDefault([]),
|
|
}
|
|
export const serializeTroubleshootingSearchParams = createSerializer(troubleshootingSearchParams)
|