Commit Graph
251 Commits
Author SHA1 Message Date
Sean Oliver 723054e96e prettier 2025-10-14 12:50:13 -07:00
Sean Oliver 81ddc5d60c Clean up table quickstart implementation
- Remove unnecessary custom streaming headers (X-AI-Stream-*)
- Improve type safety (replace any with unknown, add type guards)
- Remove unused code (modelError variable, isForeign/references properties)
- Remove obvious comments that don't add value
- Move MAX_RETRIES to top-level constant
- Remove hardcoded toast durations
2025-10-14 11:59:09 -07:00
Sean Oliver 95cf6ebc77 remove custom headers (not used) 2025-10-14 10:44:56 -07:00
Sean Oliver b5a97225c8 Simplify table quickstart API endpoint
Remove unnecessary abstraction layers and dead code:
- Combine handler and handlePost into single function
- Remove shouldStream function and non-streaming path
- Always stream responses (only path client uses)
- Clean up imports in TableEditor
2025-10-14 10:37:22 -07:00
Sean Oliver c10c075ca4 Remove foreign key handling from table quickstart
- Remove isForeign and references fields from Zod schema
- Remove relationships from TableSchema
- Update system prompt to not generate foreign key constraints
- Remove TableRelationship type and relationships from TableSuggestion
- Clean up all FK handling in conversion logic
- Simplify getColumnDescription to only handle primary keys
2025-10-14 10:22:42 -07:00
Sean Oliver 8ab841e6c0 Fix AI icon layout and add loading animation to Generate button
- Display icons inline with text using flex layout in quick ideas
- Pass loading prop to Generate button icon for animated state during generation
- Quick ideas icons remain static (no loading animation)
2025-10-14 10:07:41 -07:00
Sean Oliver 9e13573770 Replace Wand2 icon with AI Assistant icon for visual consistency 2025-10-14 09:56:43 -07:00
Sean Oliver b12ee0d5fb Replace hasTables gate with isRecentProject (7-day) gate to match master 2025-10-14 09:45:23 -07:00
Sean Oliver ad01244349 Merge remote-tracking branch 'origin/master' into feat/table-quickstart-view-system
# Conflicts:
#	apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.tsx
#	apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableQuickstart/TableTemplateSelector.tsx
#	apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableQuickstart/constants.ts
#	apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableQuickstart/types.ts
2025-10-14 09:41:48 -07:00
Sean Oliver e1703d4429 feat: add basic table template infrastructure (1 of 3) (#38933)
* Use useLocalStorage hook for quickstart dismiss state

* Standardize varchar to text and remove local storage keys

* Remove gen_random_uuid() defaults from templates

* feat(studio): flatten table quickstart selector; show for any new table\n\n- Flattened category→template flow into single-step with category chips\n- Removed first-table-only guard so panel appears for all new tables when flag is on

* add comments to clarify diff btwn false and undefined in feature flag response type

* refactor: improve performance and type safety in table quickstart

- Memoize categories and displayed templates to prevent unnecessary re-renders
- Use generic type parameter instead of type assertion for feature flag
- Simplify dismiss handler with inline function
- Add JSDoc comment explaining feature flag return states

* Mark variant param as intentionally unused for future PR

* chore: clean up unused import in TableEditor

Remove unused useTablesQuery import after switching to localStorage-based dismissal.

* add 7 day project creation gate and fixed uuid default

* Improve table template selector UX with success feedback and clearer copy

- Add success toast when template is applied
- Update heading from "Quickstart: choose a template" to "Start faster with a table template"
- Improve subheading to explain time-saving benefit
- Use monospace font for table names to match code convention
- Update template rationales to be more descriptive and specific
- Increase font sizes for better readability
- Remove redundant category display
- Reorder imports alphabetically

* Apply prettier formatting to TableTemplateSelector
2025-10-14 16:12:36 +00:00
Sean Oliver a71326fdeb Remove redundant query parameters from streaming API
Headers alone are sufficient to determine streaming behavior.
2025-10-13 17:38:21 -07:00
Sean Oliver c4eda1d987 Add ARIA labels for better accessibility
Add aria-label and aria-pressed attributes to interactive elements for screen reader support.
2025-10-13 17:34:40 -07:00
Sean Oliver 76091696d3 refactor: clean up AI table generation code for production readiness
- Improve error messages with more user-friendly language
- Convert all functions to arrow functions for consistency
- Extract duplicate logic into helper functions (isPrimaryColumn, getColumnDescription)
- Remove unnecessary try-catch wrapper
- Simplify user-facing copy for better clarity
- Align coding patterns with project conventions
2025-10-13 17:09:50 -07:00
Sean Oliver 19a5aa00de Improve table generation performance and reliability
- Switch from OpenAI gpt-5-mini to AWS Bedrock gpt-oss-120b-1:0 for faster response times (~5s vs ~67s)
- Update Zod schema to handle model's inconsistent output formats (relationships can be array or object)
- Add automatic retry logic for intermittent empty model responses
- Improve error messages for better user experience
- Clean up validation logic and remove verbose logging
2025-10-13 16:54:37 -07:00
Sean Oliver d2c5ccd5ef Simplify table quickstart UX by consolidating variants into single view
- Restore simple templates variant with category tabs (no dropdown navigation)
- Add AI variant with direct input field and quick idea chips
- Remove complex multi-view navigation system
- Delete 5 unnecessary component files (Initial/Category/AIInput/Results/Shared)
- Remove ViewMode enum from types
- Consolidate all logic into single TableTemplateSelector component
2025-10-13 10:43:48 -07:00
Alaister Young d30e4d3aa0 chore(studio): custom docs rls guide path (#39480)
* chore(studio): custom docs rls guide path

* required keys
2025-10-13 19:20:31 +08:00
Sean Oliver 767e646f68 clear unneeded comment 2025-10-10 17:13:39 -07:00
Sean Oliver c140b78836 Fix critical bugs and simplify view rendering
- Fix stale closure bug in quick ideas (was completely broken)
- Fix memory leak in useAITableGeneration hook
- Remove all 'any' types, add proper TypeScript definitions
- Add runtime null checks to prevent crashes
- Use LIMITS constants throughout instead of hardcoded values
- Consolidate error state management (use apiError directly)
- Add input validation to Enter key handler
- Simplify view rendering with straightforward if/else instead of over-engineered viewConfig map
2025-10-10 17:12:12 -07:00
Sean Oliver 87e0e43cbb feat: add AI generation feature for table quickstart (3 of 4)
- Add useAITableGeneration hook for AI-powered table generation
- Implement AI input view with prompt handling and quick ideas
- Add API endpoint for generating table schemas with OpenAI
- Extend view configuration to support AI-specific views
- Update feature flag to support both 'templates' and 'ai' variants
- Add error handling and loading states for AI generation
2025-10-10 16:11:29 -07:00
Sean Oliver d67f5c15ae feat: add view system and UI polish for table templates (2 of 4)
- Refactor TableTemplateSelector to use view configuration pattern
- Add viewConfig system for managing different UI states
- Create separate view components (InitialView, CategoryView, ResultsView)
- Improve UI polish with better styling and transitions
- Add ViewMode enum and ViewState interface for state management
2025-10-10 16:10:43 -07:00
Sean Oliver ad7f30637b Apply prettier formatting to TableTemplateSelector 2025-10-10 16:00:28 -07:00
Sean Oliver f98516872e Improve table template selector UX with success feedback and clearer copy
- Add success toast when template is applied
- Update heading from "Quickstart: choose a template" to "Start faster with a table template"
- Improve subheading to explain time-saving benefit
- Use monospace font for table names to match code convention
- Update template rationales to be more descriptive and specific
- Increase font sizes for better readability
- Remove redundant category display
- Reorder imports alphabetically
2025-10-10 16:00:28 -07:00
Sean Oliver e9472b49ea add 7 day project creation gate and fixed uuid default 2025-10-10 16:00:28 -07:00
Sean Oliver e5cef29abc chore: clean up unused import in TableEditor
Remove unused useTablesQuery import after switching to localStorage-based dismissal.
2025-10-10 16:00:28 -07:00
Sean Oliver ec0e1e7d63 Mark variant param as intentionally unused for future PR 2025-10-10 16:00:06 -07:00
Sean Oliver e4296e0432 refactor: improve performance and type safety in table quickstart
- Memoize categories and displayed templates to prevent unnecessary re-renders
- Use generic type parameter instead of type assertion for feature flag
- Simplify dismiss handler with inline function
- Add JSDoc comment explaining feature flag return states
2025-10-10 16:00:06 -07:00
Sean Oliver 236a31706a add comments to clarify diff btwn false and undefined in feature flag response type 2025-10-10 16:00:06 -07:00
Sean Oliver 8050ca6e0b feat(studio): flatten table quickstart selector; show for any new table\n\n- Flattened category→template flow into single-step with category chips\n- Removed first-table-only guard so panel appears for all new tables when flag is on 2025-10-10 16:00:06 -07:00
Sean Oliver acd32c68c0 Remove gen_random_uuid() defaults from templates 2025-10-10 16:00:06 -07:00
Sean Oliver 1baab74aa7 Standardize varchar to text and remove local storage keys 2025-10-10 16:00:06 -07:00
Sean Oliver 9d2f859b59 Use useLocalStorage hook for quickstart dismiss state 2025-10-10 16:00:06 -07:00
Pamela Chia 5b2351da86 Add tracking for API docs usage (#39307) 2025-10-08 08:58:15 -04:00
54ad0b7495 Chore/ai realtime (#39145)
* update onboarding

* update model and fix part issue

* action orientated assistant

* fix tool

* lock

* remove unused filter

* fix tests

* fix again

* update package

* update container

* fix tests

* ai realtime

* ai realtime

* refactor(ai assistant): break out message markdown and profile picture

* wip

* refactor(ai assistant): break up message component

* refactor: break ai assistant message down into multiple files

* add limitations prompt

* limitations prompt

* link prompt

* refactor: simplify ReportBlock state

* fix: styling of draggable report block header

When the drag handle is showing, it overlaps with the block header.
Decrease the opacity of the header so the handle can be seen and the two
can be distinguished.

* fix: minor tweaks to tool ui

* refactor: simplify DisplayBlockRenderer state

* fix: remove double deploy button in edge function block

When the confirm footer is shown, the deploy button on the top right should be
hidden (not just disabled) to avoid confusion.

* refactor, test: message sanitization by opt-in level

Refactor the message sanitization to have more type safety and be more testable.
Add tests to ensure:

- Message sanitization always runs on generate-v4
- Message sanitization correctly works by opt-in level

* Fix conflicts in pnpm lock

* Couple of nits and refactors

* Revert casing for report block snippet

* adjust sanitised prompt

* Fix tests

* empty states

* prompt otpimise

* refine prompt

* prompt optimizer

* remove realtime for now

* Update apps/studio/lib/ai/prompts.ts

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>

* Update apps/studio/lib/ai/prompts.ts

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>

* updates

* feature flag

* use flag and additional check

* remove sort

* messages copy

---------

Co-authored-by: Charis Lam <26616127+charislam@users.noreply.github.com>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-10-06 10:31:40 +10:00
Charis faa5066bdb fix(column editor): cannot read properties of null (#39244)
Another instance of types not matching reality, we have a check for undefined, but this is sometimes coming out null.
2025-10-03 16:06:42 -04:00
Sean Oliver e978a084b2 feat: add table activation tracking (#39090)
Add telemetry tracking for activation-related table operations
- Implement SQL event parser to detect table creation, data insertion, and RLS enablement
- Add telemetry tracking for these operations in table editor as well
- Add test coverage for SQL event parser
2025-10-01 14:54:51 -07:00
matlin cd6082be36 Ensure CSV chunk uploads handle rate limit 409s (#39075)
* Ensure CSV chunk uploads handle rate limit 409s

* Let executeWithRetry work with ResponseError object
2025-09-29 13:59:14 -05:00
5f533247e1 Update docs url to env var (#38772)
* Update Supabase docs URLs to use env variable

Co-authored-by: a <a@alaisteryoung.com>

* Refactor: Use DOCS_URL constant for documentation links

This change centralizes documentation links using a new DOCS_URL constant, improving maintainability and consistency.

Co-authored-by: a <a@alaisteryoung.com>

* Refactor: Use DOCS_URL constant for all documentation links

This change replaces hardcoded documentation URLs with a centralized constant, improving maintainability and consistency.

Co-authored-by: a <a@alaisteryoung.com>

* replace more instances

* ci: Autofix updates from GitHub workflow

* remaining instances

* fix duplicate useRouter

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: alaister <10985857+alaister@users.noreply.github.com>
2025-09-26 10:16:33 +00:00
matlinandCharis Lam 172f6ba5fc Improve stability and explicitness of table editor tab state syncing between URL params and local storage (#38931)
* Improve stability and explicitness of table editor tab cache <-> url syncing

* fix: maintain filter state when using nav bar to switch back to Table Editor

---------

Co-authored-by: Charis Lam <26616127+charislam@users.noreply.github.com>
2025-09-23 13:03:56 -05:00
Joshen Lim c892a7721a Fix new table button not working if on unknown table in table editor (#38891) 2025-09-22 12:14:23 +07:00
hallidayo 789af2d535 feat: show toast if table name blank (#28172)
* show toast if table name blank

* type toasts
2025-09-18 20:19:55 +00:00
Joshen Lim d46525eac1 Chore/swap use check permissions with use async check project permissions part 8 (Season Finale) (#38619)
* Update perms checking in audit logs

* Deprecate useCheckPermissions, useIsPermissionsLoaded and useCheckProjectPermissions as they're no longer used

* Rename useAsyncCheckProjectPermissions to useAsyncCheckPermissions

* Fix TS
2025-09-16 17:05:57 +08:00
Joshen Lim 466760099d Support opening table rows for foreign tables in side panel (read only) (#38699)
* Support opening table rows for foreign tables in side panel (read only)

* Fix TS
2025-09-16 11:54:03 +08:00
Joshen Lim 6a1c3390e1 Fix default value placeholder for fields with foreign keys (#38693) 2025-09-15 18:17:44 +08:00
Joshen LimandJordi Enric deda982074 Chore/refactor dashboard history logic (#38586)
* Shift dashboard history logic outside of app state, into its own hook

* Self remediate malformed history for sql editor

* Update apps/studio/hooks/misc/useDashboardHistory.ts

Co-authored-by: Jordi Enric <37541088+jordienr@users.noreply.github.com>

* Update apps/studio/hooks/misc/useDashboardHistory.ts

Co-authored-by: Jordi Enric <37541088+jordienr@users.noreply.github.com>

---------

Co-authored-by: Jordi Enric <37541088+jordienr@users.noreply.github.com>
2025-09-10 22:19:08 +08:00
Joshen Lim bc3a473170 Swap useCheckPermissions with useAsyncCheckProjectPermissions Part 6 (#38559)
More swapping
2025-09-10 11:26:26 +08:00
TaishiandCharis 9eb7b64ec4 Show an error message with a row number when a user uploads CSV file with an issue (#38422)
* change the location of importing SpreadsheetImportPreview component

* Refactor error handling in SpreadsheetImport components

- show the row number with an issue to give users more actionable message
- show only the first error since Papaparse has an issue for row value in errors array

* Refactor error message for spreadsheet import alerts

* Remove items from `results.errors` with duplicate row and code values

* add comment

* Update error badge to show dynamic issue count

* Make errors stand out

* Refactor import/export for SpreadsheetImportPreview component

* Refactor import statements for SpreadsheetImport component

* use size-[value] class

* Refactor error handling to remove duplicates in preview

* Make only items with details clickable

* use proper list element

* use `button` element for clickable items

* add transition for transform

---------

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>
2025-09-09 22:30:23 +00:00
Joshen Lim f066c02c69 Shift refresh button to header in table editor and make realtime + API docs button smaller (#38463)
* Shift refresh button to header in table editor and make realtime button + api docs button smaller

* Fix ts
2025-09-08 14:15:39 +08:00
Taishi e5a26a9202 【CSV file import】Ensure onChange fires when the same file is uploaded twice (#38440)
Reset `event.target.value` to ensure onChange fires when the same file is uploaded twice
2025-09-05 15:35:01 +00:00
Joshen Lim a90bc51be1 Fix table editor incorrectly showing type change notice for foreign key (#38404)
* Fix table editor incorrectly showing type change notice for foreign key

* nit

* remove log
2025-09-04 15:35:36 +07:00
hallidayoandCharis Lam 25af9fa6d3 fix: add apostrophe for sql export (#37920)
* add apostrophe for sql export

* refactor: move quote escape logic to common util

---------

Co-authored-by: Charis Lam <26616127+charislam@users.noreply.github.com>
2025-09-03 16:59:18 -04:00