Skip to content

CATROID-1665 Add Settings toggle to enable/disable the AI Tutor - #5219

Open
harissabil wants to merge 1 commit into
dev-ai-tutorfrom
ai-tutor-settings-toggle
Open

CATROID-1665 Add Settings toggle to enable/disable the AI Tutor#5219
harissabil wants to merge 1 commit into
dev-ai-tutorfrom
ai-tutor-settings-toggle

Conversation

@harissabil

@harissabil harissabil commented Jun 17, 2026

Copy link
Copy Markdown
Member

https://catrobat.atlassian.net/browse/CATROID-1665

Summary

Adds a top-level "AI Tutor extension" checkbox to Settings so users can turn the AI Tutor on or off.

  • New setting_ai_tutor CheckBoxPreference (off by default) in preferences.xml, gated by the BuildConfig.FEATURE_AI_ASSIST_ENABLED build flag (entry removed when the feature isn't shipped).
  • SettingsFragment.isAiTutorSharedPreferenceEnabled() helper for runtime reads.
  • The AI Assist button now shows only when both the build flag and the user preference are enabled; re-evaluated in onResume so toggling takes effect on return.
  • Flips FEATURE_AI_ASSIST_ENABLED to true so the toggle is visible.
  • Extends SettingsFragmentTest.basicSettingsTest() to cover the new toggle.

Screenshot

AI Tutor extension setting

Your checklist for this pull request

Please review the contributing guidelines and wiki pages of this repository.

  • Include the name of the Jira ticket in the PR’s title
  • Include a summary of the changes plus the relevant context
  • Choose the proper base branch (develop)
  • Confirm that the changes follow the project’s coding guidelines
  • Verify that the changes generate no compiler or linter warnings
  • Perform a self-review of the changes
  • Verify to commit no other files than the intentionally changed ones
  • Include reasonable and readable tests verifying the added or changed behavior
  • Confirm that new and existing unit tests pass locally
  • Check that the commits’ message style matches the project’s guideline
  • Stick to the project’s gitflow workflow
  • Verify that your changes do not have any conflicts with the base branch
  • After the PR, verify that all CI checks have passed
  • Post a message in the catroid-stage or catroid-ide Slack channel and ask for a code reviewer

@harissabil
harissabil requested a review from spipau June 17, 2026 08:06
@harissabil harissabil self-assigned this Jun 17, 2026
@harissabil harissabil changed the title Add Settings toggle to enable/disable the AI Tutor CATROID-1665 Add Settings toggle to enable/disable the AI Tutor Jun 28, 2026
@harissabil
harissabil requested review from reichli and removed request for spipau June 30, 2026 07:16
@reichli reichli added the GSoC-2026 This ticket is assigned to the GSoC contributor. label Jul 9, 2026

@reichli reichli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good - thank you!

Users had no way to turn the AI Tutor extension off once the build
flag enabling it was on, so this exposes a top-level toggle in
Settings instead of leaving it permanently on.

- Add setting_ai_tutor CheckBoxPreference (off by default) in
  preferences.xml, gated by BuildConfig.FEATURE_AI_ASSIST_ENABLED so
  the entry disappears entirely when the feature isn't shipped.
- Add SettingsFragment.isAiTutorSharedPreferenceEnabled() for
  runtime reads of the preference.
- Show the AI Assist button only when both the build flag and the
  user preference are enabled, re-evaluated in onResume so toggling
  the setting takes effect immediately on return.
- Flip FEATURE_AI_ASSIST_ENABLED to true so the toggle is visible.
- Extend SettingsFragmentTest.basicSettingsTest() to cover the new
  toggle, mirroring the existing NFC/Arduino preference checks.
@harissabil
harissabil force-pushed the ai-tutor-settings-toggle branch from fc7ddff to 8378f24 Compare July 13, 2026 08:42
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

GSoC-2026 This ticket is assigned to the GSoC contributor.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants