The discussion revolves around adding a feature to prevent users from losing unsaved changes when modifying category permissions. Falco proposes a prompt to remind users of pending changes before they can save or exit the page. awesomerobot suggests that clicking the “add” button should automatically save the changes, but jomaxro argues that the extra step of clicking “save” is necessary to prevent accidental permission grants.
eviltrout notes that the “Save Category” button currently applies to all tabs/sections, so the warning should be triggered if any changes are made. Later, eviltrout assigns the task to Osama, who creates a pull request (https://github.com/discourse/discourse/pull/7947) to implement the feature. The proposed solution includes a warning prompt that appears when the user tries to save without clicking the “plus” button, which has been updated to a primary color to make it more noticeable.
I like save. It’s an extra step to ensure the permissions are correct. Without it, if I select the wrong group in the dropdown and click the , they get access immediately, without an opportunity for me to fix it.
One thing that makes this slightly more complicated is the “Save Category” button applies to content on all tabs/pills right now. The warning should probably apply if you’ve made changes to ANYTHING on any section if you hit the X.
The save category button will trigger the warning if the user changes one of the dropdowns and doesn’t click the plus button. They can click save again and it will ignore the pending change and save anyway. Clicking the plus button will reset the trigger, so if they don’t change the dropdowns after clicking the plus button, the warning won’t be triggered.
Also I changed the plus button color to primary so it stands out a bit more.