Skip to content

Merge the #30 review fixes into main - #14

Merged
Bombatomica64 merged 3 commits into
mainfrom
main-night-mode-review
Oct 13, 2026
Merged

Bombatomica64 merged 3 commits into
mainfrom
main-night-mode-review

Conversation

@Bombatomica64

Copy link
Copy Markdown
Owner

Brings longbridge#30's review fixes (fa0075b) into main so the lab can pin them: night mode synced in open_window / reinit_window, read from the host Activity's Resources, host::configuration_changed(ui_mode), and window_appearance answered from a cached value.

Conflicts with main's JNI refactor and insets work are resolved as in the test merge that ran on the phone (cold start dark, live toggle, resume, app-local dark). The lab builds against it (cargo clippy --target aarch64-linux-android).

Breaking for hosts: configuration_changed now takes newConfig.uiMode.

🤖 Generated with Claude Code

Bombatomica64 and others added 3 commits October 12, 2026 13:06
The host-driven entry point has no AndroidApp, and night mode was only read
through its AssetManager, so a host-driven window stayed Light whatever the
system used. Platform::window_appearance always answered Dark on either
path.

Night mode is now read from the application context's Resources when there
is no AndroidApp. The first set_host_activity keeps that context for the
life of the process. Its configuration follows system-wide changes whatever
the Activity in front handles itself, whereas an Activity that handles
uiMode keeps a stale configuration in its AssetManager. The host path
applies it when a window first opens, when a recreated Activity's surface
is attached, on resume, and, for every host's window, from the new
host::configuration_changed(), which an Activity that handles uiMode must
call from onConfigurationChanged. window_appearance reports the same night
mode.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review fixes for longbridge#30:

- AndroidPlatform::open_window and the new reinit_window apply the night
  mode, so the android-activity InitWindow path no longer starts Light
  while window_appearance says Dark. host.rs drops its call-site syncs.
- The host path reads uiMode from the current host Activity's Resources,
  which carry an app-local night mode (AppCompatDelegate). The application
  context is no longer kept; the AssetManager is fetched as on main.
- host::configuration_changed takes newConfig.uiMode, so it does not
  depend on when the process configuration is updated.
- The platform stores the appearance it last applied. window_appearance
  returns it with no JNI call, and agrees with every window's appearance.
  It has its own lock: GPUI reads it from main-thread tasks, which
  flush_main_thread_tasks() runs with the platform state locked. A config
  change reads the night mode once for all windows.
- A failed uiMode read logs a warning instead of silently meaning Light.
  It runs in a local frame, since the render thread never returns to Java.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	src/android/host.rs
#	src/android/jni.rs
#	src/android/platform.rs
@Bombatomica64
Bombatomica64 merged commit e12e14d into main Oct 13, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T13:58:34.500865Z aef4403 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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.

1 participant