Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2379 +/- ##
=========================================
Coverage 44.05% 44.05%
Complexity 19 19
=========================================
Files 39 39
Lines 4444 4444
Branches 51 51
=========================================
Hits 1958 1958
Misses 2472 2472
Partials 14 14
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Snapshot diff report vs base branch: main
|
| } | ||
|
|
||
| @Composable | ||
| private fun GetLiveUpdateCheckbox(state: Boolean, setState: (Boolean) -> Unit): ReplacementContent { |
There was a problem hiding this comment.
I know this is fitting in with the other names in the file, but I wonder how we ended up with GetXYZ for these instead of just XYZ
There was a problem hiding this comment.
Changing this to add a new variant "Paused" to "Live/Offline" state display, and turn the display into a button instead.
| // A successful call to fetchDocument (no exception) means we have a valid key. | ||
| // If this is the first success for this key, start the timer. | ||
| if (DesignSettings.firstSuccessTime == null) { | ||
| DesignSettings.firstSuccessTime = System.currentTimeMillis() |
There was a problem hiding this comment.
Can you use uptimeClock or something monotonic that won't get messed up by a time sync?
b40f77e to
74aa3b9
Compare
… timeout and fetch interval This commit introduces several improvements to the LiveUpdate feature: - Replaced old Design Switcher Figma document with updated ID 1Ig75AsfrYc5DXdlOaCoCl containing Paused state for LiveMode. - Displayed Live Update fetch interval and pause timeout in the Design Switcher settings view, formatted as minutes. - Implemented a Figma API token timeout mechanism (Live Update Pause Millis, 30 minutes by default) that clears the token after expiration for security. - Made the Live Update fetch interval configurable (Live Update Fetch Millis, 5000ms by default). - Added click interactions on the #LiveMode node to manually toggle the Live Update pause state. - Updated ApiKeyService to allow enabling/disabling LiveUpdate, and changing the pause timeout and fetch interval via Intent. - Refactored DesignSettings to better manage the LiveUpdate status and respond to changes in the API key, the enabled state, the pause timeout, and the fetch interval. - Persistent storage for the LiveUpdate enabled state, timeout, and fetch interval using DataStore. - Documented new adb commands in the Live Update setup guide. - Added a log output to display the DesignCompose version on initialization. File-level changes: - ApiKeyService.kt: Added enableLiveUpdate, setAutopauseTimeout, and setLiveUpdateFetchMillis actions and handlers. - DesignSwitcher.kt: Updated Figma doc ID to 1Ig75AsfrYc5DXdlOaCoCl. Added 'Paused' to LiveMode enum. Integrated LiveUpdate pause toggle on #LiveMode node. - DocServer.kt: Implemented configurable token timeout and fetch interval logic, consolidating LiveUpdate status management. Exposed pauseUpdates as MutableState. - LiveUpdateSettingsRepository.kt: Added DataStore support for LiveUpdate enabled, pause timeout, and fetch interval preferences. - setup.md: Added adb command examples for the new advanced Live Update configurations. - build.gradle.kts: Enabled buildConfig and injected DESIGNCOMPOSE_VERSION.
74aa3b9 to
5c6562b
Compare





LiveUpdate enhancements for #2282: