Skip to content

doseeare/ControlZ

Repository files navigation

ctrlz_icon

ControlZ TimeTravel

Bring Ctrl+Z to your app state.
ControlZ TimeTravel is a developer tool that records the history of your application state and lets you travel back and forth in time, jump to any saved state, and even inject new states from JSON.
Perfect for debugging, reproducing bugs, and exploring how your app behaves in different scenarios.


✨ Features

  • 📜 State history — every change is recorded.
  • Time travel — step back, step forward, or jump to any point.
  • 🧩 Panel integration — visualize and navigate states directly in your UI.
  • 🛠 State injection — load a state from JSON to simulate scenarios.
  • Debug-friendly — enable only in debug builds.

🎬 Demo

⏪ Time travel between states

Navigate freely through your application's state history — step backward, forward, or jump to any moment in time.

tt_demo_2.mp4

🛠 Inject state from JSON

Load and inject a custom state from JSON to instantly reproduce edge cases and complex scenarios.

tt_demo2.mp4

1) Add debug-panel to host screen

TimeTravelPanelDrawer(enabled = true) {
  //Your app content
  }

2) Register state in ViewModel

In your ViewModel (or any presentation layer), register your StateFlow in TimeTravelRegistry.

TimeTravelRegistry.register(
    scope = viewModelScope,
    stateFlow = state,
    enabled = true, // usually BuildConfig.DEBUG
    onChanged = { travelState ->
        updateState { travelState }
    }
)

📦 Installation

Add the dependency to your build.gradle:

dependencies {
    implementation("io.github.doseeare.controlz:timetravel:0.1.0")
}