Skip to content

Commit 1e7249b

Browse files
authored
fix incorrect overlap in duck.ai webview below the widget (#8571)
Task/Issue URL: https://app.asana.com/1/137249556945/project/1212608036467427/task/1214598987399330?focus=true, https://app.asana.com/1/137249556945/project/1212608036467427/task/1214707942438120?focus=true ### Description Widget and duck.ai webview now don't have an extra overlap. ### Steps to test this PR - open duck.ai in native-input widget mode. - observe terms and conditions are shown without a cutoff. - observe a long conversation not cutoff at the end. ### UI changes <img width="400" height="900" alt="test" src="https://github.com/user-attachments/assets/1879ff7f-1868-4612-8438-a400045bab72" /> <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk UI-only change that adjusts padding/offset calculations; main risk is minor layout regressions on bottom-positioned widget modes across devices. > > **Overview** > Fixes an incorrect extra overlap beneath the native-input DuckAI widget by removing the hardcoded `overlap` dimension and simplifying `computeDeltaBottom()` to use the current `widgetView.height` when the widget is bottom-aligned. > > This changes how bottom padding is applied to `browserLayout`/NTP content so web content (e.g., DuckAI WebView terms and long conversations) is no longer cut off under the widget. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit f175d6c. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 781b3cf commit 1e7249b

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

app/src/main/java/com/duckduckgo/app/browser/nativeinput/NativeInputLayoutCoordinator.kt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,6 @@ class NativeInputLayoutCoordinator(
176176
if (targets.isEmpty()) return
177177
val anchor = widgetView.findViewById(R.id.inputModeWidgetCard) ?: widgetView
178178

179-
val overlap = widgetView.resources.getDimensionPixelSize(com.duckduckgo.mobile.android.R.dimen.keyline_5)
180-
181179
// Animate child reflows when the widget toggles Search ↔ DuckAI changes our padding.
182180
// The transition is staged here but only assigned to the parent once the enter animation
183181
// completes (see enableContentLayoutTransition). Otherwise the per-frame setPadding
@@ -224,11 +222,7 @@ class NativeInputLayoutCoordinator(
224222

225223
fun computeDeltaBottom(): Int {
226224
if (!isBottom) return 0
227-
return if (omnibarState.isOmnibarBottom()) {
228-
maxOf(0, overlap)
229-
} else {
230-
maxOf(0, anchor.height - overlap)
231-
}
225+
return maxOf(0, widgetView.height)
232226
}
233227

234228
fun applyOffsetWithBottom(anchorBottomInWindow: Int) {

0 commit comments

Comments
 (0)