Skip to content

Feature/sta 227#946

Open
HughG wants to merge 68 commits into
original-android-onlyfrom
feature/STA-227
Open

Feature/sta 227#946
HughG wants to merge 68 commits into
original-android-onlyfrom
feature/STA-227

Conversation

@HughG

@HughG HughG commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

Hi Dave, sorry this has been delayed so long! I'm taking a break from the daily grind of job-hunting, so maybe I can get this finished at last.

Implemented generation of in-app help screens from Markdown files.

  • The existing Help screens are still used by default. To view the new ones, turn on the relevant Settings -> Debug option in the app, then restart it.
  • One expected change which I think is okay, is that the FAQ sub-screens now have "Frequently Asked Questions" as the header, rather than "FAQ".
  • One issue with the new screens is that the FAQ page in-text headings are at one level lower than before, hence the heading text is smaller. Could hack in a workaround to use a higher heading level for those sub-pages.
  • The new screens are currently only there for English.
  • Generation of the website should still work, even though the Markdown files moved, because I updated the jekyll build step to copy them into the expected plate. I tested it at one point, but can't remember how now, so it may or may not still work!

I think the next steps are as follows, either in this ticket, or in a follow-on if this is okay to merge.

  • Write a little script to pull out translated Markdown files for all other locales.
  • Create a separate Weblate Component for each Markdown file.
  • Pre-populate the translations on Weblate for each Markdown component with the text pulled from the already-translated help string files. (I can probably knock up a script to create the files, but I'm not sure how easy it would be to bulk-upload them — I've never tried.)
  • Once at least a few locales are tested, switch to the new code permanently, then remove the old code.

Then someone could think about actually editing the files! Weblate seems to be smart enough if you add/remove new sections: it adds a matching English section to each translated Markdown file.

HughG and others added 30 commits October 31, 2025 13:41
Currently translated at 2.7% (2 of 73 strings)

Translation: Soundscape Android/Android Help Pages
Translate-URL: https://hosted.weblate.org/projects/soundscape-android/android-help-pages/en_GB/
…Mrardown and a translation, to see how it appears in Weblate.
Updated by "Cleanup translation files" add-on in Weblate.

Translation: Soundscape Android/Android Help Pages
Translate-URL: https://hosted.weblate.org/projects/soundscape-android/android-help-pages/
Reading the generated baselines files from the device with adb fails because "/data/data/org/scottishtecharmy.soundscape" isn't world-readable, only world-traversable.  Making sub-dirs world-read/-traverse doesn't help.
Read the expected baselines from the correct place.
Got one test working.

The copying of new/different results out from the emulated device is still not working, though ChatGPT has another idea.
Tried this to copy to emulated SD card, but that doesn't work on recent Android SDKs.

ChatGPT's next suggestion was to gather all the results to a TAR file on the Android side and stream it out via adb, but I think I can just get the test to write diffs to the Gradle build folder directly, instead of to the Android filesystem.
Finally got one regression test working.  I learned that the tests are running entirely on the device, so have no access to the host filesystem, only to assets built into the test APK.  So, I had to use the TAR approach.
build.gradle.kts
* Make the pull & extract step run automatically with tests, and clean up the temp TAR file.

ComposeSnapshotTestUtils.kt
* Dump out all the modifiers as well as bounds (but stripping object IDs).
* Compare baseline and snapshot ignoring line endings, which may differ if the host is Windows.

menu_help_and_tutorials.txt
* Add back the regression file, with object details.
build.gradle.kts
* Make the pull & extract step run automatically with tests, and clean up the temp TAR file.

ComposeSnapshotTestUtils.kt
* Dump out all the modifiers as well as bounds (but stripping object IDs).
* Compare baseline and snapshot ignoring line endings, which may differ if the host is Windows.

menu_help_and_tutorials.txt
* Add back the regression file, with object details.
HelpScreenRegressionTest.kt
* Use existing AndroidX utility for escaping strings for filenames.
* Temporarily paste in the list of help sections, before converting to test parameters.
ComposeSnapshotTestUtils.kt
Help and Tutorials.txt
* More ID-stripping to avoid irrelevant diffs.

HelpScreenRegressionTest.kt
* Parameterised for main pages, but not FAQs yet.
HelpScreenRegressionTest.kt
* Parameterised for FAQs as well.
Just the very start, mostly "TODO" comments.
It's producing a slightly different layout and I'm not sure why, so I'm trying to capture and log the structure as the composables are called (with the help of Gemini Agent).

First I need to ignore the "$<N>" names of nested lambda classes in the diffs
Hopefully, once I switch the "Help and Tutorials" screen over to MarkdownHelpScreen I'll now be able to figure out what's really changed about the structure, without all the Anrdoid UI class details obscuring it ... unless the difference is in those details :-\
- Ignore depth of nested lambdas.
- Ignore main class renaming.
…ests, for faster feedback.

(Mostly by Gemini 3 Flash. Doesn't quite build yet.)
(Again, by Gemini 3 Flash.  Still doesn't quite build :-\)
Needs you to compile with JDK 19 as in GitHub, or at least not one so new that the testFixtures plugin won't recognise it, such as JDK 25.

The tests don't run due to fmod not being loaded in the test context, so that's next to fix.
Suggested by Gemini 3 Flash.  Doesn't work because the log order is different when the layout is non-lazy, but worth committing this change to keep for now.
HughG added 24 commits February 11, 2026 06:43
…AQ page.

In the process, I removed the extra "fake" question I added to test how Weblate handles things.  (Answer: it does what you'd want - adds the new text to other translation files, still in English, and flags them as needing translation.)
I was previously falling back to a "no locale" folder structure, but we don't want to have an extra copy of the help text there in English as a fallback, because that's wasteful and could get out of sync.

Now most of the regression output is right (modulo some styling and bounding box changes), but there are a few still failing.  That's mainly because numbered lists aren't rendered correctly by default by `AnnotatedString.fromHtml`.
It turns out that AnnotatedString.fromHtml doesn't support rendering ordered lists, and these never showed numbering in Soundscape before, so I don't need to fix that to maintain parity.
# Conflicts:
#	app/build.gradle.kts
#	app/src/main/assets/help/en/help-about-soundscape.md
#	app/src/main/assets/help/en/help-beacon-styles.md
#	app/src/main/java/org/scottishtecharmy/soundscape/SoundscapeApplication.kt
#	app/src/main/java/org/scottishtecharmy/soundscape/audio/NativeAudioEngine.kt
#	app/src/main/java/org/scottishtecharmy/soundscape/screens/home/DrawerContent.kt
#	app/src/main/java/org/scottishtecharmy/soundscape/screens/home/home/HelpScreen.kt
#	app/src/main/java/org/scottishtecharmy/soundscape/screens/home/settings/Settings.kt
This prevented help pages from launching when the new help screens were not enabled.
@HughG HughG requested a review from davecraig June 29, 2026 15:48
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.

2 participants