Skip to content

Custom data: edit an upload with a reviewed diff, Add data dialog, dataset notes (re-land of #74) - #76

Merged
alisman merged 2 commits into
masterfrom
session/customdata
Oct 26, 2026
Merged

alisman merged 2 commits into
masterfrom
session/customdata

Conversation

@alisman

@alisman alisman commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Re-lands #74, which never reached master. #74 was stacked on #72, and it was merged into session/saved-manager after #72 had already merged. GitHub doesn't retarget a PR whose base branch still exists, so these commits stayed on that branch.

These are the same two commits, rebased onto master. The only conflict was the migration list in test/postgres.db-test.ts, which now holds both 0008_custom_dataset_note.sql and 0009_app_role.sql.

What changes (as in #74)

  • Edit…: opens a full-screen editor. You can change values in a table, or merge in a file or pasted table.
    • An edit only adds or updates: rows whose id already exists show old → new, new ids are added, and nothing is removed. The server refuses a version that drops a row or column.
    • Every change is reviewed before it is saved as the next version. Cancel is available at every step.
  • Add data: a primary button under Uploads that opens a dialog.
  • Dataset note (migration 0008):
    • set when data is added, edited in the editor, and shown in the list;
    • changing only the note saves it without making a new version.

Database

Testing

  • npm test: 1656 pass. npm run test:db: 66 pass. tsc and eslint are clean.
  • CI runs the full gate.

🤖 Generated with Claude Code

https://claude.ai/code/session_015GhQZmcBkFwS6zSB7KbapX

alisman and others added 2 commits October 26, 2026 17:53
…fter its changes are reviewed

Saved work → Custom data gains "Edit / replace…" on each upload the reader may edit. It opens the
latest version as editable text (or takes a replacement file), matched against that dataset's own
studies, and saving adds the next version; earlier versions and analyses pinned to them are untouched.

Before any save that adds a version — this one, or an Explore upload whose name is already stored,
which used to become a new version silently — the page shows what changes from the latest version
(lib/custom-data-diff.ts): cases removed and added, columns removed, added and retyped, per column
the values changed, cleared and filled in with examples, studies gained or lost, a rename; and every
change as a downloadable TSV. Numbers compare as numbers and row order does not matter, so an
export re-uploaded is "no changes" and cannot be saved. A change that removes or overwrites
anything needs a confirming tick; additions alone do not.

The server holds the same line: a new version names the version it was compared against
(baseVersion) and is refused (409) when that is no longer the latest, so a version saved by someone
else in between is never replaced unseen, and refused when it is the same data again.

Verified: unit tests for the diff; store contracts (stale base, same data, shared editors) on
PGlite; in a browser, a 200-patient upload edited (one patient removed, one value changed, one
cleared, a column added) showed exactly those changes, blocked the save until ticked, and listed v2;
unchanged text reported no changes with saving disabled; no console errors. Gate passed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015GhQZmcBkFwS6zSB7KbapX
…edits and a dataset note

- Edit… opens a full-screen editor: change values in a table or merge a file or pasted table, then
  review every change before saving it as the next version. Cancel at every step; the review is the
  confirmation.
- An edit only adds or updates: rows whose id matches show what changes, new ids are added, nothing
  is removed. The server refuses a version that drops a row or column.
- Add data is a primary button under Uploads and opens a dialog for the upload steps.
- A dataset has a note (migration 0008), set when it is added and shown in the list. Changing only
  the note saves it without a new version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015GhQZmcBkFwS6zSB7KbapX
@vercel

vercel Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cbiolab-genie Ready Ready Preview Oct 26, 2026 5:59pm UTC
cohort-lab Ready Ready Preview Oct 26, 2026 5:59pm UTC

Request Review

@alisman
alisman merged commit 3d23887 into master Oct 26, 2026
10 checks passed
@alisman
alisman deleted the session/customdata branch October 26, 2026 19:29

This branch was successfully deployed

1 active deployment
Preview – cohort-lab — 6dc84d1a Deployed Oct 26, 2026 by vercel[bot]
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.

1 participant