Use "Enable Gravatar" but not "Disable"#36771
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors the Gravatar and Federated Avatar settings to align with "Enable" rather than "Disable" conventions in the admin UI. It introduces a new "flipped" config value type that allows UI elements to display inverted boolean semantics without requiring database migrations. The PR also removes several unused settings from the installation page (offline mode, gravatar, and federated avatar options) and sets DisableGravatar to true by default.
Changes:
- Introduced "flipped" config value type to invert boolean semantics for UI display while maintaining backend storage
- Removed avatar and offline mode configuration options from the installation page
- Changed default behavior to disable Gravatar by default (DisableGravatar=true)
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| web_src/js/features/install.ts | Removed JavaScript event handlers for deleted install form fields (offline-mode, disable-gravatar, federated-avatar-lookup) |
| web_src/js/features/admin/config.ts | Added collectCheckboxBooleanValue function and 'flipped' type support for inverting boolean config values |
| web_src/js/features/admin/config.test.ts | Added test cases for 'flipped' checkbox value type handling |
| templates/install.tmpl | Removed offline mode, gravatar, and federated avatar configuration fields from installation form |
| templates/admin/config_settings/avatars.tmpl | Changed UI from "Disable Gravatar" to "Enable Gravatar" using flipped value type |
| templates/admin/config.tmpl | Removed offline mode display from admin config overview |
| services/forms/user_form.go | Removed OfflineMode, DisableGravatar, and EnableFederatedAvatar fields from InstallForm |
| routers/web/admin/config.go | Removed OfflineMode from config data |
| routers/install/install.go | Removed avatar and offline mode handling from install and submit handlers |
| options/locale/locale_en-US.json | Removed install page locale entries and changed "disable_gravatar" to "enable_gravatar" in admin config |
| modules/setting/server.go | Removed OfflineMode variable and its initialization |
| modules/setting/picture.go | Removed unused helper functions and fixed deprecation warnings to reference correct section |
| modules/setting/config/value.go | Renamed variable for clarity (has → hasCfgValue) |
| modules/setting/config.go | Set DisableGravatar default to true |
| models/user/avatar.go | Removed OfflineMode check from avatar link generation |
| custom/conf/app.example.ini | Updated comments to indicate DISABLE_GRAVATAR and ENABLE_FEDERATED_AVATAR are deprecated; removed OFFLINE_MODE |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
3cb2c19 to
c5ac3e6
Compare
|
I still think the presence of these two avatar options in the UI is weird. Why single out these two? I know @lunny implemented that but I don't like it. |
Can leave the argument to the future. They have been there for long time. This PR is just a clean up for legacy code, and add the ability for the "config value" to support "flipped" boolean. |
Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
* origin/main: Move Fomantic dropdown CSS to custom module (go-gitea#36530) Use "Enable Gravatar" but not "Disable" (go-gitea#36771) feat: add branch_count to repository API (go-gitea#35351) (go-gitea#36743) Deprecate RenderWithErr (go-gitea#36769) Lazy-load some Vue components, fix heatmap chunk loading on every page (go-gitea#36719) Filter out untracked files from spellchecking (go-gitea#36756) Fix CSS stacking context issue in actions log (go-gitea#36749) Fix milestone/project text overflow in issue sidebar (go-gitea#36741) Update tool dependencies and fix new lint issues (go-gitea#36702) Instance-wide (global) info banner and maintenance mode (go-gitea#36571) Add created_by filter to SearchIssues (go-gitea#36670) Inline and lazy-load EasyMDE CSS, fix border colors (go-gitea#36714) # Conflicts: # templates/repo/issue/view_content/pull_merge_box.tmpl # web_src/js/features/repo-issue-pull.ts
* giteaofficial/main: (21 commits) Enable docker layer caching for `dry-run` and `nightly` container builds (go-gitea#36738) Add admin badge to navbar avatar (go-gitea#36790) WorkflowDispatch api optionally return runid (go-gitea#36706) upgrade minimatch (go-gitea#36760) Add `never` option to `PUBLIC_URL_DETECTION` configuration (go-gitea#36785) Refactor avatar package, support default avatar fallback (go-gitea#36788) Mark unused&immature activitypub as "not implemented" (go-gitea#36789) Add “Copy Source” to markup comment menu (go-gitea#36726) Update Nix flake (go-gitea#36787) Implements OIDC RP-Initiated Logout (go-gitea#36724) Fix README symlink resolution in subdirectories like .github (go-gitea#36775) [skip ci] Updated translations via Crowdin Correct spelling (go-gitea#36783) refactor: replace legacy tw-flex utility classes with flex-text-block/inline (go-gitea#36778) Fix `no-content` message not rendering after comment edit (go-gitea#36733) Fix typos and grammar in English locale (go-gitea#36751) Move Fomantic dropdown CSS to custom module (go-gitea#36530) Use "Enable Gravatar" but not "Disable" (go-gitea#36771) feat: add branch_count to repository API (go-gitea#35351) (go-gitea#36743) Deprecate RenderWithErr (go-gitea#36769) ...


Introduce "fipped" config value type, remove unused setting variables. Make DisableGravatar=true by defult, remove useless config options from the "Install" page.
The legacy config options are still kept because they are still the fallback values for the system config options.