Commit Graph
194 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
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
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 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
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
Joshen Lim 143ec2d54e Small style fix (#38126) 2025-08-22 20:27:40 +08:00
Joshen LimandTerry Sutton 39639a4073 chore/disable-more-sections-03 (#38060)
* Add flags for policies, third party auth, and manual linking + providers in sign in page

* Add flag for rate limitm page

* Add UnknownInterface components

* Update comment

* Flip flags to true

* Add flags for realtime policies and reports page

* Temp

* Add flag for sign in providers page

* Add flag for stripe wrapper

* Add flag for custom domains

* Add flag for dedicated ipv4 address addon

* Add empty state for realtime policies

* Add empty state for reports page

* Add flag for disable legacy JWT keys section

* Add flag for legacy jwt keys

* nit

* Remove ConnectionStringMoved call out

* Add flag for project settings log drains

* Add flag for subscription link in project settings

* Deprecate settings/auth page and redirect directly to auth page

* Flip back flags

* Add flags for account preferences analytics marketing and account deleetion

* Remove 'table_editor:enable_rls_toggle' flag and revert UI changes

* Remove 'authentication:policies' flag and revert UI changes

* Update flags

---------

Co-authored-by: Terry Sutton <saltcod@gmail.com>
2025-08-20 21:50:53 +08:00
Alaister YoungandJoshen Lim 33bd798d14 feat: disable database features (#38019)
* feat: disable logs features

* feat: disable project homepage features

* feat: disable org features

* Nit fixes

* reenable billing

* feat: disable database features

* Rename creation_enable_rls_toggle to just enable_rls_toggle and apply it to GridHeaderActions

* Minor nits

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-08-19 12:52:00 +08:00
Joshen Lim 13d264a57c Fix CSV import for postgres array types (#37995)
* Fix CSV import for postgres array types

* Add test case
2025-08-19 12:39:08 +08:00
CharisandJoshen Lim e8a19faa03 feat: drop file to import data in Table Editor (#37888)
* feat: drop file to import data

In the Table Editor for an empty table, make the entire grid area a
dropzone so that files can be dropped onto the grid area for importing.
Dropping a file opens the SpreadsheetImport side panel with the dropped
file already loaded.

* refactor: drag and drop file import

Refactor logic into hooks and utility functions

* refactor: file drop import

Small changes caught in code review

* Opt to pass file through valtio store instead of event listener

* refactor: telemetry properties + cleaning up hook deps

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-08-13 11:32:06 -04:00
Joshen LimandJordi Enric 011f6c3e87 Fix Table Editor not identifying truncated array column values properly (#37683)
* Fix Table Editor not identifying truncated array column values properly

* Add comment

* update tests

* Fix TS issues and shift test file to beside the file its testing

* Fix tests

---------

Co-authored-by: Jordi Enric <jordi.err@gmail.com>
2025-08-06 11:11:14 +07: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 FletcherandJoshen Lim c76707012d basic typography classes (#37613)
* basic typography classes

* Clean up classes for where we use h1 tags

* Clean up classes for where we use h2, h3, h4

* Clean up classes for where we use h6

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-08-04 20:55:34 +10:00