Commit Graph

155 Commits (105a2e5fc68c6d5bbd1aeeb45b346e2667965f9d)

Author SHA1 Message Date
Matt Tighe fee26e62a8 Fixes #22688: remove inactive_tabs_recently_closed probe 3 years ago
mcarare b4bf7abfb3 For #22784: Show collection snackbar only if fragment is still attached. 3 years ago
Jonathan Almeida 01ba8959ce Issue #22757: Check the parent cast to AbstractBrowserTrayList first
We re-use the same ViewHolders in search term groups, so when we need to
cast to a AbstractBrowserTrayList for tab reordering, we need to check
our parent correctly first.
3 years ago
Christian Sadilek 6637f61088
Support tab movement/reordering (#22751)
* Adds basic support for tab reordering via drag-and-drop selected tabs

* ktlint/detekt formatting

* Use defaultTabsFilter (now not private) instead of getter

* Convert from position+filter API to target+placeAfter
Unfortunately I still need the filter passed around a bit

* Handle inactive tabs' holder being children of the RecyclerView of the normal tabs
Don't go through LayoutManager needlessly

* Non-working use tabID the whole way. Does not compile.

* Fix to do direct tab ID and use grid setting directly

* Remove non-null assertion. Now fully works for "other" tabs.

* Prevent grouped tabs from being dragged

* Remove unused import

* Add/fix comments

* Do API version check and use deprecated startDrag if too old.

* Build process fails: both outdated and too new, so reverting to just too new

* Use deprecated function and suppress warning

* fix space

* Suppress "TooManyFunctions" on DefaultTabsTrayController

* Repeatedly update tab movement during drag

* Remove multi-tab movement, only allow dragging if tab groups disabled, fix tab positioning during movement
I'm forced to suppress LongParameterList to get the settings information where it needs to go though

* Remove settings argument and corresponding long args suppression: instead get settings from parent AbstractBrowserTrayList's context

* New UI: Select a tab and then, while holding down, start dragging

* Revert to using before/after boolean to accomodate delays
Move drag transparency to start of drag

* Use new BlankDragShadowBuilder and DraggableItemAnimator to handle tab movement

* Replace Pair<>s with data classes

* Only drag if exactly 1 tab selected, don't consume drag event if not used

* Auto-scroll tab tray while dragging near top/bottom edge

* Remove unexpected scrolling on tab bind (triggered when tab is selected)

* Fix broken scroll behavior during dragging

* Cleanup for ktlint/detekt

* Constantly set elevation during drag in case of update
Clean code at drag start

* Add custom drag start behavior

* Add drag distance constant, do all touch-drag behavior in OnTouchListener

* Disable parent vertical scrolling on drag start, fix detekt ComplexCondition

* Minor cleanup/comments

* Revert removal of scroll on bind, this was related to something different

* Correction to prepareForDrop to match documentation- doesn't seem to have any effect

* Simplify via unchecked typecast, use ViewCompat

* Use ViewConfiguration.scaledTouchSlop instead of arbitrary 30px

* Added tabReorderingFeature flag, split drag interactor to separate function to satisfy complexity requirement

Co-authored-by: Steven Knipe <ssk97@case.edu>
Co-authored-by: ssk97 <knipesteven@gmail.com>
Co-authored-by: Sebastian Kaspari <s.kaspari@gmail.com>
3 years ago
Noah Bond de1c6b0dae
Tab group count telemetry (#22479)
* For #22410 - Refactored tab sorter metrics into a middleware

* For #22410 - Created distribution metric for tab group sizes

* For #22410 - Created tests for tabs tray middleware

* For #22410 - Merge fixes

* For #22410 - Added PR number to metric

* For #22410 - Fixed unit tests post merge. Added waitUntilIdle to new tests.

* For #22410 - Added missing line to middleware to have the Store process actions

* For #22410 - Updated metric expiration to December

* For #22410 - PR Feedback

* For #22410 - Removed else from middleware when
3 years ago
Mugurell 685da115c9 For #22442 - Don't display history group if already in Jump back in 3 years ago
Mugurell d4a6facd81 For #22155 - Store inactive tabs count telemetry when user opens tabs tray
Setting this value in FenixApplication.onCreate was buggy because of a race
with restoring BrowserState.
Setting it here would ensure a better granularity of the events and so to more
accurate reporting.
3 years ago
Noah Bond 2e5555d034
MR2 telemetry - Inactive tabs CFR (#22301)
* For #22298 - Added telemetry to inactive tabs CFR

* For #22298 - added PR issue number to metrics

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
3 years ago
Jonathan Almeida e3b6e00331 Close #22223: Move to the selected page when switching modes 3 years ago
Jonathan Almeida 8ced675817 No issue: Correct TabsTrayAction naming 3 years ago
Jonathan Almeida 08b15689b1 Close #22305: Use TabsTrayStore for populating adapters 3 years ago
Jonathan Almeida f16300392d Close #22305: Add tab state into the TabsTrayStore 3 years ago
Mugurell f9b67091c6 For #22155 - New BrowserState.actualInactiveTabs public method
This allows querying from all throughout the app which of the current tabs are
inactive while taking into consideration whether the feature is enabled or not
such that when the feature is disabled it will always return an empty result.
3 years ago
Arturo Mejia cff78afe27 For #22078 Selecting search group in Jump back in switches active tab 3 years ago
Jonathan Almeida 9bb49585ea No issue: Merge our inactive tab interactor/controllers 3 years ago
Jonathan Almeida f363b145f2 No issue: Remove unused InactiveTabState code 3 years ago
Roger Yang a46905b5e7 Issue #22057: Add search term groups telemetry 3 years ago
Jonathan Almeida 8c43ccc0f6 Issue #20704: Use AppStore for inactive expanded state 3 years ago
Arturo Mejia a2c7dfb26e For #22170: Add telemetry for the auto-close prompt 3 years ago
Arturo Mejia d943be0e53 For #22034: Inactive tabs prompt is redisplayed after dismissing by turning on Auto close 3 years ago
Gabriel Luong 100547130e For #21776 - Add package path to TabGroupViewHolder 3 years ago
Gabriel Luong b54698a3f2 For #21776 - Class member can have 'private' visibility 3 years ago
Gabriel Luong 660300f770 For #21776 - Replace 'isEmpty' with 'ifEmpty' 3 years ago
Gabriel Luong d854c282da For #21776 - Remove val from constructor parameter that are never used as a property 3 years ago
Jonathan Almeida 7666f0e4c2 No issue: Replace TabsTray.Tab with TabSessionState
Co-authored-by: Arturo Mejia <arturomejiamarmol@gmail.com>
3 years ago
Sebastian Kaspari 170fa9705e Update Kotlin and Jetpack Compose versions. 3 years ago
Arturo Mejia ee8c4de62d For #21986 Confirmation when people set tabs to auto-close
For #22034 Inactive tabs prompt is redisplayed after dismissing by turning on Auto close
3 years ago
Roger Yang 70fc6fc20f Close #22061: Let TabSorter decide if title header should be shown in tabs tray 3 years ago
Roger Yang b5c15280f7 No issue: Only report telemetry when tabs tray is first opened 3 years ago
Noah Bond 826249497a
MR2 Inactive tabs telemetry (#21908)
* For #21903 - Added telemetry for interacting with inactive tabs

* For #21903 - Added missing inactive tab delete count event to delete all event

* For #21903 - Added PR numbers to metrics

* For #21903 - Updated broken unit tests. Resolved critical lint warning.

* For #21903 - Fixed inactive tabs setting toggle metric

* For #21903 - Updated FenixApp unit test

* For #21903 - Updated newline character in Metrics. Set inactive tab metrics' lifetime to default. Updated expiration to Nov 2022. Refactored inactive tabs metric to be a single metric.

* PR: addendum for last commit that missed a file

* For #21903 - Changed logic check for reporting inactive tab count

* PR: fixed merge conflict

* For #21903 - Removed tab close tracking when the user closes ALL inactive tabs

* For #21903 - Removed individual tab close metric verify from CLOSE ALL test

* For #21903 - Updated inactive tabs toggle setting expiration to match the expiration of the other events

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
3 years ago
Roger Yang 60f7f766da Issue #21893: Keep search group when second to last search term tab is removed 3 years ago
Arturo Mejia 25c784b684 For #21906 ⁃ Remove old copy form inactive tabs section 3 years ago
Jonathan Almeida 9780dac846 No issue: Always show Make inactive for debug builds 3 years ago
Jonathan Almeida c554152fba Issue #21707: Correct search grouping logic in extensions
At this moment, we have two extension methods that have duplicate
functionality to construct search term groupings. One on `List<Tab>` and
one on `List<TabSessionState>`. The former is used for everything
related to tabs piped through the `TabsFeature` and the latter is for
consumers of `BrowserState` directly.

The bug occurs because our implementation of search groupings was
updated only on the former extension, but the `HeaderBinding`, that
observes the BrowserState and updates the title visibility, was using
the latter.

Ideally, we remove this duplication when we no longer have separate data
classes for consumers of `TabsFeature`, but this intermediary fix should
suffice.
3 years ago
Jonathan Almeida 722ab9f3ca Issue #21794: Remove rotation; rely on state activated
It seems like we no longer need to use rotation for the chevron, since
we are now using two different icons within the `ic_chevon` that change
depending on the `state_activated`.
3 years ago
Arturo Mejia 08256ac68c For #21791 Adds tab auto-close prompt 3 years ago
Roger Yang 4ad494075a Issue #21686: Stop using internally stored tabs list in adapters 3 years ago
Jonathan Almeida 74fd043290 Issue #21686: Move submitList calls into TabsAdapter
Co-authored-by: Roger Yang <royang@mozilla.com>
3 years ago
Gabriel Luong 04e75ace19 For #21756 - Refactor TopSites out of home.sessioncontrol 3 years ago
codrut.topliceanu b1a5025610 For #21708 - Fixes missing header bottom border
The bottom gray border of the header item from the Inactive Tabs section was correctly set when collapsing or expanding said section, but not on init. So if the section was initialized collapsed the gray border would not be present.
3 years ago
codrut.topliceanu a53b52b764 For #21565 - Adds inactive tabs onboarding popup 3 years ago
Jonathan Almeida b8946f807a Issue #21671: Remove Recently Closed from Inactive Tabs 3 years ago
Jonathan Almeida 061de54291 Issue #21576: Hide 'Other' title when there are no search groups 3 years ago
Jonathan Almeida c877a25400 Issue #21641: Do not add a group of only one tab 3 years ago
Noah Bond aa28b6f142
For #21360 - Added toggle for search term tab groups (#21615)
* For #21360  - Added toggle for search term tab groups

* For #21360 - Lint cleanup

* PR: Added missing licenses and possibly fixed UI test

* PR: Added a "scrollTo" to potentially fix a UI test

* PR: Added potential fix for alwaysStartOnHomeTest

* PR: Added temporary ignore to alwaysStartOnHomeTest

* PR: added missing ignore comment

* For #21360 - Added missing feature flag driven visibility logic

Co-authored-by: Sebastian Kaspari <s.kaspari@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
3 years ago
Elise Richards 3a2b9e5d2b
For #21643: Pre-land strings for inactive tabs CFR. Update section title for normal, non-search group tabs. (#21645) 3 years ago
Noah Bond 25d0696101
Inactive tabs changes (#21524)
* Issue mozilla-mobile#21319 - Moved inactive tabs to the top of the normal tabs tray.

* Issue mozilla-mobile#21319 - Added a delete icon to delete ALL inactive tabs.

* Issue mozilla-mobile#21319 - Changed default inactive time period to 14 days

* Issue mozilla-mobile#21319 - Hooked inactive tabs setting to UI code

Inactive tabs setting is also disabled when the user has selected the one day or week auto-close tab setting.

* Issue mozilla-mobile#21319 - File and Lint cleanup

* PR: Fixed bug causing grouped tabs to also show in "Other" when marked as inactive but inactive is OFF in Settings

* PR: Fixed lint warnings

* PR: Removed redundant feature check

* PR - Ignore test until search term tab groups switch is done
3 years ago
codrut.topliceanu 0e88c25df1 For #20762 - Adds grey border to inactive tabs 3 years ago
Roger Yang 8a15e8a681 Close #21451: Add active search term tab groups on home 3 years ago
Jonathan Almeida bc7f5d80df Issue #21236: Fixes empty tray visibility logic
This is a bug we noticed after landing search term grouping.

An adapter can submit an empty list of items to the `ConcatAdapter`
early. This has the side-effect of triggering our `observeFirstInsert`
too soon and therefore updating the visibility to show the empty tray
placeholder and never switches back.

Our solution is to keep a constant observer on the adapter so we can
perform the visibility check on every insert/remove.

Co-authored-by: Roger Yang <royang@mozilla.com>
3 years ago