appcues / appcues-android-sdk

The Appcues Android SDK
https://www.appcues.com/mobile
MIT License
10 stars 3 forks source link

♻️ Debugger improvements #524

Closed andretortolano closed 1 year ago

andretortolano commented 1 year ago

Initially trying to mirror the iOS new behavior for log messages, but this change also contains a lot of quality of life changes on our debugger, including:

  1. More general approach to navigation, which made so navigation is now made easy (we know view routes, parents and children so we have more general way for handling transition
  2. updated FabX offset and FabY offset to mutableFloatState, this impacted some other places where I had to change from .value to .floatValue (this was a warning from probably new version of compose)
  3. Similarly added label to various animated values solving some warnings
  4. Reorganized some compositions and changed some method parameters to make it more similar to each other.
  5. made Floating back button reusable across pages.
  6. Fixed: bug related to deeplink where it wasnt properly being consumed and cleared, also made so deeplinks are not tied to just the debugger, not usefull for today but its better if for some reason we want to deeplink in the future to screen capture or another mode
  7. Fixed: Bug where closing and opening the debugger made so the last event would be doubled on the event list

To make the debugger properly show logs we needed some changes to our current log approach, so instead of Logcues pushing logs to android.Log, we now emit it as an item to logMessages, that can be subscribed by anyone, this includes the new LogcatLogging that is initialized once on Appcues init and the newly added DebuggerLogMessageManager that pushes this a logMessage list to our Detailed Log page.

Also another required change to how we intercept retrofit request, the original HttpLoggingInterceptor pushes log in a different format (one line, one entry) and what we needed was an entire log entry containing the whole request/response.

here is what the updated version of the debugger looks like.

Menu item List Detail
panel list detail

updated specs tests