Skip to content

Issue #2282 Enhance LiveUpdate feature#2379

Merged
dipenpradhan merged 2 commits intomainfrom
liveupdate-autopause
Apr 21, 2026
Merged

Issue #2282 Enhance LiveUpdate feature#2379
dipenpradhan merged 2 commits intomainfrom
liveupdate-autopause

Conversation

@dipenpradhan
Copy link
Copy Markdown
Collaborator

@dipenpradhan dipenpradhan commented Mar 11, 2026

LiveUpdate enhancements for #2282:

  • Added a toggle in the Design Switcher to enable or disable LiveUpdate at runtime.
  • 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).
  • 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.

@dipenpradhan dipenpradhan changed the title Issue#2282 Enhance LiveUpdate feature Issue #2282 Enhance LiveUpdate feature Mar 11, 2026
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 47.51%. Comparing base (4d87b3c) to head (8d26e54).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2379      +/-   ##
============================================
- Coverage     47.52%   47.51%   -0.01%     
  Complexity       19       19              
============================================
  Files            44       44              
  Lines          5069     5070       +1     
  Branches         51       51              
============================================
  Hits           2409     2409              
- Misses         2646     2647       +1     
  Partials         14       14              
Flag Coverage Δ
kotlin 73.35% <100.00%> (+0.07%) ⬆️
rust 45.42% <ø> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 11, 2026

Snapshot diff report vs base branch: main
Last updated: Tue Apr 21 16:07:41 PDT 2026, Sha: 8d26e54
No differences detected

Comment thread designcompose/src/main/java/com/android/designcompose/DesignSwitcher.kt Outdated
Comment thread designcompose/src/main/java/com/android/designcompose/DocServer.kt Outdated
Copy link
Copy Markdown
Contributor

@kovmarci86 kovmarci86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dipenpradhan dipenpradhan force-pushed the liveupdate-autopause branch from 586f5c7 to 41875be Compare April 21, 2026 21:39
…uts, fetch intervals, and adaptive polling

This commit introduces several improvements to the LiveUpdate feature:
- Replaced old Design Switcher Figma document with updated ID Ljph4e3sC0lHcynfXpoh9f 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).
- Implemented adaptive polling, which exponentially increases the fetch interval up to 60 seconds when no changes are detected from Figma, reducing API calls. This feature defaults to true.
- Added click interactions on the #LiveMode node to manually toggle the Live Update pause state.
- Updated ApiKeyService to allow enabling/disabling LiveUpdate, enabling/disabling adaptive polling, 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, the fetch interval, and adaptive polling configuration.
- Persistent storage for the LiveUpdate enabled state, timeout, fetch interval, and adaptive polling enabled state 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, setLiveUpdateFetchMillis, and enableAdaptivePolling actions and handlers.
- DesignSwitcher.kt: Updated Figma doc ID to Ljph4e3sC0lHcynfXpoh9f. Added 'Paused' to LiveMode enum. Integrated LiveUpdate pause toggle on #LiveMode node.
- DocServer.kt: Implemented configurable token timeout, fetch interval, and adaptive polling logic, consolidating LiveUpdate status management. Exposed pauseUpdates as MutableState.
- LiveUpdateSettingsRepository.kt: Added DataStore support for LiveUpdate enabled, pause timeout, fetch interval, and adaptive polling enabled preferences.
- setup.md: Added adb command examples for the new advanced Live Update configurations.
- build.gradle.kts: Enabled buildConfig and injected DESIGNCOMPOSE_VERSION.
@dipenpradhan dipenpradhan force-pushed the liveupdate-autopause branch from 41875be to 6d2789a Compare April 21, 2026 21:41
@dipenpradhan dipenpradhan force-pushed the liveupdate-autopause branch from 5381853 to 8d26e54 Compare April 21, 2026 22:52
@dipenpradhan dipenpradhan enabled auto-merge April 21, 2026 23:04
@dipenpradhan dipenpradhan added this pull request to the merge queue Apr 21, 2026
Merged via the queue into main with commit 52d5570 Apr 21, 2026
25 checks passed
@dipenpradhan dipenpradhan deleted the liveupdate-autopause branch April 21, 2026 23:47
dipenpradhan added a commit that referenced this pull request Apr 22, 2026
Create v0.39.0-RC02 


