Repository navigation
Merge the #30 review fixes into main - #14
Merged
Merged
Conversation
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
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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), andwindow_appearanceanswered 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_changednow takesnewConfig.uiMode.🤖 Generated with Claude Code