diff --git a/.changeset/docs-clarity-and-validated-readme.md b/.changeset/docs-clarity-and-validated-readme.md new file mode 100644 index 0000000..f88baa2 --- /dev/null +++ b/.changeset/docs-clarity-and-validated-readme.md @@ -0,0 +1,9 @@ +--- +"frontend": patch +--- + +In-browser validation now checks the dataset the user actually downloads. The zip has always shipped placeholder `README.md` and `CHANGES.md`, but the validator never saw them, so every run reported `MISSING_README_DOC` / `MISSING_CHANGES_DOC` for documents the download does contain — and the Review step carried a note explaining the false alarm away. The validator is now handed the same two files (both Psych-DS rules are presence-only, so this is an honest check, not a suppression), the warnings no longer appear, and the note is gone. Their content lives once in `datasetLayout.ts`, shared with the zip builder so the two can't drift. Saving only `dataset_description.json` produces no such files, so those warnings correctly still appear there. + +Review also no longer points at `npx @jspsych/cli validate` — a package that does not exist on npm, with a subcommand the metadata CLI never had. Since validation now covers the whole downloaded project, the re-validation block was removed rather than corrected. + +Wizard copy was rewritten throughout for researchers rather than developers: plainer field hints (`URL or SPDX identifier` → `A standard license name like CC-BY-4.0, or a link to the license text`), `@type` relabelled **Author type** and `Privacy policy` **Sharing restrictions** (both still naming the underlying JSON key), errors that say what to do next, no raw exception text in the file list, and a processing summary that reports outcomes (`Finished. 3 files read, 1 skipped.`) instead of counting skipped and failed files as processed. Destructive confirmations now state that files on disk are untouched. diff --git a/docs/dev/frontend-architecture.md b/docs/dev/frontend-architecture.md index b0dc0d5..06f63c9 100644 --- a/docs/dev/frontend-architecture.md +++ b/docs/dev/frontend-architecture.md @@ -148,7 +148,7 @@ The result is a `convertedFiles` map (dataset-relative path → contents) carrie **Network is required** — the validator fetches the Psych-DS schema and schema.org context at runtime. If it can't run, `validatePsychDS` throws `ValidationUnavailableError` with a connectivity-first message (underlying error appended), which Review surfaces as an `unavailable` banner rather than a false "invalid" result. -**Zip-resolved warnings:** the in-browser validator only sees the metadata + data files, so it reports `MISSING_README_DOC` / `MISSING_CHANGES_DOC`. The downloaded zip ships `README.md` and `CHANGES.md`, so Review (`ZIP_RESOLVED_WARNINGS`) shows a reassurance note explaining these clear once the downloaded dataset is validated. A `
` block also documents the CLI equivalent (`npx @jspsych/cli validate`). +**Validate what gets downloaded:** the zip ships placeholder `README.md` / `CHANGES.md`, so the validator is handed the same two files and `MISSING_README_DOC` / `MISSING_CHANGES_DOC` never fire against a project that will contain them. Both Psych-DS rules are presence-only (stem + extension at the dataset root), so this is an honest check rather than a suppression. Content lives in `datasetLayout.ts` (`datasetDocs()`), shared by `datasetZip.ts` and `validatePsychDS.ts` so the two cannot drift. Review passes the project name only when `hasDataFiles` — with no data there is no zip, so those warnings are real advice about the user's own folder and must still surface. > The core `@jspsych/metadata` library does **not** validate — validation is a consuming concern owned by the frontend (here) and the CLI (`packages/cli/src/validatefunctions.ts`). Unit tests for these helpers are tracked in issue #94. diff --git a/packages/frontend/README.md b/packages/frontend/README.md index 471fa49..6f36f66 100644 --- a/packages/frontend/README.md +++ b/packages/frontend/README.md @@ -99,7 +99,7 @@ Inspect the generated `dataset_description.json` and download your project: ``` - If no data files were uploaded, a **Save `dataset_description.json`** button is shown instead. - **Validate dataset** runs the Psych-DS validator entirely in your browser and lists any errors and warnings inline, each with the underlying rule key and the specific files/columns at fault. An internet connection is required — the validator fetches the Psych-DS schema and schema.org context at runtime. - - Because in-browser validation only sees your metadata and data files, it may report missing `README` / `CHANGES` warnings. These are expected: the downloaded zip already includes `README.md` and `CHANGES.md`, so they clear when you validate the downloaded dataset (e.g. with `npx @jspsych/cli validate`). + - The check covers exactly what the zip will contain, including its placeholder `README.md` and `CHANGES.md`, so there is no need to re-validate after downloading. Saving only `dataset_description.json` produces no such files, and missing `README` / `CHANGES` warnings then correctly appear. The **{} Preview** pill button (visible on all steps except Review) opens a live JSON snapshot in a slide-in drawer so you can check the output at any point without leaving the current step. diff --git a/packages/frontend/src/components/PreviewDrawer.tsx b/packages/frontend/src/components/PreviewDrawer.tsx index ebeba00..79784f9 100644 --- a/packages/frontend/src/components/PreviewDrawer.tsx +++ b/packages/frontend/src/components/PreviewDrawer.tsx @@ -37,7 +37,7 @@ const PreviewDrawer: React.FC = ({ jsPsychMetadata, onClose onClick={handleClick} >
- JSON Preview + JSON preview
diff --git a/packages/frontend/src/components/Sidebar.tsx b/packages/frontend/src/components/Sidebar.tsx index 5aad092..b77ddbb 100644 --- a/packages/frontend/src/components/Sidebar.tsx +++ b/packages/frontend/src/components/Sidebar.tsx @@ -110,7 +110,8 @@ const Sidebar: React.FC = ({ >

Start over?

- All progress will be lost and you'll return to the welcome screen. + This clears the data you uploaded and everything you've entered, and takes you back to + the start screen. Your own files on disk are not touched.