Commit Graph

14 Commits

Author SHA1 Message Date
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
Joshen Lim
cab0585533 Fe 1799/consolidate to useselectedprojectquery and (#37684)
* Replace all usage of useProjectContext with useSelectedProjectQuery

* Replace all usage of useSelectedProject with useSelectedProjectQuery

* Replace all usage of useProjectByRef with useProjectByRefQuery

* Replace all usage of useSelectedOrganization with useSelectedOrganizationQuery

* Deprecate useSelectedProject, useSelectedOrganization, and useProjectByRef hooks

* Deprecate ProjecContext
2025-08-06 10:53:10 +07:00
Saxon Fletcher
28fe5811de Inline editor feature preview (#33541)
* add edge function knowledge

* deploy edge function mutaton

* add edge function block with deploy

* update function url

* update tools

* editor sql

* add templates

* use monaco editor

* hook up templates

* fixes

* add behind feature flag

* preview docs

* move editor

* initialPrompt

* consolidate widgets

* remove generic editor

* move logic

* fix ts

* include schema metadata

* Fix width of save snippet button

* Set tooltip position

* Use inlineLink component

* Remove unnecessary z index

* Lint

* Lint import statements in EditorPanel

* fixes

* fix keyboard shortcut

* show/hide results and invalidation

* fix focus issues in widget

* fixes

* fix ts

* Support cmd enter shortcut to run query in InlineEditor

* Update InlineEditorPreview to use admonition

* prompt updates

* add discussion url to preview

* schemas array

* One last clean up

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-02-19 14:58:58 +10:00
Ivan Vasilov
98ca85156a chore: Use sql-formatter for formatting all SQL in the studio (#33071)
* Bump the sql-formatter dependency.

* Add a function formatQuery which is a wrapper around sql-formatter.

* Replace all formatSQL features to use the new function formatSql.

* Remove unneeded RQ for formatting.

* Small fix.
2025-01-27 13:04:31 +01:00
Joshen Lim
db2e977f7d Add spam validation check in auth email templates (#30188)
* Add spam validation check in auth email templates

* Update comment

* Add another banding

* Update
2024-10-31 10:07:53 +08:00
Joshen Lim
0070265e6d Chore/assistant tweaks (#30074)
* Add cmd i to close the assistant

* Update command in side nav

* Add kill switch for sending assistant prompts

* Add basic telemetry around quick sql editor assistant

* Fix
2024-10-25 09:57:09 +08: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
Joshen Lim
2662583d7e Add placeholder in database functions editor (#27922)
* Add placeholder in database functions editor

* Address feedback

* Don't show placeholder if language is sql

* Fixes

* Fix
2024-07-15 14:23:59 +08:00
Kevin Grüneberg
13cfc0abb5 fix: barrel imports (#21728)
Avoid importing all components via barrel files that lead to bloated bundles/chunks
2024-03-04 18:39:53 +08:00
Ivan Vasilov
efa055f068 fix: RLS Editor with Streaming AI - second attempt (#19462)
* Reapply all changes from the reverted PR.

* Move the API route to pages folder.

* Turn off outputFileTracing.
2023-12-06 15:54:22 +01:00
Kevin Grüneberg
d6b7c1b7ba Revert "feat: Add streaming responses to the new RLS Editor (#19304)" (#19439)
This reverts commit a2b01e0bc5.
2023-12-05 16:50:26 +00:00
Ivan Vasilov
a2b01e0bc5 feat: Add streaming responses to the new RLS Editor (#19304)
* Add vercel/ai. Commit additional next types.

* Add a API route in /app for streaming responses.

* Make the components work with streaming response.

* Add a dummy page to /app folder to fix a linking bug.

* Fix the dummy page.

* Fix the dummy page again.

* Add an empty layout to the app folder.

* Make the code snippets in the chat read-only.

* Remove queries and mutations for suggest.

* Reset the chat when closing the panel.

* Make the AI instructions a bit better.

* Don't render empty code blocks.

* Try to use remark for rendering the code. Style fixes for CodeBlock in AI assistant panel.

* Fix the styling of the definitions when sending them to OpenAI.

* Fix the css styling of the messages and code blocks.

* Move the suggest API route from app to pages folder.

* Revert the change for app API routes.

* Make the API route look like the rest of the API routes.

* Use Pre instead of Code because the <code> tags aren't working if between spans.

* Minor leftovers.

* Revert to using app route handlers.

* Change the wording on the diff header.

* Add nextjs types.

* Fix a missing import.

* Move AssistantChatForm back to db-new.

* Fix a build error.

* Rename the suggest route to assistant.

* Fix Joshen's comments.
2023-12-05 16:05:02 +01:00
Ivan Vasilov
1f38fe2012 feat: New Policy Editor (#19166)
* Add two more sizes to the Panel component.

* Add alias for the older openai-api library. The new one is added under the openai name.

* Add API routes

* Add components for the new AI RLS panel.

* Bunch of changes to the AI Policy Editor.

* Add a button for opening the new Policy Editor.

* Add a feature flag for the new editor.

* Add a confirmation modal when closing the panel.

* Fix leftover data when closing the panel.

* Make the copy button work.

* Add the next/swc packages to package-lock.json.

* Merge master

* Scaffold debug sql in rls editor

* Small improvements to policy chat

* Hook up debug to ai assistant panel

* Improve debug UX

* Add debug request badge

* Some styling fix

* Small styling fix

* Another small styling fix

* Shift create new policy ai button + fix error stylign with code editor height

* Add tooltips to apply changes and copy code from assistant message

* Hide assistant button is not platform

* Small lint

* Add default error handlers to all AI RQ mutations

* Small fix

* Remove IS PLATFORM check for rls assistant

* Add placeholder to RLS code editor

* Fix diff + rls code editor

* Add placeholder message after sending prompt

* Small style

* RLSCodeEditor hit tab if empty to populate placeholder text

* Light mode nudeges

* Update logic for when confirmation close modal should show

* Set render overview ruler as false for rls diff editor

* improve chat UX to make it smoother (thank you alaister for your help 🙏)

* Dynamically do keepPreviousData

* Gracefully handle errors for add prompt

* Use animated ai icon while message is loading

* using Sheet component

* Address commernts

* Bit more improvements

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
Co-authored-by: Jonathan Summers-Muir <MildTomato@users.noreply.github.com>
2023-11-29 17:12:50 +08: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