Skip to content

chore: [SDK-5532] add sticky log view to demo app - #74

Merged
fadi-george merged 4 commits into
mainfrom
fadi/sdk-5532
Oct 13, 2026
Merged

fadi-george merged 4 commits into
mainfrom
fadi/sdk-5532

Conversation

@fadi-george

@fadi-george fadi-george commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Description

One Line Summary

Add a logcat-style log view to the demo app that shows SDK listener events, so E2E tests can assert JS events.
Screenshot 2026-10-13 at 10 25 37 AM

Details

Motivation

The shared Appium suite (sdk-shared) needs a way to check that JS listeners fire, e.g. that a notification click fires exactly once after a cold-start or background tap. Device logs (logcat/syslog) are unreliable for this across wrappers and on real devices, so the demo shows events on screen where Appium can read them.

This is the reference implementation for the other demos (SDK-5523) and follows the shared spec in sdk-shared/demo/build.md (Prompt 1.5, 2.0, 6.2) and styles.md (Log View).

Scope

Demo app only; no SDK changes.

  • services/LogService.ts: in-memory log store (max 100 entries, never persisted) with a log() helper that also writes to the console
  • components/LogView.tsx: sticky panel under the app bar with entry count, clear (trash) and collapse (chevron) buttons, auto-scroll to newest
  • hooks/useOneSignal.ts: SDK listeners route through log(); notification click and foregroundWillDisplay now include notificationId
  • Test ids: log_view, log_entry_{index}, log_clear_button, log_toggle_button

Testing

Unit testing

No new unit tests; demo UI only. Existing SDK tests pass (267/267).

Manual testing

On the Android 16 emulator: sent pushes from the demo while foregrounded and tapped them; the log view showed one foregroundWillDisplay and one click entry with matching notification ids. Checked sticky behavior while scrolling, collapse/expand, and clear.

Ran sdk-shared run-local --platform=android --sdk=capacitor --spec=02 with the new log assertions: 3/3 passing, assertions executed (not skipped).

Affected code checklist

  • Notifications
    • Display
    • Open
    • Push Processing
    • Confirm Deliveries
  • Outcomes
  • Sessions
  • In-App Messaging
  • REST API requests
  • Public API changes

Checklist

Overview

  • I have filled out all REQUIRED sections above
  • PR does one thing
  • Any Public API changes are explained in the PR details and conform to existing APIs

Testing

  • I have included test coverage for these changes, or explained why they are not needed
  • All automated tests pass, or I explained why that is not possible
  • I have personally tested this on my device, or explained why that is not possible

Final pass

  • Code is as readable as possible.
  • I have reviewed this PR myself, ensuring it meets each checklist item

🤖 Generated with Claude Code

Logcat-style panel under the app bar showing SDK listener events, so
the shared Appium suite can assert JS click and foregroundWillDisplay
events. Notification events now include the notification id.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fadi-george and others added 2 commits October 13, 2026 13:00
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fadi-george fadi-george changed the title feat: [SDK-5532] add sticky log view to demo app chore: [SDK-5532] add sticky log view to demo app Oct 13, 2026
@fadi-george
fadi-george merged commit cc14c43 into main Oct 13, 2026
6 checks passed
@fadi-george
fadi-george deleted the fadi/sdk-5532 branch October 13, 2026 20:05
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.

3 participants