Commit graph

30 commits

Author SHA1 Message Date
Simon Willison
557e08c6ef Make binary playwright test more robust
Failed here: https://github.com/simonw/datasette/actions/runs/28746832371/job/85239037361
2026-07-05 22:46:00 -07:00
Simon Willison
7ab8b644a7 Merge remote-tracking branch 'origin/main' into edit-blobs
# Conflicts:
#	docs/changelog.rst
#	tests/test_playwright.py
2026-07-03 17:25:41 -07:00
Simon Willison
19dde1c860 Support BLOB values in row edit UI 2026-07-03 16:09:27 -07:00
Simon Willison
2bcabd8e1f Harden Playwright server startup wait
Allow the Datasette subprocess more time to become reachable under CI load.

If startup still times out, terminate the process and include stdout and stderr in the assertion so future failures have useful diagnostics.
2026-07-03 12:57:36 -07:00
Simon Willison
8f32a8f134 Fix bulk insert Playwright expectations
Keep copied spreadsheet templates aligned with the single-row insert columns while still previewing auto primary keys in bulk insert rows.

Treat invalid JSON during live bulk-insert validation as unfinished input so Firefox does not expose browser-specific parse errors while typing.
2026-07-03 12:47:22 -07:00
Simon Willison
3aea678eab Show auto primary keys in bulk insert preview
Render omitted auto integer primary key values as muted auto text in the bulk insert preview so generated IDs are easier to understand.

Expose the auto primary key flag in insert UI metadata and cover the preview behavior in Playwright.
2026-07-03 12:27:02 -07:00
Simon Willison
c864bc866d Add bulk insert upsert controls
Expose conflict handling in the bulk insert UI when pasted rows include primary key columns, and route update-or-insert selections through the existing upsert API.

Add live validation for bulk textarea column errors and Playwright coverage for upsert permissions, conflict options, and validation behavior.

Refs shttps://github.com/simonw/datasette/pull/2813#issuecomment-4878320713
2026-07-03 10:44:36 -07:00
Simon Willison
4a39e44eb6 Preserve numeric inference for blank CSV values
Convert blank delimited cells to null when create-table-from-data inferred an integer or float column. This keeps sqlite-utils from treating mixed numeric and empty-string values as text.

Add a Playwright regression covering CSV table creation with a blank numeric value.
2026-07-03 09:53:57 -07:00
Simon Willison
4bd9d41c43 Preserve SQLite defaults in bulk insert
Omit columns that are absent from pasted bulk insert data so SQLite defaults can fire during insert. Keep preview cells blank for omitted values while preserving explicit null rendering.

Refs [https://github.com/simonw/datasette/pull/2813#issuecomment-4878063728](https://github.com/simonw/datasette/pull/2813#issuecomment-4878063728)
2026-07-03 09:45:34 -07:00
Simon Willison
b759ea5486 Mock navigator.clipboard so Playwright passes in all three browsers 2026-06-29 17:38:51 -07:00
Simon Willison
9ec42b2dad Improvements to create table from data 2026-06-29 16:02:56 -07:00
Simon Willison
e0a138ffbd Tweaks to bulp insert screen
Moved text around, added clickable 'open a file' button for mobile.

Screenshot: https://github.com/simonw/datasette/pull/2813#issuecomment-4837736664
2026-06-29 15:17:19 -07:00
Simon Willison
7ae601588e Create table from data feature
Similar to insert rows from JSON/CSV/TSV
but it creates a brand new table instead.
2026-06-25 22:32:47 -07:00
Simon Willison
b7a896a803 Insert multiple rows feature in the insert dialog
Works entirely using existing JSON API.

User can paste in CSV, TSV or JSON (or drop a text file on).

They get a preview of the rows to be imported, then they
are imported in max_insert_rows batches.
2026-06-25 22:02:39 -07:00
Simon Willison
b932d0dc78 current_unixtime and current_unixtime_ms default_expr options
Plus tweaked how alter table changing those works a bit.
2026-06-22 13:42:35 -07:00
Simon Willison
2ebae5ed71 Add rename table controls to alter table dialog
Add a collapsed rename-table section to the alter table modal and include rename_table operations in the review/apply flow.

Redirect to the renamed table URL after applying changes and cover the review text in Playwright.
2026-06-22 12:51:23 -07:00
Simon Willison
fa43aba309 Unify create and alter table modal controls
Share default value controls between the create and alter table dialogs and expose create-table default expressions to the frontend.

Add create-table not-null/default handling and align the shared foreign key picker behavior across both dialogs.
2026-06-22 12:50:57 -07:00
Simon Willison
dada4de172 Fix for Safari select box heights
Refs https://github.com/simonw/datasette/pull/2789#issuecomment-4772241681
2026-06-22 12:35:34 -07:00
Simon Willison
b02999bca6 Fix broken Playwright tests 2026-06-22 10:11:56 -07:00
Simon Willison
4115213e17 Precompute action permissions for table pages
- Extract reusable helpers for database and table action permission preloading.
- Precompute those permissions before building table-page HTML data.
- Document the default table actions plugin.
2026-06-22 10:11:56 -07:00
Simon Willison
fdd1b61a3e Add alter table modal
- Register a built-in table action and expose alter-table metadata to table pages.
- Build the client-side modal for editing columns, defaults, ordering, primary keys, and custom column types.
- Add a review/apply confirmation flow with HTML and Playwright coverage.

Refs #2788
2026-06-22 10:11:56 -07:00
Simon Willison
2d3c85dfc0 Add create table UI
Adds a permission-gated database action that opens a create table modal on database pages, backed by the existing create-table JSON API.

The modal starts with an id integer primary key column plus a blank text column, supports SQLite type selection, and shows custom column type controls only when the actor can set column types.

Selected custom column types are applied after table creation with follow-up set-column-type API calls. Includes styling plus HTML and Playwright coverage for the action payload and create-table flow.
2026-06-22 10:11:56 -07:00
Simon Willison
3edc98a871 Playwright tests exercise the real UI now
Refs https://github.com/simonw/datasette/pull/2785#issuecomment-4723583959
2026-06-16 14:13:44 -07:00
Simon Willison
a8124172dd Remove load_edit_tools(), use a new fixture instead
Refs https://github.com/simonw/datasette/pull/2785/changes#r3423913454
2026-06-16 13:54:00 -07:00
Simon Willison
387e309b3b Port JSON column field test to Playwright
Refs #2779
2026-06-14 16:49:30 -07:00
Simon Willison
3cfdca026a Port edit tools field API test to Playwright
Refs #2779
2026-06-14 16:48:32 -07:00
Simon Willison
b5fa485a9f Port datasette manager plugin test to Playwright
Refs #2779
2026-06-14 16:45:48 -07:00
Simon Willison
6bbd33d81d Port navigation jump sections to Playwright
Refs #2779
2026-06-14 16:44:59 -07:00
Simon Willison
047b69e87f Port navigation search recents to Playwright
Refs #2779
2026-06-14 16:44:17 -07:00
Simon Willison
6cd65cf4fb Initial Playwright setup plus first test
Refs #2779
2026-06-14 16:39:55 -07:00