Commit 04479f8
Fix UTI overlap with AppTP banner on empty NTP (#9111)
Task/Issue URL:
https://app.asana.com/1/137249556945/project/1214157224317277/task/1216262051862322
Tech Design URL (if applicable):
### Description
When AppTP is enabled and the New Tab Page has no favourites, the native
input widget (UTI) overlapped the AppTP banner. Adding a favourite hid
the overlap.
Root cause: `NativeInputLayoutCoordinator` skips the top content offset
when the NTP is "logo only", so the dax logo stays centred instead of
shifting with the widget height. `isLogoOnly` treated a visible logo as
"logo only", but the logo is shown whenever there are no
favourites/shortcuts — other sections that render *above* it (AppTP
banner, Indonesia message, RMF card) can be present too. The favourites
case was already handled because favourites hide the logo.
Fix: the page is treated as logo-only only when none of that
above-the-logo content is visible. Those section containers stay
attached and collapse to zero height when empty, so height (not just
visibility) is checked to avoid pinning the logo on a plain new tab. The
offset is now applied and the banner clears the widget.
Note: the New Tab Page actually running is `NewTabPageView`
(`view_new_tab.xml`), not the configurable variant; the configurable
variant's `newTabSectionsContent` is also covered for completeness.
### Steps to test this PR
_AppTP banner no longer behind the UTI_
- [ ] Enable App Tracking Protection
- [ ] Open a New Tab with no favourites and top omnibar (no return hatch
present)
- [ ] Verify the "App Tracking Protection is enabled…" banner renders
fully below the input widget (header not clipped)
- [ ] Add a favourite, remove it — banner still clears the widget in
both states
_No regression on a plain new tab_
- [ ] With AppTP disabled and no favourites, confirm the dax logo stays
centred and does not shift between the Search and Duck.ai tabs
### UI changes
| Before | After |
| ------ | ----- |
| <img width="1344" height="2992" alt="before_banner_clipped"
src="https://github.com/user-attachments/assets/4b63bcd7-3596-4024-a135-4c58303d15e8"
/> | <img width="1344" height="2992" alt="after_banner_below_widget"
src="https://github.com/user-attachments/assets/88cf22ed-5ec2-4caa-859c-6ae94c03ad5f"
/>) |
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Localized NTP layout/padding logic with unit tests; no auth, data, or
broad architectural changes.
>
> **Overview**
> Fixes the native input widget overlapping the App Tracking Protection
banner (and similar NTP sections) when the new tab shows the centered
dax logo with no favourites.
>
> **`NativeInputLayoutCoordinator`** no longer treats the page as “logo
only” when above-the-logo content is present. It caches
`appTrackingProtectionStateView`, `indonesiaNewTabSectionView`, and
`messageCta`, and sets `sectionsVisible` when any is visible with
`height > 0` (empty containers stay attached at zero height).
**`isLogoOnly`** gains a `sectionsVisible` argument so top padding
offset runs and those sections clear the widget, while a plain logo-only
tab still skips offset.
>
> Comment-only edits in the coordinator shorten existing documentation.
**`LogoOnlyContentTest`** updates call sites and adds a case for visible
sections.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
db6921b. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>1 parent 92732c6 commit 04479f8
2 files changed
Lines changed: 42 additions & 47 deletions
File tree
- app/src
- main/java/com/duckduckgo/app/browser/nativeinput
- test/java/com/duckduckgo/app/browser/nativeinput
Lines changed: 31 additions & 42 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
50 | 48 | | |
51 | 49 | | |
52 | 50 | | |
| |||
178 | 176 | | |
179 | 177 | | |
180 | 178 | | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
| 179 | + | |
| 180 | + | |
185 | 181 | | |
186 | 182 | | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
187 | 190 | | |
188 | 191 | | |
189 | 192 | | |
190 | 193 | | |
191 | 194 | | |
192 | 195 | | |
193 | 196 | | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
199 | 200 | | |
200 | 201 | | |
201 | 202 | | |
| |||
227 | 228 | | |
228 | 229 | | |
229 | 230 | | |
230 | | - | |
| 231 | + | |
| 232 | + | |
231 | 233 | | |
232 | 234 | | |
233 | 235 | | |
| |||
261 | 263 | | |
262 | 264 | | |
263 | 265 | | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
270 | 269 | | |
271 | 270 | | |
272 | 271 | | |
| |||
292 | 291 | | |
293 | 292 | | |
294 | 293 | | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
304 | 298 | | |
305 | 299 | | |
306 | 300 | | |
| |||
375 | 369 | | |
376 | 370 | | |
377 | 371 | | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
| 372 | + | |
| 373 | + | |
387 | 374 | | |
388 | | - | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
389 | 378 | | |
390 | | - | |
391 | | - | |
| 379 | + | |
| 380 | + | |
Lines changed: 11 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
46 | 52 | | |
47 | 53 | | |
0 commit comments