pontoon icon indicating copy to clipboard operation
pontoon copied to clipboard

Settings page: Remove save button, blur input and change APIs

Open functionzz opened this issue 3 weeks ago • 3 comments

Description

This PR removes the html form functionality of the settings page and replaces it with auto-save with debouncing. It also changes APIv1 endpoints to reflect similar AJAX calls, and modifies multiple_locale_selector behaviour.

Fixes #3746 Fixes #3844

TODO:

  • [x] ~Discuss email field debouncing issue~
  • [x] ~Locale Selector auto-save is not finished~
  • [x] ~Remove Save button~
  • [x] ~Test cases need to be rewritten due to behavior change~

Additional Notes

~I noticed that the multiple_locale_selector and the preferred_locale_selector et. al still includes locales like bn_BD and bn-IN.~ See #3854.

~Also, one concern I have for this implementation lies with the email field. If a user wants, they can spam random emails with verification mail by changing a letter of the input every 2 seconds. Also, if a user doesn't finish writing out said email within 2 seconds, it will submit due to the debouncing, accidentally sending an email to someone else.~

functionzz avatar Nov 30 '25 02:11 functionzz

This PR is doing multiple things at once. It's hard to review it with all the changes in a single commit.

Could you please first separate the changeset into multiple commits?

  • one for introduction of the Field widget.
  • one for https://github.com/mozilla/pontoon/issues/3746
  • one for https://github.com/mozilla/pontoon/issues/3844
  • changes of the multiple_locale_selector behaviour (are there really any?)

I would also prefer if we save on blur (“I left the field, it’s done”, fewer saves than per-keystroke).

mathjazz avatar Dec 01 '25 12:12 mathjazz

Also, one concern I have for this implementation lies with the email field. If a user wants, they can spam random emails with verification mail by changing a letter of the input every 2 seconds. Also, if a user doesn't finish writing out said email within 2 seconds, it will submit due to the debouncing, accidentally sending an email to someone else.

Another reason to use the blur event.

mathjazz avatar Dec 01 '25 12:12 mathjazz

Codecov Report

:x: Patch coverage is 87.69231% with 8 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 78.68%. Comparing base (74b4ca1) to head (53b06eb).

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov-commenter avatar Dec 09 '25 18:12 codecov-commenter