Feature/sta 227#946
Open
HughG wants to merge 68 commits into
Open
Conversation
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.
…ne breaks and bold text.
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
I think the next steps are as follows, either in this ticket, or in a follow-on if this is okay to merge.
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.