Repository navigation
Add table browsing and configless onboarding to the frontend - #1509
Merged
Merged
Conversation
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.
Fixes #1489
The
--frontendpage now opens on a useful start screen: the query root, a path-table guide with an editable example, the declared tables with their columns, and config-load diagnostics with restart guidance. Choosing a table loads a quoted, bounded preview query; nothing runs until Run.Choices
/frontend.js(loadState,renderState,previewQuery); the inline state script infrontend.htmlis gone. No new route, no server change: it reads the existingGET /frontend/stateonce on load and never opens/events.SELECT * FROM "<name>" LIMIT 100, the name always double-quoted with"doubled. Choosing a table only fills the SQL box and focuses it.content,'./'and'./**/*.md'examples, and a button that restores the starter query) shows in every ready state, so path queries stay available beside declared tables.tables: []), the page shows "No declared tables." With tables, it adds one line on anchoring: declared-table globs anchor at their config file's directory, while path-table queries use the query root.<pre>, and "Fix the configuration, stop this server (Ctrl+C), and restart it withdirsql server --frontend -c <config>." Other failures (non-503 status, unreachable): "Could not load the server state: ...". The path guide is hidden in both.textContent/append, neverinnerHTML. The test fake document moved totests/frontend/fake-document.mjsand is shared by both Node test files.Red/green
cli_e2e::frontend_script_offers_table_browsing_and_path_onboardingfailed with "loadState missing from the frontend script". On Windows,frontend_jsalso failed withSyntaxError: ... does not provide an export named 'loadState'frombrowse.test.mjs. Lint and unit tests passed.Hand exercise (real server, headless Chrome via agent-browser)
Built with
cargo build --release -p dirsql --features cliand randirsql server --frontend --port Nagainst fixtures in/tmp/m1489:plain/):curl /frontend/statereturned{"error":null,"root":"/tmp/m1489/plain","tables":[]}. The page showed the root, the seven columns,content, and "No declared tables." Run returned 1 row (a.txt). Afterecho new > c.txt, Run again returned 2 rows.cfg/,-c .dirsql.toml, withpostsand an empty"order"table with columns"select"and"two words"): both were listed with their columns and types. Choosingorderset the box toSELECT * FROM "order" LIMIT 100and ran nothing. Run returned "0 rows returned ...".postsreturned 1 row. After addingposts/two.json, Run again returned 2 rows from the index. The path example button restoredSELECT * FROM './' LIMIT 100, which then ran.fn/): the same start as configless.-c missing.toml: "Configuration could not load",failed to resolve missing.toml: No such file or directory (os error 2), and the restart line.E2E Verification
cargo test -p dirsql --features cli --test cli_e2e --test frontend_js --test cli_integration)packages/python/e2e-attestations/bot-1489-frontend-browse-1013.jsonreceipt writtenpackages/ts/e2e-attestations/bot-1489-frontend-browse-1013.jsonreceipt writtenuv run maturin develop --release;testing-conventions e2e attest 'uv run python -m pytest tests/e2e/cli_version_test.py tests/e2e/query_contract_test.py tests/e2e/fanout_test.py tests/e2e/extension_package_test.py -x -q'frompackages/python;testing-conventions e2e attest 'pnpm test:e2e'frompackages/ts; the gatedjust preflight(0 failing pairs).Changelog / Migrations
packages/rust/changelog.d/packages/rust/migrations.d/