decap-cms
decap-cms copied to clipboard
Prompt author for custom commit message on publish
Problem Users have no chance to give their commits a custom message. A simple real-world use case is the following: Large non-tech teams using the netlify-cms need some way to tie their content edits to a ticket. The commit message templates beta feature from https://www.netlifycms.org/docs/beta-features/#commit-message-templates is limited.
Solution When hitting publish, a beautiful modal would prompt the user for a chance to input a commit message. In the use case mentioned above, the user could finally input their ticket number.
The option to prompt for a commit message could be simply toggled on or off via a config backend parameter:
backend:
commit_messages:
prompt: true | false
Additional context
The UI would visually be something along the lines of:

@erezrokah Thanks for checking this one out. If we want to go for this, how can I get started on it? Any pointers as to which file to trigger it and when to prompt for it?
This would be a nice feature
Thank for you opening this request @antoineclarose.
The CMS UI has been very much about hiding git specifics from editors/users (some backends are not even git based like the test backend and local backend in file system mode). Not sure we would like to break that pattern.
Any git related configs are done via the config.yml by the developer.
Personally, I think showing a commit message on each save can add unnecessary friction (and we would need another dialog for editorial workflow publishing for the merge/squash commit message). If the use case is to link to a ticket/issue, that would probably require the user to context switch anyway to GitHub to find the ticket/issue, so maybe they can update the PR description with it?
This is also related to https://github.com/netlify/netlify-cms/issues/3934 and https://github.com/netlify/netlify-cms/issues/314
The general approach is not to create a replacement UI for GitHub, but a better abstraction over it designed and scoped for authoring content.
Having a comment/collaboration UI should cover the link to ticket use case, WDYT?
One example: Think of using Netlify CMS to maintain a wiki. For a wiki, a page edit history is a common requirement. In the history, it's nice to see a short description for each major change.
So don't think of it in git terms, as a commit message, but rather in document collaboration terms, as change description.
As for the interface, it doesn't have to be as intrusive as a prompt.
There could be a field, with a default set to something like update {{slug}}. Then in config.yml the admin could decide to show or hide the field, or change the default. And, if the field is shown, each author could opt for editing the field or leaving it as is.
So I think there are non-intrusive solutions that offer some flexibility.