Skip to content

Every source kind the UI offers can be created - #253

Merged
WaylandYang merged 1 commit into
devfrom
fix/every-source-kind-can-be-created
Sep 3, 2026
Merged

Every source kind the UI offers can be created#253
WaylandYang merged 1 commit into
devfrom
fix/every-source-kind-can-be-created

Conversation

@WaylandYang

Copy link
Copy Markdown
Contributor

Fixes #247.

The store's hand-written KINDS allowlist stopped at seven kinds while the sync dispatcher and the UI knew twelve, so s3, azure_blob, gcs, webdav and notion failed at creation with kind must be one of…. The table has no CHECK; the allowlist was the only gate.

One enum, three consumers. SourceKind in utopia-core (strum for the strings and the iteration) now yields the creation allowlist, and sync_source matches it exhaustively — a new kind without a sync decision is a compile error. The frontend's list lives once, in web/src/sourceKinds.ts, and feeds the create dialog, the SourceView type and the icon map (typed Record<SourceKind, …>, so a kind without an icon fails tsc). A store test reads that file and compares it to the enum, order included, so the three lists cannot drift apart again.

Verified in the isolated environment: all five kinds create through the API (secrets stripped from the response as of #249), an unknown kind lists the twelve, and the dialog creates a WebDAV source end to end.

0013 carries a revision note.

🤖 Generated with Claude Code

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@WaylandYang
WaylandYang merged commit 83099a7 into dev Sep 3, 2026
3 checks passed
@WaylandYang
WaylandYang deleted the fix/every-source-kind-can-be-created branch September 3, 2026 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Object storage, WebDAV and Notion sources cannot be created

1 participant