Commit cdc2625
Fix issue where context is not attach on first use (#7790)
Task/Issue URL:
https://app.asana.com/1/137249556945/project/1211654189969294/task/1213386554167128?focus=true
### Description
On first time use the page content is not attached.
Repro steps:
* fresh install and go through onboarding to get to the point where
contextual can be used
* go to eg. bbc.com and tap on duck.ai icon to open the contextual sheet
* sheet opens and shows the first time run
* "attach page content" placeholder is shown alongside the chip
suggestions
* tap on the "summarize" suggestion chip OR tap on placeholder
* Expected: content is attached
* ❌ Actual: content is NOT attached
### Steps to test this PR
The following repro steps should now work
Repro steps:
* fresh install and go through onboarding to get to the point where
contextual can be used
* go to eg. bbc.com and tap on duck.ai icon to open the contextual sheet
* sheet opens and shows the first time run
* "attach page content" placeholder is shown alongside the chip
suggestions
* tap on the "summarize" suggestion chip OR tap on placeholder
* Expected: content is attached
* ❌ Actual: content is NOT attached
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Small, localized change to when a JS subscription event is emitted;
main risk is timing/regression in contextual sheet analytics or
page-context attachment triggering.
>
> **Overview**
> Fixes first-run Duck.ai contextual mode not attaching page content by
triggering page-context collection when the contextual bottom sheet is
shown.
>
> Moves the page-context subscription event send out of the omnibar
click path into a new `BrowserTabViewModel.collectPageContext()` called
from `BrowserTabFragment.showDuckChatContextualSheet`, and adds unit
tests to verify the event is emitted only when explicitly collecting
context (and not during onboarding).
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
7f779d0. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: David González <malmstein@gmail.com>1 parent 18f8275 commit cdc2625
File tree
3 files changed
+40
-4
lines changed- app/src
- main/java/com/duckduckgo/app/browser
- test/java/com/duckduckgo/app/browser
3 files changed
+40
-4
lines changedLines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3431 | 3431 | | |
3432 | 3432 | | |
3433 | 3433 | | |
| 3434 | + | |
| 3435 | + | |
3434 | 3436 | | |
3435 | 3437 | | |
3436 | 3438 | | |
| |||
Lines changed: 7 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4692 | 4692 | | |
4693 | 4693 | | |
4694 | 4694 | | |
| 4695 | + | |
| 4696 | + | |
| 4697 | + | |
| 4698 | + | |
| 4699 | + | |
| 4700 | + | |
| 4701 | + | |
4695 | 4702 | | |
4696 | 4703 | | |
4697 | 4704 | | |
| |||
4711 | 4718 | | |
4712 | 4719 | | |
4713 | 4720 | | |
4714 | | - | |
4715 | | - | |
4716 | | - | |
4717 | | - | |
4718 | 4721 | | |
4719 | 4722 | | |
4720 | 4723 | | |
| |||
Lines changed: 31 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8857 | 8857 | | |
8858 | 8858 | | |
8859 | 8859 | | |
| 8860 | + | |
| 8861 | + | |
| 8862 | + | |
| 8863 | + | |
| 8864 | + | |
| 8865 | + | |
| 8866 | + | |
| 8867 | + | |
| 8868 | + | |
| 8869 | + | |
| 8870 | + | |
| 8871 | + | |
| 8872 | + | |
| 8873 | + | |
| 8874 | + | |
| 8875 | + | |
| 8876 | + | |
| 8877 | + | |
| 8878 | + | |
| 8879 | + | |
| 8880 | + | |
| 8881 | + | |
| 8882 | + | |
| 8883 | + | |
| 8884 | + | |
| 8885 | + | |
| 8886 | + | |
| 8887 | + | |
| 8888 | + | |
| 8889 | + | |
| 8890 | + | |
8860 | 8891 | | |
8861 | 8892 | | |
8862 | 8893 | | |
| |||
0 commit comments