Commit Graph

27 Commits

Author SHA1 Message Date
Joshen Lim
09c6f0aa2c DropdownMenu component modal prop default to false, but allow passing prop value (#34846)
* DropdownMenu component modal prop default to false, but allow passing prop value

* Smol fix for advisor
2025-04-09 13:59:57 +08:00
Terry Sutton
28c1c213eb Fix modal locking up page (#34837) 2025-04-08 22:35:36 +02:00
Saxon Fletcher
58272034b1 Multiple assistant chats (#34011)
* add assistant chats

* refactoring

* refactor

* refactor to use onfinish

* fix ts

* dependencies removal

* Update useAssistant.ts

* ts

* refactor useAssistant hook to valtio store

* Minor tweaks

* Add name param to newChat, and add names to each call of newChat

---------

Co-authored-by: Alaister Young <a@alaisteryoung.com>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-03-28 16:36:41 +08:00
Saxon Fletcher
ecaba079be fix duplicate policy name (#34316)
* fix duplicate policy name

* style
2025-03-21 11:28:36 +08:00
Saxon Fletcher
2d48ba3314 Click function/trigger/policy to edit (#34172)
click to edit
2025-03-13 20:49:33 +10:00
Francesco Sansalvadore
ecd181bcd9 studio mobile v2 (#32630)
* improve some studio mobile layouts

* improve some studio mobile layouts

* improve settings

* assistant mobile

* assistant mobile

* assistant mobile

* responsive formlayout and new project layout

* improve dashboard pages headers

* improve dashboard auth pages

* mobile org settings

* mobile billing fixes

* adjust paused project container height

* remove comments

* triggers

* leftovers

* ai assistant

* fix errors

* remove 16px input size

* fix test

* merge access tokens settings page conflicsts

* smol integrations here and there
2025-01-17 19:07:35 +01:00
Joshen Lim
d88cb12794 Remove assistant V2 from feature preview (#30779)
* Remove assistant V2 from feature preview

* Hide fix with assistant button in rls editor
2024-12-02 22:03:31 +08:00
Saxon Fletcher
8c3da2ed95 More assistant refinements (#30730)
* ai refinements

* ui fixes

* space

* reduce dot height

* Fix prop type issue

* Assign allowHoverEffect to ai assistant button and panel

* Lint

* Some lints

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-11-29 20:31:02 +10:00
Joshen Lim
d8a57c1c7e Add settings for queues: toggle expose through postgrest + permissions via table privileges (#30564)
* Add settings for queues: toggle expose through postgrest + permissions via table privileges

* Ensure appropriate grants are granted when toggling, and revoked when disabling

* Update to use queues_public schema

* Update queue schema to pgmq_public and add/remove from data api when enabling/disabling

* Fix query for retrieving toggle state

* Add schema invalidation

* Remove hard code

* Use QueuesSettings from Queues folder, remove from NewQueues

* Update SQL for toggling exposure + support RLS enabling

* Support toggling RLS for a queue

* Update admonition copy in queues for enabling/disable postgrest exposure

* Add custom RLS policy for queue

* Minor style fixes

* Fix

* Remove hard code

* Update RLS to add message regarding relevancy only if exposure to PostgREST is enabled

* Update message in exposing queues to postgREST

* Address feedback

* Address feedback

* Don't revoke postgres role stuff

* Remove hard code

* Update copy

* Update

* Address Oli's feedback, ensure that queues ALL have RLS enabled prior to allowing exposure to PostgREST

* Address remaining feedback

* Remove hardcode

* Update

* Address feedback
2024-11-27 12:10:33 +08:00
Joshen Lim
12d92aed99 Assistant V2 (#30523)
* start

* added panels

* remove stuff

* fixes and refinements

* clean up

* remove old assistant panel

* resizable assistant kinda

* use icon

* Add missing package

* remove canvas

* add suggestions

* updated empty state if no tables exist

* fix table condition

* Implement diffing if using assistant in sql editor

* Reinstate old assistant in SQL editor if feature preview is off

* pane size adjustment

* assistant button corners

* Add SQL snippet content to assistant if opening assistant in sql editor

* Add the necessary checks for opt in and hipaa

* revert adding snippet to assistant when opening assistant in sql editor

* Add cmd i shortcut

* Add admonitions for when disablePrompt is toggled on, and if no api key is set. Add footer note RE rate limitation

* Bump ai package in packages

* some fixes for backwards compability depending on feature preview toggled

* Rename feature preview property for new assistant

* Smol fix

* Prevent SQL snippet from running until message is finished

* only loading last message

* fix z-index

* save chat state to global state

* add debug to failed ai queries

* Add basic contextual invalidation

* Add explain code action to SQL editor

* Add link to abort ongoing queries from SqlSnippet

* Update feature preview content

* Fix

* Fix

* Fix

* Te4st

* Fix tests

* ONly show ai button within a project

* Fix PH tracking

* Beef up a bit more event tracking

* Rough fix to padding when assistant is open

* A bit more telemetry stuff

* Update prompts

* fix rls editing via assistant

* Update generate-v3.ts

prompt to get auth schema too

* Add policy satement to assistant when editing

* Address all comments

* fixc

* Fix SqlSnippet not taking full width on larger viewports

* Adjust max width

---------

Co-authored-by: Saxon Fletcher <saxonafletcher@gmail.com>
2024-11-25 18:50:56 +08:00
Joshen Lim
225d461381 Hook up RLS to new assistant if feature flag is enabled (#30357)
* Hook up RLS to new assistant if feature flag is enabled

* Reset conversation if opening a different entity

* Add prompt to use alter policy if policy definition is provided

* Remove console log
2024-11-08 18:03:30 +08:00
Joshen Lim
01e81fd400 Chore/assistant tweaks 281024 (#30134)
* Add alpha notice

* Close assistant via cmd i if not focused on monaco

* Add edit with assistant CTA for database functions

* Attach existing function definition when editing a function to prompt

* Leave comments

* Small refactor
2024-10-29 15:10:00 +08:00
Joshen Lim
3a3360bbd0 Fix all usage of button tooltip (#30076)
* Fix all usage of button tooltip

* PRETTY
2024-10-24 13:32:47 +00:00
Joshen Lim
f521109ce2 Chore/database functions v2 (#29969)
* Init AiAssistantPanel

* Temp

* Temp

* iterating on assistant ux

* More spiking

* Tweaking...

* Moar tweaking..

* Even more tweaking

* Tweek

* More tweaks

* Final tweaking...

* TWEAK

* Spelling

* Fix

* Assistant error handling and small bug fix in context for message

* Add feature flag

* Fix

* Address all feedback

* Minor
2024-10-23 16:43:38 +08:00
Jordi Enric
3fa447d57d fix layouts and make sure buttons are visible in smol screens (#28939)
* improve table editor headers

* sql editor horizontal scroll auto in headers

* fix headers in tablelist

* fix headers in db roles

* fix database functions in smol screens

* fix table list headers

* fix trigger lists table

* fix enum types headers

* Update Extensions component styling with flex-wrap

* Update Indexes component UI layout and styling

* fix publications table

* move sql editor pagination tobottom

* rm unused imports, add correct label to db selector

* fix layout shift in run button

* add tooltip to results limitter

* make header in sql editor results scrollable

* Fix Button tooltip and table header formatting for database/tables/[id] ColumnList

* Fix SQL editor footer disappearing with resizable panel

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-09-02 16:46:19 +07:00
Ivan Vasilov
8c6d0f1890 feat: Save the selected schema in the URL and local storage (#28662)
* Add nuqs package.

* Add useSchemaQueryState hook.

* Use the new hook in all places where there's is a schema selector.

* Make the useQueryState work with SSR in playwright.

* Fix the saving to local storage to happen as a side effect without any additional rerenders.
2024-08-19 13:28:25 +02:00
Joshen Lim
6a265a3289 Chore/fix autodocs stored procedure menu (#28385)
* Fix highlighted state in nav bar for V1 auto docs when selecting a store procedure

* Fix RPC parameters in V2 auto docs

* Replace database functions create function button cta with ButtonTooltip
2024-08-05 17:11:17 +08:00
Alaister Young
70da0f1d1d chore: cleanup packages (#27770)
* chore: cleanup packages

- Avoid circular imports
- Export API-types as types
- pg-format without depending on Node internal Buffer (not browser-compatible)
- Avoid importing from barrel files in ui dir

* chore: avoid barrel file imports in studio (#27771)

* chore: avoid barrel file imports

- Removes some unused imports
- Avoids barrel file import for faster builds + less memory

* add eslint rule

* type fixes

* delete layouts barrel

* delete components/grid barrel file

* delete components/grid/utils barrel file

* delete components/grid/components/common barrel file

* delete components/grid/components/editor barrel file

* delete components/grid/components/formatter barrel file

* delete components/grid/components/grid barrel file

* delete components/grid/components/header/filter barrel file

* remote components/grid/store barrel file

* remove components/interfaces/Auth/Policies barrel file

* delete components/interfaces/Settings/Logs barrel file

* delete components/ui/CodeEditor barrel file

* delete components/ui/Forms barrel file

* delete components/ui/Shimmers barrel file

* delete data/analytics barrel file

* delete hooks barrel file

* cleanup lib/common/fetch barrel file

* final * barral files cleanup

* global react-data-grid styles

* remove console.log

---------

Co-authored-by: Kevin Grüneberg <k.grueneberg1994@gmail.com>

* fix build

---------

Co-authored-by: Kevin Grüneberg <k.grueneberg1994@gmail.com>
2024-07-04 14:48:10 +08:00
Alaister Young
8e47d317fa chore: pg-meta functions (#26881)
* start pg-meta functions

* pg meta create function

* pg meta database functions update and delete

* fix ts

* update execute sql error type

* update execute sql error type

* remove duplicate database functions query
2024-06-03 23:21:19 +08:00
Ivan Vasilov
db2fb81ec8 feat: Add more lint rules (#22594)
* Refactor the functions page to keep its state in the URL.

* Derive the filter options from currently active lints.

* Update the lint query sql.

* Update the urls to the docs.

* Fix the paddings on the filterPopover.

* Add handling for the other types of lints.

* Comment out the ignore lint functionality.

* Fix a misspell.

* unbest

* Bring back the CTA button.

* Update the SQL code from the splinter repo.

* Add handling for the duplicate index lint rule.

---------

Co-authored-by: Terry Sutton <saltcod@gmail.com>
2024-04-11 11:50:17 +02:00
Kevin Grüneberg
f9a55935f5 chore: use type imports for types/interfaces (#21738) 2024-03-04 20:48:22 +08:00
Ivan Vasilov
630eeefa93 fix: Minor papercut fixes in the studio (#21319)
* Fix small issues with the tables and keys.

* Refactor the TimezoneSelection with shadcn components.

* Dont pass active to the NavMenuItem.

* Fix the double hash in the _ page.

* Fix an error where an input received an undefined as value.

* Fix increase retention period in PITR disabled incorrectly

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-02-19 13:34:24 +08:00
hallidayo
312da2b18a fix: functions argument truncation (#20960)
* argument truncation

* fix prettier

---------

Co-authored-by: Alaister Young <a@alaisteryoung.com>
2024-02-05 19:39:49 +11:00
Terry Sutton
db3ff7b7b8 Alpha sort db functions, triggers and indexes tables (#19852)
* Alpha sort db functions, triggers and indexes tables

* Use lowercased names when sorting.

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2023-12-19 11:53:12 +01:00
Joshen Lim
09de17cac3 Chore/deprecate functions store (#19714)
* Shift all usage of database functions from pg meta store to RQ

* Remove functions store from pg meta mobx store

* fix

* Fix

* Fixes

* fix

* Address comments
2023-12-14 15:30:26 +07:00
Alaister Young
42164183f2 fix: add missing asChild props (#19456)
* fix: add missing asChild props

* move csvlink outside of dropdown trigger

* fix incorrect merge
2023-12-06 21:11:32 +11:00
Ivan Vasilov
436bdb10ae chore: Move the studio app to apps/studio (#18915)
* Move all studio files from /studio to /apps/studio.

* Move studio specific prettier ignores.

* Fix the ui references from studio.

* Fix the css imports.

* Fix all package.json issues.

* Fix the prettier setup for the studio app.

* Add .turbo folder to prettierignore.

* Fix the github workflows.
2023-11-15 12:38:55 +01:00