Implements migration to add approved_at to submission_items, creates index, and updates process_approval_transaction to set approved_at on approvals. Also updates TypeScript types to include approved_at and aligns edge function behavior accordingly.
Recreated process_approval_transaction RPC without updating approved_at
drops erroneous column usage and updates updated_at explicitly to mark approvals.
Add missing serve() wrapper and correct CORS configuration in supabase/functions/process-selective-approval/index.ts, and import necessary modules. This ensures the edge function handles requests and applies proper CORS headers.
- Add early logging and health check to process-selective-approval edge function
- Implement idempotency check with timeout to avoid edge timeouts
- Expose health endpoint for connectivity diagnostics
- Increase client moderation action timeout from 30s to 60s
- Update moderation actions hook to accommodate longer timeouts
Replace the badge with unchanged Last edited and View History UI, keeping dialog and history functionality intact. Update RollbackDialog to support preview of changes and wider dialog, and integrate existing diff logic to preview before rollback. Adjust VersionIndicator to stop displaying version number while preserving UI elements.
Remove the version number badge display in VersionIndicator.tsx:
- drop Badge import and Clock icon import
- replace compact mode text with History
- remove version number badge in non-compact rendering
Keeps last-edited time and history functionality intact.
Implements complete plan to resolve duplicate span_id issues and metric collection errors:
- Ensure edge handlers return proper Response objects to prevent double logging
- Update collect-metrics to use valid metric categories, fix system_alerts query, and adjust returns
- Apply detect-anomalies adjustments if needed and add defensive handling in wrapper
- Prepare ground for end-to-end verification of location-related fixes
Applies the fix to properly handle and insert park location names during approval, ensuring location data is created/updated with correct name fields for Lagoon and future submissions.
Implement comprehensive update to process_approval_transaction to ensure location records are created with proper name fields during park creation and updates, and prepare migration to apply fixes in multiple phases. Includes backfill improvements and targeted fixes for Lagoon.
Backfilled Lagoon park with a proper location by updating backfill_park_locations to include name/display data and linking to location_id. Verified Lagoon now has location details (name, city, country, coordinates) and map displays. Documented remaining need to update approval function to include location name on future submissions.
Investigate Lagoon park to ensure location_id is populated after the backfill. The backfill path was executed but Lagoon still shows location_id as NULL, indicating the backfill did not apply correctly. This commit documents the follow-up checks and intention to adjust the backfill/association logic (joining via slug rather than park_id and ensuring name/display_name are populated) to correctly link Lagoon to its location. No frontend changes.
Run backfill to populate lagoon location and fix submission join
- Re-run and refine backfill to ensure Lagoon and similar parks receive proper location data by correcting join via slug and handling name/display_name in location inserts.
Implement one-time script to populate missing park locations ( Lagoon and others ) by creating a backfill that assigns proper location data and updates parks with new location_id after ensuring backfill function fixes.
- Add content-m matching loading skeletons for ParkDetail, RideDetail, CompanyDetail, etc., replacing generic spinners to preserve layout during load
- Remove redundant Back to Parent Entity buttons in detail pages in favor of breadcrumb navigation
- Prepare groundwork for breadcrumbs across detail pages to improve cohesion and navigation
Introduce breadcrumb navigation component and integrate into detail pages with hover previews; add PageTransition to App for smooth navigations and loading animations.
Adds hover-preview UX by introducing preview cards for entities and wiring hoverable links:
- Implements CompanyPreviewCard and ParkPreviewCard components plus hooks to fetch preview data
- Adds HoverCard usage to ParkDetail and RideDetail for operator, manufacturer, and designer links
- Creates preview wrappers for manufacturer/designer/operator links and updates related pages to use hover previews
- Includes supporting updates to query keys and preview hooks to fetch minimal data for previews
Update various components to wrap display names (parks, rides, manufacturers, designers, operators, etc.) in Link elements so they navigate to detail pages, aligning with the ParkDetail change. This includesRideDetail, RideListView, RideCreditCard, ParkDetail, and related imports, to enhance cohesion, interactivity, and browseability across the app.
Update ParkDetail to wrap park.operator.name in a Link to the operator page, and import Link from react-router-dom. This changes the display from plain text to a navigable link and fixes missing import.
Update parameterized analyze_data_completeness to check parks, rides, companies, and ride_models using appropriate fields instead of manufacturer_id for parks. Also replace get_recent_additions te.event_title with te.title.
Update the analyze_data_completeness function to set search_path = public to address security linter warning and ensure consistent function execution without elevated schema access. No behavioral changes beyond security context.
- Aligns database migration by adding a follow-up migration to set the search_path for the affected function to address a security linter warning and ensure proper execution scope.
Enhance frontend to correctly fetch entity names by joining with submission_metadata and filtering metadata_key = 'name'; replace incorrect submission_metadata(name) usage in systemActivityService.ts and Profile.tsx with proper inner join and metadata_value extraction.
Fix get_recent_additions by removing created_by joins for tables without such column, leaving creator data only for entity_timeline_events. Add migration to implement corrected logic. Update frontend queries handling content_submissions metadata to correctly extract entity names from submission_metadata. Also apply guarded admin-only execution for data completeness hook to prevent non-admin queries.
- Implement helper filter_jsonb_array_nulls and apply it in analyze_data_completeness to replace jsonb - 'null' usage
- Add search_path public in helper function for security
- Ensure useDataCompleteness runs only on admin pages by enabling query conditionally
- Add safe JSONB array null filtering via helper and update analyze_data_completeness
- Ensure search_path set to public in helper function
- Add admin-page guard to useDataCompleteness to disable on non-admin routes
- Add migration to fix JSONB array filtering in analyze_data_completeness
- Update useDataCompleteness to run only on admin pages via isAdminPage check
- Prepare for replacing invalid JSONB subtraction with proper filtering in RPCs
Implement plan to fix database RPCs by migrating to photos table, update hooks to enable only on admin pages, switch real-time subscriptions to the photos table, and apply to remaining forms. Also disable analytics in development.
Extend forms with blur-based validation via FormFieldWrapper.validationMode, and replace inline toasts with centralized formToasts. Update ManufacturerForm, DesignerForm, OperatorForm, PropertyOwnerForm, RideModelForm, and related components to use the new toast helper and ensure data-error scroll behavior where applicable.
Adds validation on blur mode to FormFieldWrapper, introduces animated validation states, and implements standardized form submission toasts via a new formToasts helper; updates ParkForm and RideForm to use the new toast system and to propagate error state with scroll-to-error support.
Add real-time validation feedback to FormFieldWrapper:
- Manage validation state (idle/valid/invalid)
- Show green check icon when valid
- Show inline error icon when invalid
- Integrate with existing Input/Textarea components without altering core behavior
Introduce a new reusable form field component that automatically shows hints, validation messages, and terminology tooltips based on field type; refactor forms to demonstrate usage.
Enhance forms by adding descriptive hints (with examples) to all fields (website URLs, heights, speeds, lengths, etc.) using the existing enhanced validation system. Includes updating ParkForm and RideForm to display field-specific guidance (and field hints for URLs, measurements, and submission notes), leveraging field hints generated from enhancedValidation.
Implements enhanced inline validation with contextual messages and examples, adds a comprehensive theme park terminology tool (tooltip and glossary), and integrates these features into ParkForm and RideForm (including header actions and descriptive hints). Also introduces new helper modules and components to support validated inputs and glossary tooltips.
Add a new Submission Help Dialog component accessible from park/ride forms, covering date precision, park/ride concepts, manufacturer vs designer, technical specs, units, submission process, and best practices with examples. Include trigger button integration from forms and plan for future documentation.
Enhance TechnicalSpecsEditor and related ride form fields with contextual tooltips and example guidance for track materials, propulsion methods, and other spec fields to improve user understanding of expected values. Changes include importing tooltip components, adding informative tooltips for specification name, type, unit, track/material categories (e.g., track materials, propulsion methods), and updating UI to display examples inline.
Add user-facing guidance texts and tooltips to additional complex form fields beyond date precision, including ParkForm and RideForm enhancements:
- Introduce contextual help sections with Info icons for Park Type, Status, Location, Operator/Owner, Source URL, and Submission Notes
- Add guidance for RideForm fields such as Category, Status, Manufacturer/Model context, and Technical specifications
- Ensure consistent muted help text styling and accessibility across forms
- Extend lines with inline Help/Info components to improve user understanding and reduce input errors
Extend FlexibleDateInput with contextual help text for all precision options (exact, month, year, decade, century, approximate), including an Info icon import and dynamic guidance displayed under the dropdown. Also prepare for enhanced SelectItem labels and optional tooltip enhancements.
Update park and ride submission forms to support and persist all new date precision options (exact, month, year, decade, century, approximate), ensure default and validation align with backend, and verify submissions save without errors. Includes front-end tests scaffolding and adjustments to submission helpers to store updated precision fields.
Batch update all date precision handling to use expanded DatePrecision, replace hardcoded day defaults, and adjust related validation, UI, and helpers. Includes wrapper migration across Phase 1-3 functions, updates to logs, displays, and formatting utilities to align frontend with new precision values ('exact', 'month', 'year', 'decade', 'century', 'approximate').
Extend createEdgeFunction usage to novu-webhook, seed-test-data, and sitemap by removing manual boilerplate (CORS, auth, tracking, error handling) and replacing logging with span-based tracing; wire in EdgeFunctionContext for supabase, user, span, and requestId; preserve core logic including webhook validation, data seeding utilities, and sitemap caching.
Refactor export-user-data, notify-user-submission-status, and resend-deletion-code to use createEdgeFunction wrapper. Remove manual CORS, auth, rate limiting boilerplate; adopt standardized EdgeFunctionContext (supabase, user, span, requestId), and integrate built-in tracing, rate limiting, and logging through the wrapper. Update handlers to rely on wrapper context and ensure consistent error handling and observability.
Refactor process-expired-bans, detect-location, detect-anomalies, rate-limit-metrics, and collect-metrics to use createEdgeFunction wrapper with standardized error handling, tracing, and reduced boilerplate. Update signatures to receive { supabase, span, requestId } (and user where applicable), replace manual logging with span events, remove per-function boilerplate, and ensure consistent wrapper configuration (cors, auth, rate limits, and tracing).
- Refactor validate-email, receive-inbound-email, and send-admin-email-reply to use createEdgeFunction wrapper with automatic error handling, tracing, and reduced boilerplate.
- enrich wrapper to support service-role usage and role-based authorization context for complex flows.
Batch 1 of Phase 2: migrate 3-4 edge functions to use createEdgeFunction wrapper (process-selective-approval, process-selective-rejection, rate-limit-metrics) to enable automatic error logging, CORS, auth, and reduced boilerplate; preserve existing logic where applicable and prepare for subsequent batches.
Implement Phase 1 by adding error span logging and database persistence to 8 edge functions that already log errors:
- detect-location
- export-user-data
- notify-moderators-submission
- novu-webhook
- send-escalation-notification
- send-password-added-email
- resend-deletion-code
- merge-contact-tickets
This update introduces startSpan/endSpan and logSpanToDatabase usage in catch blocks to ensure errors are recorded in the monitoring database.
Add retry mechanism to backfill-ride-data, backfill-company-data, and backfill-park-locations edge functions using withEdgeRetry, including isRetryableError and isDeadlockError. Apply CORS headers to ride-data and company-data responses, and ensure park-locations already contains CORS remains with retry wrapping. Update unauthorized and success responses to include CORS headers.
Update logger.ts to use the import-map resolved package
- Replace jsr:@supabase/supabase-js@2 with @supabase/supabase-js
- Align edge function logger with deno.json import map for reliable bundling