After the incident is before the incident

There’s a saying in the German fire service: Nach dem Einsatz ist vor dem Einsatz – after the incident is before the incident. When the crew gets back to the station, the job isn’t done. Hoses get washed and hung up, breathing apparatus is checked and refilled, the vehicle is restocked – so that when the next alarm comes, everything is ready.
Release week is over. So this post is the software version of that: clean up, restock, and get ready for the next big one.
Cleaning up
Shipping under a deadline leaves a trail. Here’s the honest list:
- The tip comes to the iPhone. iOS 0.1.4 shipped without the in-app purchase; 0.1.5 brings it back from the same shared code. It’s built and waiting for the first release to be approved.
- Small layout fixes from the first real iOS run – the double safe area and the time-correction chip that wrapped into “n / ow” – are fixed and part of 0.1.5.
- One untranslated line. The demo incident is a German radio log on purpose, but its note “Beispieldaten – kann gelöscht werden” should follow the app language. It doesn’t yet (you can see it in the screenshot above).
- Push, tag, write it down. Releases are tagged and signed, and this blog is catching up with what happened.
Nothing heroic. That’s the point – it’s the hose-washing of software.
Getting ready for the next big one: the tablet
Remember the very first requirement from the napkin post? It has to run on the tablet the station already owns. In a command vehicle, the log isn’t kept on someone’s phone. It’s kept on a tablet mounted or lying next to the radio, used by whoever has the headset.
The good news: cheap tablets are powerful enough. Einsatzlog needs no server, no account and no network. It’s a local SQLite database, a Compose UI and a PDF renderer. It targets Android 8.0 (API 26) and up, so even an older or budget Android tablet runs it. The bottleneck isn’t the hardware. It’s the layout.
What a tablet sees today
The screenshot at the top is the honest answer for the version in the stores. The app runs on a 10-inch tablet, and everything works – but it’s the phone layout, stretched. Each radio message becomes one very long line, and the right half of the screen is mostly empty. On a tablet you want the opposite: more context at once, fewer screen changes.
Restocked: window size classes in Compose Multiplatform
So I didn’t stop at a plan. On the evening of release day, the tablet layout landed on the public branch feature/tablet-layout. It’s not in a store release yet – but it’s real code, and it looks like this on the same 10-inch tablet:

Compose Multiplatform supports adaptive layouts through the Material 3 adaptive library (org.jetbrains.compose.material3.adaptive:adaptive:1.2.0): the same currentWindowAdaptiveInfo() and window size classes as on Android, available from commonMain. One decision, written once, for Android tablets – and later the iPad.
COMPACT < 600 dp MEDIUM 600–839 dp EXPANDED ≥ 840 dp
┌─────────────┐ ┌──────────┬──────────────────┐ ┌─────────┬───────────────────┬──────────────┐
│ incidents │ │incidents │ logbook │ │incidents│ logbook (stream) │ entry pane │
│ ▼ tap │ │ │ │ │ │ │ [New entry] │
│ logbook │ │ │ [+ New entry] ─────▶ │ │ │ or the form │
│ ▼ tap │ │ │ full-screen form│ │ │ │ │
│ quick entry │ │ │ │ │ │ │ │
└─────────────┘ └──────────┴──────────────────┘ └─────────┴───────────────────┴──────────────┘
phone: unchanged list-detail list-detail + a permanent entry pane
The switch itself is small enough to show whole:
// ui/…/components/templates/AdaptiveTemplates.kt (commonMain)
enum class LayoutClass { COMPACT, MEDIUM, EXPANDED }
@Composable
fun currentLayoutClass(): LayoutClass {
val size = currentWindowAdaptiveInfo().windowSizeClass
return when {
size.isWidthAtLeastBreakpoint(WindowSizeClass.WIDTH_DP_EXPANDED_LOWER_BOUND) -> LayoutClass.EXPANDED
size.isWidthAtLeastBreakpoint(WindowSizeClass.WIDTH_DP_MEDIUM_LOWER_BOUND) -> LayoutClass.MEDIUM
else -> LayoutClass.COMPACT
}
}
And in the navigation graph, phones keep their one-screen-at-a-time flow, while anything wider puts the list and the logbook side by side – no navigation between them at all:
composable(Routes.HOME) {
val layout = currentLayoutClass()
if (layout == LayoutClass.COMPACT) {
HomeScreen(onOpenEinsatz = { id -> navController.navigate(Routes.einsatz(id)) }, /* … */)
} else {
var selected by rememberSaveable { mutableStateOf<String?>(null) }
ListDetailTemplate(
list = { HomeScreen(onOpenEinsatz = { id -> selected = id }, /* … */) },
detail = {
val id = selected
if (id == null) EmptyDetail(stringResource(Res.string.home_select_incident))
else key(id) { LogbookPane(einsatzId = id, layout = layout, /* … */) }
},
)
}
}
Two traps the phone never showed me
The timestamp rule. On a phone, the time of a radio message is captured when the entry form opens – that’s the app’s core trust mechanism. A permanent pane is always “open”, so it would quietly capture the time when the pane appeared, minutes before the message. The fix: the pane shows a big “New entry” button, and every tap opens a fresh form with a fresh ViewModel. Same rule, new layout.
ViewModels that remember the wrong incident. On a phone, each logbook is its own navigation destination with its own ViewModelStore. On a tablet, the logbook pane lives inside the Home destination – so picking another incident would happily reuse the old incident’s ViewModel. Keying them per incident fixes it:
// composeApp/…/ui/logbook/LogbookPane.kt
val viewModel: LogbookViewModel =
koinViewModel(key = "logbook-$einsatzId", parameters = { parametersOf(einsatzId) })
// …and in the pane, one ViewModel per opened form – the time is taken when *this* form opens:
key(entrySession) {
EntryFormScreen(einsatzId, onDone = { entryOpen = false },
viewModel = koinViewModel(key = "entry-$einsatzId-$entrySession", parameters = { parametersOf(einsatzId) }))
}
The breakpoints are plain Material 3 numbers, and they’re pinned by three tiny commonTest tests – 360 and 599 dp stay compact, 600 and 839 are medium, 840 and 1280 are expanded – so nobody “improves” them by accident.
Why the groundwork paid off
This is where the atomic design from the beginning earned its keep. The logbook stream, the quick-entry form and the incident header were already self-contained organisms, so the tablet layout didn’t rewrite a single one of them; it arranges them differently. In that post I wrote that a phone-only app could skip the templates level, and that adding it later would be cheap. It was: the new package is literally called components/templates, and the whole feature is under 300 lines across 11 files – all of it in shared code, not a single line in androidMain or iosMain.
The tooling is ready too:
- The screenshot generator already renders a 10-inch tablet size for Google Play – adding landscape is one line.
- The Maestro flow that recorded the demo video runs on a tablet emulator just as well.
- The iPad was switched off for the first iOS release, because a stretched iPhone layout on a 13-inch screen would not have passed my own bar. The layout is now ready for it; switching the iPad back on is the next step.
Before the next alarm
The checklist for the next release, the station way:
- Tip on iOS (0.1.5)
- Demo note follows the app language
- Window size classes: list-detail on medium, permanent entry pane on expanded (on
feature/tablet-layout) - Merge it into a store release
- The vehicles and crews rail from the napkin
- iPad back on, with its own screenshots
- Test on a real, cheap tablet – the one a station would actually buy
Nach dem Einsatz ist vor dem Einsatz. See you at the next one.
#BuildInPublic