Skip to content

feat(adaptive): upgrade compose BOM and adaptive multi-window support - #6891

Open
SeniorZhai wants to merge 6 commits into
masterfrom
feat/adaptive-quality-compose-1-13
Open

SeniorZhai wants to merge 6 commits into
masterfrom
feat/adaptive-quality-compose-1-13

Conversation

@SeniorZhai

Copy link
Copy Markdown
Member

No description provided.

Keep the landing indicator clear of the bottom buttons on short windows, stop locking orientation for capture, avatar, gallery and web fullscreen exit, skip sensor rotation on large or multi-window media pages, drop the legacy max_aspect meta-data and unused accompanist dependencies.
Manage Compose artifacts through compose-bom 2026.09.00, replace all constraintlayout-compose layouts with standard Compose layouts and remove the dependency, and migrate value-based BasicTextField, Material 2 TextField/OutlinedTextField, and VisualTransformation usages to TextFieldState with InputTransformation/OutputTransformation.
Raise targetSdk to 37 with ACCESS_LOCAL_NETWORK permission handling for LAN transfer and read-only dynamically loaded native libraries, replace app-window physical screen size calls with window metrics, move video preview pause/resume to onStart/onStop for multi-resume continuity, and preserve non-sensitive Compose interactive state with rememberSaveable.
…pport

Add BOM-managed Material 3 with a coexisting MixinAppTheme ColorScheme bridge, migrate five setting pages as the reference module, and add hardware keyboard shortcuts (Enter to send, Shift+Enter newline, Ctrl+F search, Esc to dismiss panels), toolbar tooltips, and mouse context-click on message items.
@gaotic

gaotic Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

AI review done for f3ac88d in 16m 54s · 9 comments

Quality: Needs fixes before merge. Source review confirmed a compile blocker and several regressions, with runtime verification limited to isolated checks.

Role Model Status
Reviewer Grok grok-4.7-build · effort medium ok
Reviewer Codex codex/gpt-6.2-sol · effort high ok
Summary Codex codex/gpt-6.2-sol · effort medium ok

@gaotic gaotic Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

AI review · Grok + Codex · 0753147

Request changes. The diff whitespace check, manifest and landing XML parsing, and resize calculations passed. The offline Kotlin compile stopped before project evaluation because Gradle could not open its file-lock socket.