v0.39.0-RC01(#2446)
This commit bumps the version across all Gradle
(`gradle/libs.versions.toml`) and Cargo configuration files to `0.39.0`
(`0.39.0-SNAPSHOT` in Gradle). It also unifies the
`dc_squoosh_animation` and `dc_squoosh_parser` crates under the
workspace dependencies.

Changes and issues addressed since 0.38.4:
- Enhance LiveUpdate feature (Issues
#2282,
#2379)
- Add cargo publish steps to GitHub release workflow (Issues
#2435,
#2436)
- Squoosh Designer Plugin: Figma plugin for orchestrating layout
animations (Issue
#2402)
- Replace println!/eprintln! with Rust log API in library code (Issues
#2403,
#2411)
- Update dc_figma_import README to reflect current architecture (Issues
#426,
#2427)
- Add comprehensive unit tests for mergeStyles function (Issues
#1963,
#2416)
- Avoid double key events during animated transitions (Issues
#1514,
#2417)
- Clean up unwrap() calls in dc_jni crate (Issues
#670,
#2415)
- Security: Update rustls-webpki 0.103.10 -> 0.103.12 (Issue
#2434)
- Document supported Android SDK levels (Issues
#163,
#2429)
- Restore Modifier customization support in squoosh renderer (Issues
#2292,
#2426)
- Handle unknown Figma features in deserialization (Issues
#2305,
#2414)
- Add adaptive polling with exponential backoff for LiveUpdate (Issues
#2282,
#2423)
- Add comprehensive Rust layout unit tests (Issues
#405,
#2413)
- Update JNI dependency to 0.22.4 and refactor dc_jni (Issue
#2432)
- Enable CodeQL security scanning (Issues
#926,
#2412)
- Prevent Design Switcher from briefly showing 'Offline' (Issues
#142,
#2421)
- Stroke gradients account for stroke thickness (Issues
#1549,
#2420)
- Add performance logging for high-cost fetch operations (Issues
#281,
#2419)
- Remove unclaimed Open VSX extension recommendation (Issue
#2431)
- Add assembleRelease to CI to catch minified build issues (Issues
#435,
#2425)
- Deprecate and remove publish_designcompose.sh script (Issue
#2433)
- Clarify visibility documentation — parameter name is flexible (Issues
#660,
#2428)
- Add JDK installation instructions to Getting Started docs (Issues
#707,
#2424)
- Add security check for Figma token file permissions (Issues
#249,
#2418)
- Fix whilePressing interaction getting stuck on multi-touch drag (Issue
#2422)
- Fix SquooshRoot infinite recomposition and freeze on rapid tap (Issue
#2409)
- Fix #436:
Tutorial release build signing configuration
(#2437)
- Fix #291:
Progress marker alignment in nested instances
(#2444)
- Fix #244:
Rotated node margin calculation uses pre-rotation size
(#2439)

---------

Co-authored-by: anshu10sep <priyanksingh@google.com>
kovmarci86 pushed a commit to kovmarci86/automotive-design-compose that referenced this pull request Apr 22, 2026
This commit bumps the version across all Gradle
(`gradle/libs.versions.toml`) and Cargo configuration files to `0.39.0`
(`0.39.0-SNAPSHOT` in Gradle). It also unifies the
`dc_squoosh_animation` and `dc_squoosh_parser` crates under the
workspace dependencies.

Changes and issues addressed since 0.38.4:
- Enhance LiveUpdate feature (Issues google#2282, google#2379)
- Add cargo publish steps to GitHub release workflow (Issues google#2435,
google#2436)
- Squoosh Designer Plugin: Figma plugin for orchestrating layout
animations (Issue google#2402)
- Replace println!/eprintln! with Rust log API in library code (Issues
google#2403, google#2411)
- Update dc_figma_import README to reflect current architecture (Issues
google#426, google#2427)
- Add comprehensive unit tests for mergeStyles function (Issues google#1963,
google#2416)
- Avoid double key events during animated transitions (Issues google#1514,
google#2417)
- Clean up unwrap() calls in dc_jni crate (Issues google#670, google#2415)
- Security: Update rustls-webpki 0.103.10 -> 0.103.12 (Issue google#2434)
- Document supported Android SDK levels (Issues google#163, google#2429)
- Restore Modifier customization support in squoosh renderer (Issues
google#2292, google#2426)
- Handle unknown Figma features in deserialization (Issues google#2305, google#2414)
- Add adaptive polling with exponential backoff for LiveUpdate (Issues
google#2282, google#2423)
- Add comprehensive Rust layout unit tests (Issues google#405, google#2413)
- Update JNI dependency to 0.22.4 and refactor dc_jni (Issue google#2432)
- Enable CodeQL security scanning (Issues google#926, google#2412)
- Prevent Design Switcher from briefly showing 'Offline' (Issues google#142,
google#2421)
- Stroke gradients account for stroke thickness (Issues google#1549, google#2420)
- Add performance logging for high-cost fetch operations (Issues google#281,
google#2419)
- Remove unclaimed Open VSX extension recommendation (Issue google#2431)
- Add assembleRelease to CI to catch minified build issues (Issues google#435,
google#2425)
- Deprecate and remove publish_designcompose.sh script (Issue google#2433)
- Clarify visibility documentation — parameter name is flexible (Issues
google#660, google#2428)
- Add JDK installation instructions to Getting Started docs (Issues
google#707, google#2424)
- Add security check for Figma token file permissions (Issues google#249,
google#2418)
- Fix whilePressing interaction getting stuck on multi-touch drag (Issue
google#2422)
- Fix SquooshRoot infinite recomposition and freeze on rapid tap (Issue
google#2409)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants