Commit Graph

19 Commits

Author SHA1 Message Date
Joshen Lim 7f5865872a Enforce noUnusedLocals and noUnusedParameters in tsconfig.json + fix all related issues (#45264)
## Context

Enforce `noUnusedLocals` and `noUnusedParameters` in tsconfig.json + fix
all related issues
2026-04-27 17:42:34 +08:00
Charis 3b7052b5a9 cleanup: fix import order and prefixes for studio/data (#44501) 2026-04-03 09:15:57 +02:00
Ivan Vasilov 0d5be306ef chore: Bump React Query to v5 (#40174)
* Bump the deps, refactor deprecated code.

* Migrate keepPreviousData usage.

* Migrate all uses of InfiniteQuery.

* Fix refetchInterval in queries.

* Migrate all use of isLoading to isPending in mutations.

* Fix accessing location in claim-project.

* Fix a bug in duplicate query keys.

* Migrate all queries to use isPending.

* Revert "Fix accessing location in claim-project."

This reverts commit 2a07df64b5.

* Revert the rss.xml file to master.
2025-12-10 10:10:29 +01:00
Ivan Vasilov c83d7255a4 chore: Migrate leftover query keys (#40573)
* Fix queryKey to be compatible with RQ 5.

* Revert .find usage of queryKey.
2025-11-18 10:27:17 -07:00
Ivan Vasilov 8b657165b5 chore: Migrate to use custom type for ReactQuery queries and mutations (#40073)
* Add custom types for queries, mutations and infinite queries.

* Migrate all queries to use the new type.

* Migrate all infinite queries to useCustomInfiniteQueryOptions.

* Migrate all mutations to use useCustomMutationOptions.

* Add type to all imports in `types` folder.
2025-11-03 13:18:13 +01:00
Joshen Lim 64e3e047eb Final final cleaning up barrel files (#40018)
* Final final cleaning up barrel files

* Fix merge conflict
2025-10-31 14:02:59 +08:00
Joshen Lim b4d38fabd0 Chore/barrel files bye part 05 (#40016)
* Clean up barrel files part 4

* nit

* Part 5 of cleaning up barrel files

* Revert changes for types

* Nit
2025-10-31 13:15:31 +08:00
Ivan Vasilov da4a40e308 chore: Migrate RQ functions to use object syntax style (#39895)
* Migrate all uses of invalidateQueries to use object syntax.

* Migrate the remainder of useInfiniteQuery.

* Migrate all setQueriesData.

* Migrate all fetchQuery uses.

* Migrate some leftover functions from RQ.

* Fix issues found by Charis.
2025-10-28 10:43:14 +01:00
Alaister Young 8855d05803 chore(studio): swap react-query to object syntax (#39842)
* chore(studio): swap react-query to object syntax

* Fix small issues found

* Fix realtime settings

* Nit

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-10-27 09:38:27 +01:00
Jonathan Summers-Muir 3feb843574 fix: restrict log inspection panel tab focus refetch (#37265)
* Update unified-log-inspection-query.ts

* Update unified-log-inspection-query.ts
2025-07-17 19:13:52 +00:00
Jonathan Summers-Muir 7d5dd5b6be Chore/logs reloading state (#37252)
* Add loading opacity and keep previous data for logs

Wrapped TimelineChart and DataTableInfinite in divs with opacity transition during data fetching for improved UX. Added keepPreviousData: true to unified logs chart, count, and infinite queries to retain previous data while fetching new results.

* Remove keepPreviousData from logs count query

The keepPreviousData option was removed from the useUnifiedLogsCountQuery hook to rely on default query behavior or custom options. This may affect how data is retained between queries.

* Update UnifiedLogs.tsx

* Refactor TimelineChart opacity handling

Moved opacity and transition classes from a wrapping div directly to the TimelineChart component for cleaner structure and improved conditional styling.
2025-07-17 13:49:04 +00:00
Joshen Lim 22f937c954 Chore/async filters for unified logs (#37200)
* Refactor retrieval of log counts

* Async filters

* Clean up

* Clean up

* Fix
2025-07-17 17:33:17 +08:00
Joshen Lim 620805a1ac chore/unified-logs-fixes-03 (#36725)
* Improve function logs styling + add copy button

* Add tooltips for buttons in toolbar

* Remove 'info' from levels

* Add export logs to csv and json functionality

* Add duration selection for download logs if no time range specified in search

* Fix TS

* Fix TS

* Update DataTableColumnStatusCode.tsx

---------

Co-authored-by: Jonathan Summers-Muir <MildTomato@users.noreply.github.com>
2025-07-10 09:13:10 +00:00
Saxon Fletcher 0419d45b6f Add search docs, advisors, and custom logging tools (#36852)
* ui refinements

* rename chat

* copy

* prose message styles

* add icon back

* fix message save

* simplify empty state

* update suggestions

* pass through props

* button styles

* onboarding icons

* name button

* remove results

* current chat name

* use type

* add advisor and search

* fix down arrow

* logging tools

* more general filter tools

* fixes

* pageparam fix

* move search docs
2025-07-10 09:43:38 +10:00
Jonathan Summers-Muir 1e3b5063bb Feat/unified logs inspection panel (#36895)
* Update QueryOptions.ts

* Create UnifiedLogs_InspectionPanel_Architecture.md

* init new queries

* Create UnifiedLogs_ServiceFlow_Implementation_Plan.md

* Add service flow blocks to UnifiedLogs panel

Introduces ServiceFlowBlocks components to visually represent the service flow in UnifiedLogs, including Origin, Network, PostgREST, Postgres, and Response steps. Adds utility formatters and updates ServiceFlowPanel to render the new blocks with enriched data and loading/error states.

* Enable filterable fields in ServiceFlow blocks

Refactored ServiceFlow blocks to support filterable fields by passing filterFields and table props, updating BlockField to render filterable values as clickable actions, and aligning field configs with filterable IDs. Updated ServiceFlowPanel to use new block names and pass required props. This enhances interactivity and consistency in the UnifiedLogs service flow UI.

* Update ServiceFlowBlocks.tsx

* Enhance Service Flow with enriched fields and filtering

Expanded the Service Flow SQL query to extract 35+ flattened, meaningful fields including request, response, client location, network, headers, and JWT data. Updated the implementation plan to reflect new block architecture, filtering integration, and future enhancements. Added debug logging for enriched and raw log data in ServiceFlowPanel.

* Start adding inspection panel

* Moar logs

* Add Postgres service flow support to Unified Logs

Introduces Postgres as a first-class service flow type in Unified Logs, including SQL query, type definitions, UI blocks, and filtering. Updates ServiceFlow queries, types, and UI components to display enriched Postgres log details and event messages. Also refines filter fields, log type ordering, and minor UI adjustments for clarity and consistency.

* Lots of tidying up, moving blocks into their own files.

* Remove UnifiedLogs architecture and service flow docs

Deleted documentation files related to UnifiedLogs inspection panel architecture, service flow field mapping, implementation plan, and integration example. This cleans up outdated or redundant design and implementation reference materials.

* Refactor service flow blocks to use unified config system

Replaces individual service block components with a generic, config-driven system. Introduces a shared Block component and centralizes block configuration in blockConfigs.ts, reducing duplication and improving maintainability. Updates imports and removes now-unnecessary block files. Also refactors ServiceFlowPanel to use the new block structure and simplifies layer icon logic.

* Refactor ServiceFlow blocks and utilities structure

Consolidates edge service flow SQL queries to reduce duplication, removes ServiceFlowBlocks.tsx in favor of more modular block/component structure, and moves storage-specific utilities to a new utils/storageUtils.ts file. Updates imports in config files and ServiceFlowPanel to reflect the new structure. Type definitions are clarified and extended in types.ts.

* Update ServiceFlow.sql.ts

* Refactor ServiceFlow types for stronger type safety

Replaces generic 'any' types with specific types such as ColumnSchema, QuerySearchParamsType, and SearchParamsType in ServiceFlow components and ServiceFlowPanel. This improves type safety and code clarity, and removes unused metadata and workaround variables from ServiceFlowPanel.

* Remove debug flags and console logs from ServiceFlow components

Eliminated unused DEBUG_SERVICE_FLOW flags and related console logging from ServiceFlow.sql.ts and ServiceFlowPanel.tsx to clean up the codebase and reduce unnecessary output.

* Remove unused log query and filtering functions

Deleted unused functions related to log level filtering, base condition building, and the edge/supavisor logs queries. This cleanup simplifies the UnifiedLogs.queries.ts file by removing legacy or currently unused code.

* revert

* Remove ServiceFlow panel and types, update DataTableToolbar

Deleted the ServiceFlowPanel component and its associated types from the UnifiedLogs interface. Updated DataTableToolbar to toggle between PanelLeftClose and PanelLeftOpen icons based on the open state.

* Remove unused totalRows prop from DataTable

Eliminates the totalRows prop from UnifiedLogs and its context interface, as it is no longer used. This helps clean up the component API and related type definitions.

* Refactor log field configs and unify event message component

Replaces specialized PostgresEventMessage with a generic EventMessage component and updates references accordingly. Consolidates all log field configuration files into serviceFlowFields.ts, removing separate config files for each service. Cleans up unused types and utility imports, and deletes redundant formatters.

* Show empty state for Postgres block with no data

Added logic to display an empty state in the Postgres block when no Postgres data is available in non-Postgres logs. Also updated ServiceFlowPanel to render both PostgREST and Postgres blocks, ensuring the empty state is shown when appropriate.

* Remove Log Details tab from ServiceFlowPanel

The Log Details tab and its associated content have been removed from the ServiceFlowPanel component. This simplifies the UI by focusing on the Overview and Raw JSON tabs.

* Update UnifiedLogs.queries.ts

* Update UnifiedLogs.queries.ts

* Update apps/studio/components/interfaces/UnifiedLogs/ServiceFlow/components/shared/BlockField.tsx

* Refactor UnifiedLogs layout and improve service type formatting

Refactored UnifiedLogs.tsx to use a more flexible ResizablePanelGroup layout, replaced inline function logs panel with a new LogsListPanel component, and removed unused imports and code. Updated ServiceFlow.sql.ts to simplify JWT payload extraction and added a dedicated query for edge function service flow. Added a utility to format service type strings for display in UnifiedLogs.utils.ts.

* Refactor logs UI and improve service flow handling

Renamed FunctionLogsTab to LogsList and added a new LogsListPanel for displaying function logs in a side panel. Improved ServiceFlowPanel with better panel sizing, conditional query enabling, and UI adjustments. Enhanced EventMessage with badge styling and service type formatting. Updated CollapsibleSection for cleaner layout. Enabled debug mode in unified-log-inspection-query. Updated FilterSideBar to use ResizablePanel for improved layout flexibility.

* Refactor UnifiedLogs UI and ServiceFlow query fields

Removes unused skeletonClassName from BlockFieldConfig and related UI, simplifies ServiceFlow SQL query by returning null for unused JWT fields, and updates UnifiedLogs and LogsListPanel for improved layout and collapsible logs panel. Also adjusts table and log list row heights for better visual consistency.

* Update ServiceFlowHeader.tsx

* Update ServiceFlowHeader.tsx

* Refactor ServiceFlowPanel and header tooltip logic

Replaces custom tooltip implementation in ServiceFlowHeader with ButtonTooltip for navigation buttons. Simplifies serviceFlowType logic in ServiceFlowPanel by removing the getServiceFlowType helper and using direct mapping, reducing code complexity.

* Update UnifiedLogs.constants.tsx

* Remove commented code and add doc comment in UnifiedLogs

Removed an unused commented-out span in UnifiedLogs.fields.tsx and added a documentation comment for the Supabase storage logs query fragment in UnifiedLogs.queries.ts.

* Update UnifiedLogs.tsx

* Remove 'live' level from DataTable components

Eliminated the 'live' level from LEVELS constant and related color utility logic. Also removed commented code and references to 'live' in DataTableFilterControls and LiveRow, streamlining the DataTable component's status handling.

* Update UnifiedLogs.constants.tsx

* cleanup

---------

Co-authored-by: Alaister Young <a@alaisteryoung.com>
2025-07-08 20:00:23 +08:00
Joshen Lim 307f2843e1 Chore/unified logs fixes 02 (#36710)
* Temporarily disable cmd K shortcut for searching unified logs

* Update placeholder for search input

* Fix getLogsCountQuery for method

* Standardize pathname parameter

* Fix refresh button
2025-06-27 18:58:50 +08:00
Joshen Lim ec43e11c11 Chore/fix unified logs (#36650)
* Fix z-index position of row

* Fix column widths to make it fit a laptop viewport better

* Fix auto fetching when scrolling to the bottom

* Small style fixes + decouple count loading state from table loading state

* Refactor row uuid to just id, add de-duping logic to logs data, standardise unified logs query options

* Clean up logs

* Misc styling tweaks

* Reinstate prev cursor and direction for live mode

* Clean

* Revert text sizes

* Remove now resolved comments
2025-06-26 16:45:45 +08:00
Jonathan Summers-Muir 8bc3087a11 chore: converts to POST for queries for unified logs (#36596)
Update QueryOptions.ts

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-06-24 17:30:04 +08:00
Joshen Lim 2808931f92 Chore/refactor unified logs infinite queries (#36598)
* Split unified logs count into its own infinite query and refactor main UI to use that new query

* Split unified logs into its own infinite query and refactor main UI to use that new query

* Shift useChartData into unified-logs-chart-query, and refactor main UI to use that new query

* Rename unified-logs-query to unified-logs-infinite-query

* Remove uuid and live params from query string in react queries for unified logs
2025-06-24 16:28:00 +08:00