Skip to content

fix(sdk): keep the challenge on screen on short viewports - #286

Draft
CAMOBAP wants to merge 1 commit into
mainfrom
fix/challenge-clipped-on-short-viewport
Draft

CAMOBAP wants to merge 1 commit into
mainfrom
fix/challenge-clipped-on-short-viewport

Conversation

@CAMOBAP

@CAMOBAP CAMOBAP commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #227

Landscape, 1000x600dp Before After
landscape-600dp-CLIPPED landscape-600dp-FIXED

@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Diffuse report:

OLD: sdk-main.aar
NEW: sdk-pr.aar

 AAR      │ old       │ new       │ diff   
──────────┼───────────┼───────────┼────────
      jar │  98.8 KiB │  99.3 KiB │ +534 B 
 manifest │     411 B │     411 B │    0 B 
      res │  28.3 KiB │  28.3 KiB │    0 B 
    other │     1 KiB │     1 KiB │    0 B 
──────────┼───────────┼───────────┼────────
    total │ 128.5 KiB │ 129.1 KiB │ +534 B 

 JAR     │ old │ new │ diff       
─────────┼─────┼─────┼────────────
 classes │  62 │  62 │  0 (+0 -0) 
 methods │ 835 │ 837 │ +2 (+3 -1) 
  fields │ 287 │ 287 │  0 (+0 -0)
AAR
 size     │ diff   │ path          
──────────┼────────┼───────────────
 99.3 KiB │ +534 B │ ∆ classes.jar 
──────────┼────────┼───────────────
 99.3 KiB │ +534 B │ (total)
JAR
METHODS:

   old │ new │ diff       
  ─────┼─────┼────────────
   835 │ 837 │ +2 (+3 -1) 
  
  + android.view.View getLayoutParams() → ViewGroup_LayoutParams
  + android.view.ViewGroup addView(View, int, ViewGroup_LayoutParams)
  + android.view.Window setLayout(int, int)
  
  - android.view.ViewGroup addView(View, int)

The WebView was added without the ViewStub's match_parent params, so it fell
back to wrap_content and the page viewport tracked whatever hCaptcha rendered.
The challenge is a fixed 400x600 overlay, so on a short viewport it overflowed
past the top edge, hiding the prompt where it could not be scrolled into view.

Pin the dialog window and the WebView to the usable area, and scale the overlay
down when it does not fit.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@CAMOBAP
CAMOBAP force-pushed the fix/challenge-clipped-on-short-viewport branch from a06190a to 86c3a26 Compare October 18, 2026 16:34
@github-actions

Copy link
Copy Markdown

Benchmark report:

Test name Time ms. (median) Allocations (median)
com.hcaptcha.sdk.HCaptchaBenchmarkTest.EMULATOR_UNLOCKED_benchmarkInvisibleVerification +727.53 +26
com.hcaptcha.sdk.HCaptchaBenchmarkTest.EMULATOR_UNLOCKED_benchmarkInvisibleVerificationColdRun +703.47 +551
com.hcaptcha.sdk.HCaptchaBenchmarkTest.EMULATOR_UNLOCKED_benchmarkInvisibleSetup +5.65 +515
com.hcaptcha.sdk.HCaptchaDebugInfoTest.EMULATOR_UNLOCKED_benchmarkDebugInfo +25.39 -5570
com.hcaptcha.sdk.HCaptchaDebugInfoTest.EMULATOR_UNLOCKED_benchmarkDebugSys +45.18 +2

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.

Android tablet screen adaptation

1 participant