Skip to content

Add native notification centre and reliable Log navigation - #79

Open
ricardovfreixo wants to merge 7 commits into
NativePHP:mainfrom
ricardovfreixo:feat/notification-centre
Open

ricardovfreixo wants to merge 7 commits into
NativePHP:mainfrom
ricardovfreixo:feat/notification-centre

Conversation

@ricardovfreixo

@ricardovfreixo ricardovfreixo commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closes #71.

Native notification centre

  • Account-scoped multi-select filters and More sheet, including legacy filter migration and all/none states.
  • Per-type native rows, optional quote/image/rank previews, accessible selected/new states, and correct actor/commit/quote targets.
  • Thirty-second foreground polling stages arrivals and updated groups behind a pinned button without moving existing rows.
  • Preserves pagination, expanded groups/cursors, read state and follow-back success/rollback, including staged data.
  • Removes the completed notification-centre roadmap entry.

Log navigation and refresh feedback

  • Already on a feed: one Android Log tap scrolls to exact top and then refreshes Following/Latest/Trending, with accessible loading feedback.
  • Inside a Log thread/comment: Log returns to the ORIGINAL feed instance instead of replacing it. The paired SDK retains native saveable pane state for scroll-position restoration.
  • Feedback is scoped to the active feed and request generation; reverse completion order, late responses after resume, failures and retries cannot clear another request's indicator.
  • iOS reselect wiring is unchanged. Normal cross-tab URL navigation remains intact.

Complete companion delivery

Component Source / status
NativePHP core NativePHP/mobile-air#588 — draft; pinned to f06d13ccc80e597b86600e442a2dd2407ac0ab5e
NativePHP UI NativePHP/mobile-ui#162 — draft; pinned to 28753b7ea337349243330c1f531ed61f386a2c6d
Signed notification quote/image previews dev-null-sh/dev-null.sh#1004 — merge/deployment required for full preview parity
Rank/level metadata dev-null-sh/dev-null.sh#836 — existing independent companion; deployment required

The core/UI refs are public fork refs recorded in composer.json and composer.lock; only those two package records changed. No local path repositories, vendor patches or committed generated Android sources are needed. UI release must follow the matching core interface. Replace the temporary fork pins with upstream versions once the companions are released.

Missing backend metadata degrades honestly, but is not full end-to-end preview parity. The runtime lock and ignored free manifests are not committed; the author's existing PHP 8.5.12 runtime pin was preserved byte-for-byte.

Latest-main conflict refresh

