fix(ui): pre-fill bundled-demo MinIO defaults on storage-type change#37
Merged
Conversation
Picking MinIO from the dropdown only updated the endpoint placeholder, not the value. First-time users left the field blank, the backend defaulted to s3.amazonaws.com, and AWS rejected the demo creds with 403 — turning the click-through demo into a dead-end. Now: when MinIO is selected, fill any empty endpoint / accessKey / secretKey / tablePath with the bundled-demo defaults that mirror GET /api/demo/connection. The setIfEmpty helper guarantees we never overwrite a value the user has typed. Also fixes a pre-existing copy bug: the AWS S3 endpoint placeholder showed 's3://bucket/path/to/table' (which is a *table* path, not an endpoint). Closes #35
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #35.
Before
Picking MinIO from the storage-type dropdown only updated the endpoint placeholder, not the field value. A first-time user who didn't notice the placeholder/value distinction left endpoint blank, the backend defaulted to `s3.amazonaws.com`, and AWS rejected the demo creds with 403. The "click around the bundled demo" path was a dead end.
After
When MinIO is selected, any empty field in {endpoint, accessKey, secretKey, tablePath} is filled with the bundled-demo defaults that mirror `GET /api/demo/connection`:
The two-line
setIfEmptyhelper guarantees we never overwrite a value the user has typed — switching to MinIO out of curiosity after typing AWS S3 creds keeps the typed creds intact.Also fixes a pre-existing copy bug spotted along the way: the AWS S3 endpoint placeholder was `s3://bucket/path/to/table`, which is a table path, not an endpoint. Now: `s3.amazonaws.com (leave blank for AWS default)`.
Verified end-to-end (headless Chrome via DevTools Protocol)
Two-click demo path — fresh page → pick MinIO → click Test Connection (no typing):
→
Connection successful. tableInfo panel: Format iceberg-v2 | Rows 37,537 | Files 1 | Last snapshot 7m ago. Suggested query auto-loaded into editor.No-clobber — fresh page → type custom S3 endpoint/path/keys → pick MinIO from dropdown:
→ All four typed values preserved exactly as entered. The pre-fill no-ops on every field because none was empty.