Repository navigation
fix(ios): start opened iPhone Duo panes beside the status cluster - #281
Conversation
On an opened iPhone Duo the clock and status icons sit in one corner, but the safe area still reserves their full height across the whole top edge, so every pane's header started far below the top (about 82-95pt). The runner now reports the live top occlusion geometry (safe top, status bar bottom and the active occlusion regions) over the geometry channel. When that inset comes only from a corner cluster, side-by-side panes start on a shared 24pt band and header controls keep 8pt clear of the cluster. Settings in two columns follows the same band, so both titles stay level and each column's colour runs to the top edge. The closed Duo, other iPhones, iPad and platforms without the method keep their previous insets.
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0c012ad989
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| final top = | ||
| widget.enabled && | ||
| data != null && | ||
| (media.padding.top - data.safeTop).abs() <= 1 | ||
| ? data.compactTop |
There was a problem hiding this comment.
Normalize native geometry to the scaled Flutter viewport
On an opened Duo with a non-default Interface Size preference, this comparison prevents the compact band from activating: main.dart places HorizontalSafeViewport inside ScaledAppView, which divides MediaQuery.padding by interfaceScale, whereas data.safeTop remains in native window points. For example, an 88pt native inset becomes 80 logical pixels at scale 1.1, failing the one-pixel tolerance and retaining the oversized top gap this change addresses. Normalize the native geometry into the pane's coordinate system before comparing and measuring it; the horizontal measurement also mixes the transformed localToGlobal origin with the untransformed box.size.
Useful? React with 👍 / 👎.
| // panels below it keep the full width. | ||
| padding: | ||
| const EdgeInsets.symmetric(horizontal: 14) + | ||
| TopClusterInsets.of(context), | ||
| child: Row( |
There was a problem hiding this comment.
Clear the cluster for panels below the chat toolbar
When the corner cluster extends below the toolbar, reserving horizontal clearance only for this row leaves the following controls underneath system chrome. At the default interface scale, the new 24pt band plus the default 48pt chat toolbar puts _chatTranslationPanel() at y=72, while the opened-Duo cluster described in this commit reaches approximately 82–95pt. ChatTranslationPanel places its language and dismiss buttons at the right edge of that 40pt row, so a right-corner cluster overlaps those controls. Apply clearance to subsequent rows that still intersect the occlusion region, or keep them below its bottom, rather than assuming everything below the toolbar is clear.
Useful? React with 👍 / 👎.
Automated PR reviewHead: Review unavailable: Incomplete model answer (length); manual review required. Remaining gates
No PR code runs with the model key or write token. Free-only routing; provider/rate-limit failures never authorize a merge. Existing review findings must be resolved, not hidden by a new recommendation. |
The interface size screen's header uses the same corner-cluster padding as the other headers. It was missing from this PR and landed in #284 instead.
headerChromePaddingOf comes from the Duo top padding change (#281); this PR keeps the existing header inset so it builds on its own.
Change
On an opened iPhone Duo the clock and status icons sit in a cluster in one corner, but the window's safe area still reserves the cluster's full height across the whole top edge. Every pane's header therefore started far below the top (about 82-95pt), which looked like oversized top padding.
AppDelegate.swiftanswers a newtopOcclusionGeometrycall on the existing geometry channel with the window's safe top, the status bar bottom and the active occlusion regions (UIView.reservedRegions, behind the existingMITHKA_HAS_RESERVED_REGIONScondition inDuo.xcconfig).lib/app/top_corner_cluster.dartdecides when that inset comes only from a corner cluster. Then side-by-side panes start on a shared 24pt band, and header controls keep 8pt clear of the cluster (TopClusterInsets,headerChromePaddingOf).HorizontalSafeViewportreads the geometry again after the window settles (600ms), because the cluster moves after the device opens or turns.MissingPluginException) keep their previous insets.preferredVerticalBarBehavior .disabledfrom 8fa2c1e is unchanged.Affected platform: iOS (iPhone Duo opened). No user-visible change elsewhere.
Related PRs and canonical PR (or
None; existing PRs checked): this is the canonical PR for this change. Open and recently closed PRs were checked; none covers it. It ships alongside #282, #283 and #284, which are independent fixes from the same request. Each touches different code and is useful alone.Telegram API Terms classification
Follow the contribution and agentic review rules. Select exactly one classification and explain it below.
This is an agentic source-code review classification. Every store version must remain compliant with applicable Telegram API Terms; the guarded-source exception does not apply to store distribution or review.
allowTelegramTosViolations(I_DONT_FUCKING_CARE_ABOUT_TOS), disabled in official builds, and available only in an explicitly enabled self-build.Reason and affected Telegram behavior:
Layout-only change to header insets; no Telegram API usage or behavior changes.
Basic checks (every PR)
Check each item after verification. If a check is inapplicable, explain why in the evidence below before checking it.
dart format --output=none --set-exit-if-changed lib test integration_test test_driver.flutter analyze.flutter test --concurrency=4.Commands, results, platform/build/UI evidence, and reasons for inapplicable checks:
dart format --output=none --set-exit-if-changed lib test integration_test test_driverwith the Dart 3.12.2 SDK from Flutter 3.44.2: 0 changed.dart analyze --fatal-infos(the same analysis server and rulesflutter analyzeuses, Flutter 3.44.2 SDK): No issues found on this branch alone and on all four PRs combined.flutter testcould not run in the authoring sandbox (Alpine/musl host), so the tests box stays unchecked until Quality CI reports on this PR head. No new tests were added, at the maintainer's request.main_tab_view.dartand amath.maxtear-off intop_corner_cluster.dart. They do not change behavior.I_DONT_FUCKING_CARE_ABOUT_TOS=false). Together the four branches match the tested source, apart from two lint-only edits in fix(ios): start opened iPhone Duo panes beside the status cluster #281.Section 1.4 exception checks
Not applicable: compliant change, no guarded behavior.
--dart-define=I_DONT_FUCKING_CARE_ABOUT_TOS=false, the feature is absent and ordinary Telegram behavior remains intact.--dart-define=I_DONT_FUCKING_CARE_ABOUT_TOS=true, the feature works through the guarded entry points in a self-build; I included relevant test and build/UI evidence.falseand have no option that enables it. All store versions remain compliant with applicable Telegram API Terms.Guard locations and evidence for each flag variant: Not applicable.
Agentic reviewer confirmation
Agentic code reviewer only: record this confirmation in the PR review or check these boxes before approval.