binding.titleView.leftIb.setOnClickListener {
onBackPressed()
}
if (Build.VERSION.SDK_INT >= 37 &&

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

On Android 17, a desktop transfer command delivered through onNewIntent() while the local-network prompt is open can reach Socket() or ServerSocket before permission is granted. The grant callback runs setupTransfer(), which only reads the original launch intent, so it never retries the early command. Defer incoming commands until permission is granted and drain them through the same path as the launch command.

val context = LocalContext.current
val prefs = remember { context.getSharedPreferences(PREF_NAME, Context.MODE_PRIVATE) }
var query by remember { mutableStateOf("") }
var query by rememberSaveable { mutableStateOf("") }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

After recreation, the wallet picker restores the visible query while the fragment's searchQuery flow starts at "". The field already matches the restored query, so its collector never forwards it and the list stays unfiltered until the next edit. Use one saved query for both the field and the search flow.

messageItem.mediaHeight > context.screenHeight() * 3 ||
messageItem.mediaWidth > context.screenWidth() * 3 ||
messageItem.mediaHeight > context.windowHeight() * 3 ||
messageItem.mediaWidth > context.windowWidth() * 3 ||

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The window-relative threshold can make ordinary photos open cropped in both the regular and transcript pagers. A 2000×2500 photo under 5 MiB switches from PhotoView to LargeImageView on a 1080×1920 display when opened in a 540×600 window. The tiled view fits the width, rendering 675 pixels of image height in a 600-pixel viewport. Keep the large-image threshold independent of the current window and use window bounds to size the selected view.

binding.featureIndicator.height - 16.dp
val target = minOf((height * percent).toInt(), available).coerceAtLeast(0)
if (params.height != target) {
params.height = target

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

When the landing window shrinks enough for target to reach zero, params.height = 0 reactivates the XML's 50% match-constraint height. The carousel grows from a small capped height and can cover Create Account. Hide the carousel and indicator when there is no room, then restore them when space returns.

if (keyCode == KeyEvent.KEYCODE_F && event?.isCtrlPressed == true) {
val conversationListFragment = findFragmentByTagTyped<ConversationListFragment>(NavigationController.ConversationList.tag)
if (conversationListFragment != null && conversationListFragment.isAdded && conversationListFragment.isVisible) {
conversationListFragment.openSearch()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pressing Ctrl+F again during conversation search erases the current query because openSearch() clears the text field. If search is already open, focus the existing field and preserve its text.

val latestValue by rememberUpdatedState(value)
val latestOnValueChange by rememberUpdatedState(onValueChange)

LaunchedEffect(value) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Replacing an uppercase referral-code letter with its lowercase equivalent leaves the lowercase letter on screen while Review submits the uppercase code. The callback uppercases the edit back to the existing value, so LaunchedEffect(value) never runs again. Normalize referral edits with an InputTransformation so the field and submitted value stay in sync.

@gaotic gaotic Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

AI review · Grok + Codex · f3ac88d

Request changes. Both diff whitespace checks and XML parsing passed, and isolated probes reproduced the rapid-edit mismatch and image crop geometry. Offline Kotlin compilation stopped before project evaluation because Gradle could not open its file-lock socket.


val code = PendingReferralStore.get(this) ?: return
InputReferralBottomSheetDialogFragment
.newInstance(defaultValue = code, clearPendingOnDismiss = true)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This referral wiring blocks compilation. The checkout has no definition of PendingReferralStore, and the dialog factory accepts only defaultValue. Include the matching store and dialog changes or remove the pending-referral wiring from this PR.

if (ctx is Activity || ctx is InputMethodService || ctx is Application) {
return ctx
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R && ctx.isUiContext) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This guard calls isUiContext on Android 11, where the method is hidden. A wrapped context, such as the one passed by the group-call member sheet, reaches this call before the helper unwraps it to the activity and can throw NoSuchMethodError. Guard the call with API 31 and keep unwrapping on API 30. citeturn763945view2turn733263view1turn489941view6

}
intent.getParcelableExtraCompat(ARGS_COMMAND, TransferCommand::class.java)?.apply {
handleCommand(this)
withLocalNetworkPermission {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The launch command now waits for local-network permission, but onNewIntent() still calls handleCommand() directly. A desktop command arriving during the Android 17 prompt can start socket work before the grant, and the grant callback never replays it. Route both entry points through the same permission gate and dispatch pending commands after the grant.

}
LaunchedEffect(state) {
snapshotFlow { state.text.toString() }.collect { current ->
if (current != lastExternalValue) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

If the collector sees btc → btcx → btc before the btcx echo is applied, it drops the final btc because it still matches lastExternalValue. The echo then leaves the field showing btc while the wallet filter uses btcx. Compare edits against the latest pending emission as well as the last applied external value, or use a single query state for both.

val context = LocalContext.current
val prefs = remember { context.getSharedPreferences(PREF_NAME, Context.MODE_PRIVATE) }
var query by remember { mutableStateOf("") }
var query by rememberSaveable { mutableStateOf("") }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

After recreation, both wallet pickers restore the visible query while their search flows start empty. The field already matches the restored value, so no change is emitted and the list stays unfiltered until the next edit. Drive the field and filter from the same saved query.

messageItem.mediaHeight / messageItem.mediaWidth.toFloat() > context.displayRatio() * 1.5f ||
messageItem.mediaHeight > context.screenHeight() * 3 ||
messageItem.mediaWidth > context.screenWidth() * 3 ||
messageItem.mediaHeight > context.windowHeight() * 3 ||

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The window-based cutoff makes a 2000×2500 photo under 5 MiB switch to the tiled viewer in a 540×600 window. Width fitting makes the image 675 px tall, so the initial view is cropped. The transcript pager uses the same cutoff. Keep viewer selection independent of window size and use the window bounds to lay out the selected viewer.

val available = binding.createTv.top - params.bottomMargin - indicatorParams.topMargin -
binding.featureIndicator.height - 16.dp
if (available <= 0) {
binding.featurePager.isVisible = false

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The no-space branch hides the carousel but leaves its paging dots visible and tappable. The layout anchors the dots below the collapsed pager, where they can overlap Create Account in a short window. Hide both together and restore both when there is room.

supportFragmentManager.findFragmentByTag(ConversationCircleEditFragment.TAG) != null
val conversationListFragment = findFragmentByTagTyped<ConversationListFragment>(NavigationController.ConversationList.tag)
if (!hasOverlay && conversationListFragment != null && conversationListFragment.isAdded && conversationListFragment.isVisible) {
conversationListFragment.openSearch()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Ctrl+F still reaches openSearch() while the main conversation search is active, and MaterialSearchView.openSearch() clears the field. If search is already open, focus the existing field and preserve the query.

val pendingEmissions = remember { ArrayDeque<String>() }
var lastExternalValue by remember { mutableStateOf(value) }

LaunchedEffect(value) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Replacing an uppercase referral-code letter with its lowercase equivalent leaves the lowercase letter visible while Review submits the uppercase code. The callback uppercases the edit back to the existing value, so LaunchedEffect(value) never reruns. Normalize referral edits with an InputTransformation so the field and submitted code agree.

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