@devries-cameron20 / t3code Mirror · read-only / commits / 86ac54512a
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 23, 08:00 UTC

fix(android): fold tracking starts late and hinge retargets keep the edge (#20403)

Alex committed Oct 16, 2026 at 15:44 UTC 86ac54512ad5735cba6273141416afaa51168348
2 files changed +28 -7
apps/mobile/modules/t3-native-controls/android/src/main/java/expo/modules/t3nativecontrols/T3FoldPostureModule.kt
+7
@@ -52,6 +52,12 @@ class T3FoldPostureView(
52
53 override fun onAttachedToWindow() {
54 super.onAttachedToWindow()
55 + observeFold()
56 + }
57 +
58 + // The activity can be missing when the view first attaches, so layout passes retry.
59 + private fun observeFold() {
60 + if (scope != null || !isAttachedToWindow) return
61 val activity = appContext.currentActivity ?: return
62 scope = MainScope().also { scope ->
63 scope.launch {
@@ -75,6 +81,7 @@ class T3FoldPostureView(
81
82 override fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int) {
83 super.onLayout(changed, left, top, right, bottom)
84 + observeFold()
85 if (changed) report()
86 }
87
apps/mobile/src/features/layout/AdaptiveWorkspaceLayout.tsx
+21 -7
@@ -504,7 +504,8 @@ function AdaptiveWorkspaceLayoutContent(
504 sidebarVisible: panes.primarySidebarVisible,
505 width: contentTargetWidth,
506 listPaneTarget: layout.listPaneWidth,
507 - listPaneFrom: layout.listPaneWidth,
507 + listPaneFloor: layout.listPaneWidth,
508 + listPaneCeiling: layout.listPaneWidth,
509 revision: 0,
510 });
511 if (
@@ -537,21 +538,34 @@ function AdaptiveWorkspaceLayoutContent(
538 ? Math.max(contentSizing.width ?? 0, contentTargetWidth ?? 0)
539 : contentTargetWidth,
540 listPaneTarget: layout.listPaneWidth,
540 - // While a hinge resizes the list, its width follows the pane edge between these two.
541 - listPaneFrom: resizingSidebar ? contentSizing.listPaneTarget : layout.listPaneWidth,
541 + // While a hinge resizes the list, its width follows the pane edge within this span. A
542 + // retarget mid-animation widens the span, since the edge is still somewhere inside it.
543 + listPaneFloor: resizingSidebar
544 + ? Math.min(contentSizing.listPaneFloor ?? 0, layout.listPaneWidth ?? 0)
545 + : layout.listPaneWidth,
546 + listPaneCeiling: resizingSidebar
547 + ? Math.max(contentSizing.listPaneCeiling ?? 0, layout.listPaneWidth ?? 0)
548 + : layout.listPaneWidth,
549 revision: contentSizing.revision + 1,
550 });
551 }
552 const settleContentWidth = useCallback((revision: number) => {
553 setContentSizing((current) =>
554 current.revision !== revision ||
548 - (current.width === current.target && current.listPaneFrom === current.listPaneTarget)
555 + (current.width === current.target &&
556 + current.listPaneFloor === current.listPaneTarget &&
557 + current.listPaneCeiling === current.listPaneTarget)
558 ? current
550 - : { ...current, width: current.target, listPaneFrom: current.listPaneTarget },
559 + : {
560 + ...current,
561 + width: current.target,
562 + listPaneFloor: current.listPaneTarget,
563 + listPaneCeiling: current.listPaneTarget,
564 + },
565 );
566 }, []);
553 - const listPaneFloor = Math.min(contentSizing.listPaneFrom ?? 0, layout.listPaneWidth ?? 0);
554 - const listPaneCeiling = Math.max(contentSizing.listPaneFrom ?? 0, layout.listPaneWidth ?? 0);
567 + const listPaneFloor = contentSizing.listPaneFloor ?? 0;
568 + const listPaneCeiling = contentSizing.listPaneCeiling ?? 0;
569 const contentSettledWidth = Platform.OS === "android" ? contentSizing.width : contentTargetWidth;
570 const contentRevision = contentSizing.revision;
571