Skip to content

Align Android preview panel layout with React Native gold standard#294

Merged
Alex Freas (akfreas) merged 14 commits into
mainfrom
android-preview-panel-rn-parity
May 30, 2026
Merged

Align Android preview panel layout with React Native gold standard#294
Alex Freas (akfreas) merged 14 commits into
mainfrom
android-preview-panel-rn-parity

Conversation

@akfreas
Copy link
Copy Markdown
Collaborator

@akfreas Alex Freas (akfreas) commented May 29, 2026

Summary

Brings the Android preview panel's layout into parity with the React Native preview panel (the gold standard), addressing three visual discrepancies. RN is authoritative; Android follows it (and stays aligned with iOS where a shared test contract applies).

Changes

  1. Center the "Reset to Actual State" footer button — added textAlign = TextAlign.Center. RN's ActionButton centers its label in a full-width button; Android's full-width Text defaulted to left.
  2. Audience header → RN column layout — restructured from a single cramped row (two competing weight(1f) siblings left the experience count floating mid-right) into RN's stacked rows: name + qualification on row 1, expand arrow + "N experiences" left-aligned on its own row 2, then description, then toggle. Also matched RN's arrow color and 2-line name clamp.
  3. Organize the Profile section — replaced raw .toString() value formatting; objects/arrays now serialize to compact JSON (values pinned right, 2-line clamp), and added RN-style curated subsections (Profile ID, Traits (N), Audiences (N) with API badge, Full JSON).

Deviation worth flagging

A pure RN-curated profile layout is not viable on native: the checked-in cross-platform UI test contract (PreviewPanelTests.kttestShowsAllExpectedProfileKeys, testShowsLocationData) requires every top-level profile key to be individually addressable as profile-item-<key>, and AGENTS.md requires Android to stay aligned with iOS. iOS keeps the flat per-key rows and adds curated sections below, so this PR mirrors iOS: flat rows retained (now cleanly formatted) plus the organized sections. All UI-test semantics (audience-expand-<id>, profile-item-<key>, no-profile-data, reset-all-overrides) are preserved.

Validation

  • :ContentfulOptimization:compileDebugKotlin → BUILD SUCCESSFUL, no new warnings in the edited files.
  • Not run: full Android Lint (low signal for layout-only Compose changes) and instrumented UI tests (need an emulator).

Follow-up

The DebugSection "Refresh" button has the same left-justified pattern as fix 1 but was left untouched (not in scope; structurally placed differently than RN's footer Refresh).

🤖 Generated with Claude Code

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Not sure of the utility of that markdown file in drafts... should probably be deleted?

@akfreas Alex Freas (akfreas) force-pushed the android-preview-panel-rn-parity branch from 96d9f1f to 68b5595 Compare May 29, 2026 20:30
@wiz-inc-38d59fb8d7
Copy link
Copy Markdown

wiz-inc-38d59fb8d7 Bot commented May 30, 2026

Wiz Scan Summary

Scanner Findings
Vulnerability Finding Vulnerabilities -
Data Finding Sensitive Data -
Secret Finding Secrets -
IaC Misconfiguration IaC Misconfigurations -
SAST Finding SAST Findings -
Software Management Finding Software Management Findings -
Total -

View scan details in Wiz

To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension.

@wiz-inc-38d59fb8d7
Copy link
Copy Markdown

Wiz Scan Summary

Scanner Findings
Vulnerability Finding Vulnerabilities -
Data Finding Sensitive Data -
Secret Finding Secrets -
IaC Misconfiguration IaC Misconfigurations 1 Low
SAST Finding SAST Findings -
Software Management Finding Software Management Findings -
Total 1 Low

View scan details in Wiz

To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension.

@akfreas Alex Freas (akfreas) merged commit 5a87cb6 into main May 30, 2026
37 checks passed
@akfreas Alex Freas (akfreas) deleted the android-preview-panel-rn-parity branch May 30, 2026 10:50
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.

2 participants