When creating a new collection item, Keystatic currently redirects to the newly created item's edit page.
For some editorial workflows, it would be useful to optionally return to the collection list instead.
Example use case:
- editor opens a collection
- clicks "Add"
- fills the form
- clicks "Create"
- item is saved
- editor is returned to the collection list and can immediately add another item
In a real user test, staying on the newly created item's edit page caused confusion: the editor thought the form was ready for the next item and started editing the item that had just been created.
A collection-level option could perhaps look like:
afterCreate: 'item' | 'collection'
with the current behaviour remaining the default.
For my project, changing:
router.push(${collectionPath}/item/${encodeURIComponent(slug)});
to:
router.push(collectionPath);
produces the desired behaviour.
When creating a new collection item, Keystatic currently redirects to the newly created item's edit page.
For some editorial workflows, it would be useful to optionally return to the collection list instead.
Example use case:
In a real user test, staying on the newly created item's edit page caused confusion: the editor thought the form was ready for the next item and started editing the item that had just been created.
A collection-level option could perhaps look like:
afterCreate: 'item' | 'collection'
with the current behaviour remaining the default.
For my project, changing:
router.push(
${collectionPath}/item/${encodeURIComponent(slug)});to:
router.push(collectionPath);
produces the desired behaviour.