Skip to content

Make InteractionDialog popup bias configurable and deterministic (prefer top/right)#4681

Open
liannacasper wants to merge 7 commits intomasterfrom
codex/clarify-and-rename-bias-parameter-in-showpopupdialog
Open

Make InteractionDialog popup bias configurable and deterministic (prefer top/right)#4681
liannacasper wants to merge 7 commits intomasterfrom
codex/clarify-and-rename-bias-parameter-in-showpopupdialog

Conversation

@liannacasper
Copy link
Copy Markdown
Collaborator

Motivation

  • Allow callers to express a preference for showing the popup above/right of the target when both sides fit, and make the placement deterministic when both sides are available.

Description

  • Rename the bias parameter to prioritizeTopOrRightPosition on showPopupDialog and update its documentation to explain the top/right preference semantics and fallback behavior.
  • Replace ad-hoc orientation checks with explicit available-space calculations (spaceAbove, spaceBelow, spaceRight, spaceLeft) and determine showAbove / showRight by combining the preference with whether each side fits.
  • Keep the device orientation-based showPortrait decision but stop using the old bias flag for that purpose and propagate the new parameter to the internal showPopupDialog overload.
  • Add unit tests in InteractionDialogTest to verify preferred placement when both sides fit, fallback behavior when the preferred side doesn't fit, and the inverse preference.
  • Add an interactive screenshot test InteractionDialogPopupBiasScreenshotTest and register it in the device runner so the bias behavior is validated in the screenshot suite.

Testing

  • Ran the Maven core unit tests (including the new InteractionDialogTest cases) via the CI unit test profile and they passed.
  • Ran the CN1SS screenshot suite with the new InteractionDialogPopupBiasScreenshotTest included and the screenshot run completed successfully.

Codex Task

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 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 1, 2026

Android screenshot updates

Compared 34 screenshots: 33 matched, 1 missing reference.

  • InteractionDialogPopupBias — missing reference. Reference screenshot missing at /home/runner/work/CodenameOne/CodenameOne/scripts/android/screenshots/InteractionDialogPopupBias.png.

    InteractionDialogPopupBias
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as InteractionDialogPopupBias.png in workflow artifacts.

Native Android coverage

  • 📊 Line coverage: 7.66% (3914/51088 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 6.05% (19416/321122), branch 2.84% (885/31169), complexity 3.57% (1064/29822), method 6.29% (875/13906), class 10.40% (192/1846)
    • 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/712 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)

@shai-almog
Copy link
Copy Markdown
Collaborator

shai-almog commented Apr 1, 2026

iOS screenshot updates

Compared 34 screenshots: 32 matched, 1 updated, 1 missing reference.

  • InteractionDialogPopupBias — missing reference. Reference screenshot missing at /Users/runner/work/CodenameOne/CodenameOne/scripts/ios/screenshots/InteractionDialogPopupBias.png.

    InteractionDialogPopupBias
    Preview info: Preview provided by instrumentation.
    Full-resolution PNG saved as InteractionDialogPopupBias.png in workflow artifacts.

  • landscape — updated screenshot. Screenshot differs (2556x1179 px, bit depth 8).

    landscape
    Preview info: Preview provided by instrumentation.
    Full-resolution PNG saved as landscape.png in workflow artifacts.

Benchmark Results

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

Detailed Performance Metrics

Metric Duration
Simulator Boot 65000 ms
Simulator Boot (Run) 1000 ms
App Install 11000 ms
App Launch 6000 ms
Test Execution 142000 ms

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