Skip to content

Add lightweight picker quick-action buttons#4734

Merged
liannacasper merged 7 commits intomasterfrom
codex/add-date-control-buttons-to-picker
Apr 11, 2026
Merged

Add lightweight picker quick-action buttons#4734
liannacasper merged 7 commits intomasterfrom
codex/add-date-control-buttons-to-picker

Conversation

@liannacasper
Copy link
Copy Markdown
Collaborator

Motivation

  • Provide quick-action buttons in the lightweight Picker popup so users can perform common actions like setting a date to “Today” or “+7 Days” without scrolling the wheels.
  • Make the feature configurable with placement options so buttons can be placed in the existing top button row or above/below the spinner area.

Description

  • Added storage and API for lightweight popup buttons in Picker: addLightweightPopupButton(String, Runnable), addLightweightPopupButton(String, Runnable, int), clearLightweightPopupButtons(), and getLightweightPopupButtonLabels() in CodenameOne/src/com/codename1/ui/spinner/Picker.java.
  • Introduced LightweightPopupButtonPlacement constants (BETWEEN_CANCEL_AND_DONE, ABOVE_SPINNER, BELOW_SPINNER) and a private LightweightPopupButton holder class to track label, action and placement.
  • Wired rendering into the lightweight interaction dialog to place custom buttons in the button bar or above/below the spinner section and ensure button actions resync the spinner value and call updateValue().
  • Added unit tests in maven/core-unittests/src/test/java/com/codename1/ui/spinner/PickerCoverageTest.java to verify custom-button rendering, action behavior, and placement; added a screenshot test LightweightPickerButtonsScreenshotTest in scripts/hellocodenameone and registered it in the runner; updated developer guide docs with a usage example.

Testing

  • Ran the core unit tests for the Picker coverage test module with cd maven && mvn -pl core-unittests -am -DfailIfNoTests=false -DunitTests=true -Dmaven.javadoc.skip=true -Dtest=PickerCoverageTest test, and PickerCoverageTest passed (Tests run: 9, Failures: 0, Errors: 0) and the reactor completed successfully.
  • Added a screenshot test LightweightPickerButtonsScreenshotTest and attempted to compile the hellocodenameone test harness with cd scripts/hellocodenameone && ./mvnw -pl common -DskipTests compile, but the wrapper failed to fetch dependencies in this environment due to network/socket errors (so the screenshot step was not executed here).

Codex Task

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 11, 2026

Developer Guide build artifacts are available for download from this workflow run:

Developer Guide quality checks:

  • AsciiDoc linter: 1 issue(s) flagged (1 errors) (exit code 1) (report)
  • Vale: 18623 alert(s) (2704 errors, 6359 warnings, 9560 suggestions) (exit code 1) (report)
  • Image references: 33 unused image(s) found (report)

Unused image preview:

  • img/uwp-app-manager-apps.png
  • img/uwp-certificate-generator.png
  • img/uwp-cn1settings-debug-desktop-selected.png
  • img/uwp-cn1settings-disk-icon.png
  • img/uwp-cn1settings-uwp.png
  • img/uwp-cn1settings-windows-settings-menu-item.png
  • img/uwp-dashboard-download-appxbundle.png
  • img/uwp-extract-zip-file.png
  • img/uwp-mobile-recently-added.png
  • img/uwp-mobile-settings-developer-mode.png
  • ... and 23 more

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 11, 2026

✅ Continuous Quality Report

Test & Coverage

Static Analysis

Generated automatically by the PR CI workflow.

@shai-almog
Copy link
Copy Markdown
Collaborator

shai-almog commented Apr 11, 2026

Compared 37 screenshots: 37 matched.

Native Android coverage

  • 📊 Line coverage: 7.77% (4087/52599 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 6.10% (20225/331593), branch 2.91% (932/31974), complexity 3.64% (1114/30629), method 6.37% (912/14307), class 10.58% (201/1899)
    • Lowest covered classes
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysKt – 0.00% (0/6327 lines covered)
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2384 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.ClassReader – 0.00% (0/1519 lines covered)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1148 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.MethodWriter – 0.00% (0/923 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/730 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/623 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.Frame – 0.00% (0/564 lines covered)
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysJvmKt – 0.00% (0/495 lines covered)
      • kotlinx.coroutines.kotlinx.coroutines.JobSupport – 0.00% (0/423 lines covered)

✅ Native Android screenshot tests passed.

Native Android coverage

  • 📊 Line coverage: 7.77% (4087/52599 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 6.10% (20225/331593), branch 2.91% (932/31974), complexity 3.64% (1114/30629), method 6.37% (912/14307), class 10.58% (201/1899)
    • Lowest covered classes
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysKt – 0.00% (0/6327 lines covered)
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2384 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.ClassReader – 0.00% (0/1519 lines covered)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1148 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.MethodWriter – 0.00% (0/923 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/730 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/623 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.Frame – 0.00% (0/564 lines covered)
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysJvmKt – 0.00% (0/495 lines covered)
      • kotlinx.coroutines.kotlinx.coroutines.JobSupport – 0.00% (0/423 lines covered)

Benchmark Results

Detailed Performance Metrics

Metric Duration
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 native encode 1053.000 ms
Base64 CN1 encode 126.000 ms
Base64 encode ratio (CN1/native) 0.120x (88.0% faster)
Base64 native decode 1063.000 ms
Base64 CN1 decode 294.000 ms
Base64 decode ratio (CN1/native) 0.277x (72.3% faster)

@shai-almog
Copy link
Copy Markdown
Collaborator

shai-almog commented Apr 11, 2026

Compared 37 screenshots: 37 matched.
✅ Native iOS screenshot tests passed.

Benchmark Results

  • VM Translation Time: 0 seconds
  • Compilation Time: 72 seconds

Detailed Performance Metrics

Metric Duration
Simulator Boot 1000 ms
Simulator Boot (Run) 0 ms
App Install 1000 ms
App Launch 3000 ms
Test Execution 150000 ms
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 native encode 960.000 ms
Base64 CN1 encode 1120.000 ms
Base64 encode ratio (CN1/native) 1.167x (16.7% slower)
Base64 native decode 671.000 ms
Base64 CN1 decode 834.000 ms
Base64 decode ratio (CN1/native) 1.243x (24.3% slower)

Signed-off-by: liannacasper <67953602+liannacasper@users.noreply.github.com>
Signed-off-by: liannacasper <67953602+liannacasper@users.noreply.github.com>
@liannacasper liannacasper merged commit 0b7d3b3 into master Apr 11, 2026
19 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants