Skip to content

feat: Phase 1 — quality tooling, Material You, per-app language, Arabic seed, JUnit5 tests, release workflow - #2

Open
devin-ai-integration[bot] wants to merge 8 commits into
chore/update-dependenciesfrom
feat/phase1-quality-i18n-ux
Open

devin-ai-integration[bot] wants to merge 8 commits into
chore/update-dependenciesfrom
feat/phase1-quality-i18n-ux

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Apr 25, 2026 •

Copy link
Copy Markdown

Summary

Phase 1 of the
Professional Roadmap
quick wins. Targets chore/update-dependencies (PR #1) so it lands cleanly
once the library bump is merged.

Tooling

  • Detekt 1.23.7 + Spotless 6.25.0 wired up to :app (informational
    only; legacy packages excluded). Config lives at config/detekt/detekt.yml.
  • New lint.yml workflow runs Detekt + Spotless check + Android Lint on
    every PR (continue-on-error so it never blocks merges yet).
  • renovate.json for grouped dependency updates with r8 pinned to
    < 8.12.0 (rationale in ADR-0002).
  • .github/dependabot.yml for weekly github-actions updates.

UI / UX (feat(ui))

  • Material 3 DynamicColors wired in SketchApplication; opt-in toggle
    persisted in SharedPreferences (default: enabled). The precondition lambda
    re-checks the toggle so users can disable Material You at runtime.
  • Per-app language API — Android 13+ system-settings picker enabled via
    android:localeConfig=@xml/locales_config and AppCompat 1.7's
    AppLocalesMetadataHolderService with autoStoreLocales=true.
  • Arabic seed translation in values-ar/strings.xml (~120 strings).
  • 10 supported locales declared (en, ar, id, pt-BR, es, ru,
    hi, fa, tr, vi). Untranslated keys fall back to English.

Tests

  • JUnit 5 BOM (5.11.4) + MockK 1.13.13 + Truth 1.4.4 + coroutines-test +
    arch-core-testing.
  • 14 passing unit tests for PropertiesUtil, CustomVariableUtil, and
    LocaleHelper (mocking AppCompatDelegate via MockK static).
  • useJUnitPlatform() configured globally on Test tasks.
  • testOptions.unitTests.returnDefaultValues = true so Android stub
    classes don't crash unit tests.

Release automation

  • release.yml workflow triggers on v* tag push or manual dispatch.
    Builds the release APK, computes SHA256, publishes a GitHub Release
    with the APK + checksums attached.
  • Phase 1 release v7.0.0-phase1-r1 already published with the
    locally-built APK + checksum: https://github.com/Dr-Code-EG/Sketchware-Pro/releases/tag/v7.0.0-phase1-r1
  • releases/ directory holds the SHA-256 pointer for offline verification
    (the binary itself is too large for git: 124 MB > GitHub's 100 MB limit).

Documentation

  • ADRs in docs/adr/:
    • 0001-record-architecture-decisions.md
    • 0002-pin-r8-to-8-11-x.md
    • 0003-defer-modular-refactor.md
  • docs/CONTRIBUTING-i18n.md — translator onboarding guide.

Review & Testing Checklist for Human

Risk level: yellow — touches application bootstrap (SketchApplication)
and the build (build.gradle, gradle.properties).

  • Sideload the APK from
    Releases
    on a real device and verify the app starts.
  • On a Pixel 6+ (Android 12+), open the app — Material You colours
    should match your wallpaper. Toggle it off in app settings and confirm
    it falls back to the legacy theme.
  • On Android 13+ go to Settings → Apps → Sketchware Pro → Language
    and pick Arabic; the main drawer / common labels should switch to
    Arabic and layout direction should mirror to RTL.
  • Run ./gradlew :app:test locally and confirm 14 tests pass.
  • Verify the Detekt run on the lint workflow uploads a SARIF report
    to the Security tab and that no failures actually block CI yet.

Notes

The PR #1 GitHub Actions Build APKs job is currently failing with a
reproducible-only-on-CI Unresolved reference 'BuildSettings' error in
compileReleaseKotlin. The same source tree builds cleanly locally with
identical Java/Gradle/Kotlin versions, and we've already tried:
disabling Develocity injection, disabling caches, isolating
GRADLE_USER_HOME, raising the Gradle daemon heap to 4 GB, and forcing
kotlin.compiler.execution.strategy=in-process. The locally-built APK
attached to v7.0.0-phase1-r1 was produced from the merged tip of this
branch on top of chore/update-dependencies.

Phase 2 work (modular Gradle refactor, Compose foundations, performance
baseline, full localisation rollout) tracked in the roadmap and will land
in subsequent PRs.

Link to Devin session: https://app.devin.ai/sessions/e3921762a25f45138ba2e0180e57b14d
Requested by: @Dr-Code-EG


Open in Devin Review

Dr-Code-EG and others added 5 commits April 25, 2026 18:13
- Apply Detekt (1.23.7) and Spotless (6.25.0) plugins to :app for
  static analysis and formatting. Spotless excludes the legacy
  packages a/, com/besome/, mod/agus/, kellinwood/ for now.
- Detekt runs informational-only (ignoreFailures = true) until the
  legacy code is gradually cleaned up; SARIF report is uploaded to
  the GitHub Security tab.
- Add renovate.json with grouped updates (AndroidX, Firebase, Kotlin,
  Android build tools), automerge for minor + security patches, and a
  hard pin for r8 < 8.12 (see ADR-0002).
- Add .github/dependabot.yml for weekly github-actions updates.
- New CI workflow .github/workflows/lint.yml runs Detekt, Spotless
  check, and Android Lint on every PR (continue-on-error so it never
  blocks merges yet).
- Add docs/adr/ with ADRs 0001 (record-architecture-decisions),
  0002 (pin-r8), 0003 (defer-modular-refactor), and a contributor
  guide for translators (docs/CONTRIBUTING-i18n.md).

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
UI/UX:
- Wire up Material 3 DynamicColors in SketchApplication so devices
  running Android 12+ pick up the user's wallpaper-derived palette.
  Toggle persisted in SharedPreferences (default: enabled). The
  precondition lambda ensures activities re-check the toggle so users
  can disable it at runtime without restarting the app.
- Declare android:localeConfig in the manifest pointing at
  res/xml/locales_config.xml (10 supported tags) so Android 13+
  surfaces the per-app language picker in system Settings.
- Register androidx.appcompat.app.AppLocalesMetadataHolderService
  with autoStoreLocales=true so AppCompat 1.7's per-app language
  API persists the user's choice without manual SharedPreferences.

i18n:
- Add LocaleHelper utility (set/get/effective locale) wrapping the
  AppCompat per-app language API.
- Seed values-ar/strings.xml with ~120 of the most user-visible
  strings (common words, main drawer, block category titles).
  Fallback to English for untranslated keys is automatic.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Tests:
- Add JUnit 5 BOM (5.11.4), MockK 1.13.13, Truth 1.4.4,
  kotlinx-coroutines-test 1.10.1, AndroidX arch-core-testing.
- Configure useJUnitPlatform() globally on Test tasks.
- Seed unit tests for PropertiesUtil (10 cases for unit/prefix
  parsing), CustomVariableUtil (4 cases for Java field declaration
  parsing), and LocaleHelper (MockK-static for AppCompatDelegate).

Release automation:
- New .github/workflows/release.yml triggered on tag push (v*) or
  workflow_dispatch. Builds the release APK with the same hardening
  used in android.yml, computes SHA256, and publishes a GitHub
  Release with the APK + checksums attached. Auto-generated release
  notes from commit messages.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Some helpers in PropertiesUtil reach into android.util.Pair and
android.text.TextUtils which are stubbed (and throw 'Stub!') in the
unit-test classpath. This commit:

- Sets testOptions.unitTests.returnDefaultValues = true so any
  Android stub method called during unit tests returns its default
  instead of crashing.
- Restricts PropertiesUtilTest to the helpers that don't depend on
  Android stubs (parseReferName, generateItems, regex constants).
  Coverage for unit/prefix parsing will be added via instrumentation
  tests in a follow-up.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
GitHub's pre-receive hook rejects pushes with files larger than 100 MB
and the Sketchware Pro release APK is ~124 MB, so the binary itself
lives at https://github.com/Dr-Code-EG/Sketchware-Pro/releases.
This directory hosts the SHA-256 checksum so offline clones can still
verify a downloaded APK.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

devin-ai-integration[bot]

This comment was marked as resolved.

- Compute checksums AFTER renaming the APK so SHA256SUMS.txt
  references the final SketchwarePro-<tag>.apk filename. Previously
  the checksum file mentioned app-release.apk which doesn't exist on
  the release page, breaking 'sha256sum -c' verification.
- Funnel inputs.tag_name through an env var instead of expanding it
  directly into a bash run block, plus a strict [A-Za-z0-9._-]+ regex
  guard. This prevents script injection by anyone with write access
  triggering workflow_dispatch with a malicious tag.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
devin-ai-integration[bot]

This comment was marked as resolved.

The Arabic and Persian locales added in this PR are right-to-left, but
without supportsRtl the framework keeps layouts in left-to-right
direction even when the user picks an RTL language - drawers end up on
the wrong side, padding asymmetric, etc. Default value of supportsRtl
is false, so we have to set it explicitly. Caught by Devin Review.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
devin-ai-integration[bot]

This comment was marked as resolved.

Previously locales_config.xml listed 10 languages (id, pt-BR, es, ru,
hi, fa, tr, vi) that had no values-<locale>/strings.xml. On Android
13+ this populates the per-app language picker, so users selecting any
of those would get a silently-English UI - misleading. Trim the list
to en + ar (the ones that actually have resources) and update the
contributor guide to explain the policy. Caught by Devin Review.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant