Skip to content

Use "Enable Gravatar" but not "Disable"#36771

Merged
wxiaoguang merged 4 commits intogo-gitea:mainfrom
wxiaoguang:fix-enable-gravatar
Feb 27, 2026
Merged

Use "Enable Gravatar" but not "Disable"#36771
wxiaoguang merged 4 commits intogo-gitea:mainfrom
wxiaoguang:fix-enable-gravatar

Conversation

@wxiaoguang
Copy link
Copy Markdown
Contributor

@wxiaoguang wxiaoguang commented Feb 27, 2026

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.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Feb 27, 2026
@github-actions github-actions bot added modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files modifies/frontend docs-update-needed The document needs to be updated synchronously labels Feb 27, 2026
@wxiaoguang
Copy link
Copy Markdown
Contributor Author

image

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@silverwind
Copy link
Copy Markdown
Member

silverwind commented Feb 27, 2026

image

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.

@wxiaoguang
Copy link
Copy Markdown
Contributor Author

wxiaoguang commented Feb 27, 2026

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.

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Feb 27, 2026
Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Feb 27, 2026
@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Feb 27, 2026
@wxiaoguang wxiaoguang enabled auto-merge (squash) February 27, 2026 16:19
@wxiaoguang wxiaoguang merged commit ae2b198 into go-gitea:main Feb 27, 2026
26 checks passed
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Feb 27, 2026
@wxiaoguang wxiaoguang deleted the fix-enable-gravatar branch February 27, 2026 16:50
silverwind added a commit to silverwind/gitea that referenced this pull request Feb 27, 2026
* 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
zjjhot added a commit to zjjhot/gitea that referenced this pull request Mar 2, 2026
* 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)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-update-needed The document needs to be updated synchronously lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/frontend modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files type/enhancement An improvement of existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhancement: Align Gavatar and Federated Avatars options to be Enable Untangle offline mode

5 participants