Skip to content

Add design document for user-scoped change groups#2

Closed
simonw wants to merge 1 commit intomainfrom
claude/design-change-groups-NV5yB
Closed

Add design document for user-scoped change groups#2
simonw wants to merge 1 commit intomainfrom
claude/design-change-groups-NV5yB

Conversation

@simonw
Copy link
Contributor

@simonw simonw commented Feb 9, 2026

Propose a design for a feature that allows users who are signed in to set up a change group which any of their changes will be added to as they navigate the site

I’m thinking they can start a change group with a required note - this gets added to the table with current set to null, and the id of that group is saved in a cookie for that user

The challenge then becomes how to set cure t = 1 on that record but only for transactions that are started by that specific actor - we don’t want other users using the site at the same time to have their changes accidentally added to that group

Check the docs for sqlite-history-json for details on how that works

Proposes how signed-in users can start a change group (with a required note) so that all their edits are tagged with that group as they navigate the site. Covers the core concurrency challenge (the current=1 signal in sqlite-history-json is global) and a solution that wraps execute_write_fn to activate/deactivate the group within each atomic write callback.

Also proposes changes to Datasette itself — most importantly a wrap_write plugin hook and threading request context into write paths — that would eliminate the need for monkey-patching.

https://claude.ai/code/session_01PGyxWeZRNxTsmw7S8ZYGyC

Proposes how signed-in users can start a change group (with a required
note) so that all their edits are tagged with that group as they
navigate the site. Covers the core concurrency challenge (the current=1
signal in sqlite-history-json is global) and a solution that wraps
execute_write_fn to activate/deactivate the group within each atomic
write callback.

Also proposes changes to Datasette itself — most importantly a
wrap_write plugin hook and threading request context into write paths —
that would eliminate the need for monkey-patching.

https://claude.ai/code/session_01PGyxWeZRNxTsmw7S8ZYGyC
@simonw
Copy link
Contributor Author

simonw commented Feb 9, 2026

@simonw
Copy link
Contributor Author

simonw commented Feb 9, 2026

Closing this PR because we don't need that proposed design document in our main branch.

@simonw simonw closed this Feb 9, 2026
@simonw
Copy link
Contributor Author

simonw commented Feb 9, 2026

This did however inspire a new Datasette experimental plugin hook, implemented here:

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.

2 participants