Merged upstream main (9cb4a9e, #77) without rewriting the public branch. Retained the reviewed SDK fork lock entries: core f06d13c already includes upstream's 557de018 change. Upstream's signed 4.2.0-rc.2 binary example is preserved. The author's existing .env, PHP 8.5.12 runtime lock and ignored free manifests were left unchanged. Composer validation and all 50 focused Onboarding/Log checks passed after resolution.

Verification

  • App suite after installing the PUBLIC pinned ZIP archives: 1,297 passed / 12,591 assertions, 1 skipped, 2 deprecated.
  • Core Feature + Unit: 2,157 passed / 6,508 assertions, 4 risky, 5 skipped; coverage not enabled.
  • UI: 407 passed / 1,203 assertions; paired-source harness 23 / 44. UI Kotlin contract checks are source assertions, not native execution.
  • API companion: full composer test previously passed 3,972 tests / 21,963 assertions, 100% code/type coverage, lint and frontend checks.
  • Pint, Composer validation, diff checks and independent reviews passed. Final cross-repo review cleared draft publication with no P0/P1 findings.
  • Temporary local SDK symlinks exposed dependency classes to architecture presets. Normal package directories passed all 5 architecture tests; no rules were weakened.

No native build, JVM tests, Android instrumentation or physical-device verification was executed by the agent. The pane instrumentation test checks saveable-state ownership, not a real feed's pixel offset. This is a draft, not a native-validation claim.

Follow-up: reported Kotlin compile failure

The first user build reported four unresolved references to LocalTopBarColor / LocalTopTabRow in the upstream UI tab-strip renderer. The pinned core does not expose those hooks. UI commit 28753b7 removes the unsupported imports and retains the documented transparent container; no core stubs or other tab behavior were added.

Both locks now pin that public fix. Its two source regression tests passed (red before the fix), the UI suite passed 407 tests, and the app's 26 Log navigation/feedback tests passed. The 1,297-test full app run above predates this Kotlin-only follow-up. Native compilation still awaits the user's rerun; PHP checks are not compiler validation.

Follow-up: Onboarding missing-file startup race

The next user build reached PHP but failed including Flysystem's PortableVisibilityConverter.php. The file was verified in the host, staging directory, bundle ZIP, APK's nested bundle and the exact device include path. Device error time was 12:50:30.192 UTC; the file was rewritten at 12:50:30.676 UTC, about 485 ms later.

Core commit f06d13c closes the source-confirmed race: an initializer could check persistent-runtime state before waiting on extractionLock, then re-extract DEBUG's laravel/ directory after another initializer booted PHP. Both foreground and background initializers now recheck under the SAME lock used by persistent boot, before extraction/artisan work. No credentials, persisted data or key-store implementation were changed.

Six source-contract regressions pass; a production-helper two-thread JVM test is included but unrun. Core PHP suites pass 2,157 tests, independent review is clear, and 50 app Onboarding/Log tests pass. Both locks pin the public fix. The installed and generated Kotlin files have been updated locally; the author only needs to rerun native:run android, not reinstall/clear app data. Native compile/cold-start verification for this latest guard still remains user-run.

Reproduce / Android test

Fresh checkout: use the README's normal or free setup. The normal manifest includes the paid secure-storage plugin. The existing author checkout already has composer.free.json / composer.free.lock updated to the same public refs; do not rerun first-install scripts that regenerate .env/keys on an existing installation.

For the existing free setup:

COMPOSER=composer.free.json composer install

Regenerate the Android shell so the new CORE Kotlin files are included; hot reload is insufficient. Back up any custom files under nativephp/android first: the installer replaces that generated directory. The author must run these commands manually:

COMPOSER=composer.free.json php -d memory_limit=1G artisan native:install android
COMPOSER=composer.free.json php -d memory_limit=1G artisan native:run android

Use Java 21 and the configured Android SDK. Keep host/bundled PHP minor versions aligned and inspect any installer-induced runtime-lock changes; do not commit the author's local runtime pin. The 1G override is required for the host build and does NOT change on-device PHP memory.

Outstanding gates

  • Native compile; prepared core JVM suites (BottomTabTapDecisionTest, NativeScrollTargetRegistryTest, ScreenTokensTest) and pane instrumentation (ScreenTokenPaneStateTest).
  • On each feed, one Log tap scrolls to top AND refreshes; indicator settles after success/failure, repeated taps and idle.
  • Scroll deep, open a commit, post a reply (view focuses it), then tap Log: return to the same feed at the previous index AND pixel offset. Repeat through multiple nested screens.
  • During scroll-to-top, change feed/tab or push/return a child: no abandoned callback; pager drag/settle availability is correct.
  • Fresh same-URI replacement starts fresh; saved state does not leak between mounts/accounts.
  • Chip/pill layout, tap-through and hidden-state TalkBack behavior.
  • Notification filter persistence, group expansion/older pages, targets, staged arrivals, follow rollback, offline/retry and unread markers.
  • Quote/image/rank previews against a backend with BOTH API companions deployed.
  • Attach screenshot/recording per CONTRIBUTING.md before marking ready for merge.

Explicit non-claims / separate work

@ricardovfreixo
ricardovfreixo marked this pull request as ready for review October 23, 2026 13:32

@simonhamp simonhamp left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Tried this on a Moto g24: a Debug build of this branch merged onto current main, with #588 and #162 merged into main's SDK branches.

The new "Refreshing…" chip shows up in more places than the description says:

  • Switching between Following, Latest and Trending. switchTo() calls openAfresh(), which now calls open(feedback: true). Switching used to be quiet. Now every switch puts the chip up until the fetch lands, which takes a few seconds on Trending because it re-ranks.
  • Pull to refresh. load() passes feedback: true, so a pull shows the chip on top of the list's own pull spinner. That's two spinners for one refresh.
  • Re-tapping the Log tab through refreshLog(). This is the case the PR is about, and the chip makes sense there because nothing else shows that a refresh started.

Could the feedback be limited to the tab re-tap? openAfresh() would go back to plain open(), load() would stop passing feedback, and refreshLog() would ask for it instead, for example with a load(feedback: true). iOS doesn't have the reselect wired, so the chip would never show there, which matches how the Log behaved before.

If the chip is on pulls because Android's pull spinner runs for a fixed 1.5s and doesn't wait for the request, that's better fixed in mobile-ui's ListRenderer than with a second indicator in the app.

It also shows up in the middle of the screen on iOS.

I'm not sure we need it at all on either platform.

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.

Bring the native notification centre in line with the web

2 participants