Kgothatso Ngako 359f54812f refactor: give the translation/chapter join one home
TranslationScaffold owns the rows that join a translation to the chapters it is
a translation of. Pure refactor: the same events go out in the same order,
`TranslationBatchProposalJvmTest` passes unedited apart from the call it makes,
and no screen behaves differently.

The move is worth making before anything is built on it. A translation chapter
carries no words -- it is `(translation, chapter, position)` and nothing else,
and it exists so a translated chunk has somewhere to hang. Both of the things
it joins arrive on their own schedule: a chapter is signed into an artifact
that already has translations, a translation is started on an artifact that
already has chapters. So the same cross product has to be built from either
side, and a second copy of it is a second chance to disagree about what a
translation covers -- a disagreement that shows up as a chapter nobody can
translate rather than as anything that looks like a bug.

**Over ids, not rows.** `chaptersOf` takes translation ids and a
`SourceChapter`, which is a chapter reduced to which one and where it sits,
rather than a `MantraChapter`. Neither end is always a row: a translation being
proposed exists only as the unsigned event a session is about to sign, and so
does a chapter. `SourceChapter.of` is there for the callers that do hold a row.

**Two things it decides rather than leaves to a caller.** Item order is apply
order, so the nesting is fixed here -- translations outer, chapters inner, which
keeps one translation's chapters contiguous and in reading order. And
`createdAt` is taken once rather than read per template, so a scaffolding
proposed as one act reads as one rather than as events that happen to share a
minute.

The index is the source chapter's own, never the position in the list handed
in. They agree when the list is a whole version in order and stop agreeing the
moment a caller holds a subset, and only one of them is what the group signed.

**Tests.** TranslationScaffoldTest covers it as the pure function it is: the
nesting, both directions it is built from, one timestamp for the lot, the empty
cases, and the index surviving a non-contiguous subset. Checked against a broken
implementation -- taking the index from the list position passes every test that
uses a whole version in order, and is caught by the subset.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-06 12:01:42 +02:00
2026-07-05 23:21:02 +02:00
2026-07-28 09:10:20 +02:00
2026-03-24 04:47:19 +02:00
2026-03-23 01:41:39 +02:00
2026-03-23 01:41:39 +02:00
2026-03-23 01:41:39 +02:00

This is a Kotlin Multiplatform project targeting Android, iOS, Desktop (JVM).

  • /composeApp is for code that will be shared across your Compose Multiplatform applications. It contains several subfolders:

    • commonMain is for code thats common for all targets.
    • Other folders are for Kotlin code that will be compiled for only the platform indicated in the folder name. For example, if you want to use Apples CoreCrypto for the iOS part of your Kotlin app, the iosMain folder would be the right place for such calls. Similarly, if you want to edit the Desktop (JVM) specific part, the jvmMain folder is the appropriate location.
  • /iosApp contains iOS applications. Even if youre sharing your UI with Compose Multiplatform, you need this entry point for your iOS app. This is also where you should add SwiftUI code for your project.

Build and Run Android Application

To build and run the development version of the Android app, use the run configuration from the run widget in your IDEs toolbar or build it directly from the terminal:

  • on macOS/Linux
    ./gradlew :composeApp:assembleDebug
    
  • on Windows
    .\gradlew.bat :composeApp:assembleDebug
    

Build and Run Desktop (JVM) Application

To build and run the development version of the desktop app, use the run configuration from the run widget in your IDEs toolbar or run it directly from the terminal:

  • on macOS/Linux
    ./gradlew :composeApp:run
    
  • on Windows
    .\gradlew.bat :composeApp:run
    

Build and Run iOS Application

To build and run the development version of the iOS app, use the run configuration from the run widget in your IDEs toolbar or open the /iosApp directory in Xcode and run it from there.


Learn more about Kotlin Multiplatform

Description
Mantra as a kotlin multiplatform project
https://mantra.press
Readme 8.2 MiB
Languages
Kotlin 100%