Skip to content

Conversation

@0nko
Copy link
Member

@0nko 0nko commented Oct 22, 2025

Task/Issue URL: https://app.asana.com/1/137249556945/project/1207418217763355/task/1211565479656354

Description

This PR refactors the OmnibarLayout and SingleOmnibarLayout. OmnibarLayout was renamed to LegacyOmnibarLayout and a new OmnibarLayout is a unified, merged version of OmnibarLayout and SingleOmnibarLayout.

Thew new omnibar is guarded by a useUnifiedOmnibarLayout feature flag. To make that work, an OminbarView interface needed to be extracted, which is now used within the Omnibar class. Depending on the flag value, either the old LegacyOmnibarLayout or the new OmnibarLayout is used. The feature flag is enabled by default.

Also, some of the interfaces from OmnibarLayout had to be extracted (StateChange, Decoration) to avoid duplication.

Steps to test this PR

FF enabled

  • Verify that onboarding highlighting works
  • Verify all buttons work
  • Verify tab swiping works
  • Verify tracker animations work
  • Verify the cookies animations work
  • Verify that omnibar hiding on scroll works

FF disabled

  • Disable the useUnifiedOmnibarLayout FF in the internal settings
  • Verify that onboarding highlighting works
  • Verify all buttons work
  • Verify tab swiping works
  • Verify tracker animations work
  • Verify the cookies animations work
  • Verify that omnibar hiding on scroll works

@0nko 0nko requested a review from malmstein October 22, 2025 17:39
@0nko 0nko changed the title Create a new UnifiedOmnibarLayout and ViewModel Split Omnibar: Omnibar layout refactoring Oct 22, 2025
@0nko 0nko marked this pull request as ready for review October 22, 2025 17:40
@0nko 0nko force-pushed the feature/ondrej/split-omnibar-unified-layout branch from 1963cc4 to aa9f4d2 Compare October 23, 2025 09:57
@0nko 0nko force-pushed the feature/ondrej/split-omnibar-unified-layout branch from aa9f4d2 to 6b0dfce Compare October 24, 2025 17:16
@0nko 0nko mentioned this pull request Oct 24, 2025
20 tasks
@0nko 0nko requested review from LukasPaczos and removed request for malmstein October 27, 2025 11:13
@0nko 0nko force-pushed the feature/ondrej/split-omnibar-unified-layout branch from 6b0dfce to 0f2ea5d Compare October 27, 2025 11:26
Copy link
Contributor

@LukasPaczos LukasPaczos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes generally look good and work as expected. However, the new UnifiedOmnibarLayout.kt file is difficult to review in its current form. If this is intended to be the long-term layout location, it also loses the git history from all iterations of OmnibarLayout.

Instead of creating a new UnifiedOmnibarLayout.kt file, I suggest:

  1. Copy the existing OmnibarLayout into a new file (LegacyOmnibarLayout?).
  2. Rename the existing OmnibarLayout to UnifiedOmnibarLayout.
  3. Apply the necessary changes there.
  4. When we're confident in the changes, we'll remove the Legacy* copies.

The same approach can be used for the XML files, view model, and view model tests. This should be straightforward to copy-paste and would preserve git history and make the diff easier to review for the code that will remain long-term.

@0nko
Copy link
Member Author

0nko commented Oct 27, 2025

Thanks @LukasPaczos! I've refactored the code as you suggested. In fact, while working on this I realized that a separate ViewModel is not needed as there is no new functionality and a single OmnibarLayoutViewModel can be used by both the old and new layout. Hence, I also removed the extra unit test copy and cut the amount of changes to half 🎉.

@0nko 0nko requested a review from LukasPaczos October 27, 2025 16:43
@0nko 0nko force-pushed the feature/ondrej/split-omnibar-unified-layout branch from d7dd418 to 69f6484 Compare October 27, 2025 17:17
Copy link
Contributor

@LukasPaczos LukasPaczos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@0nko 0nko merged commit 0941155 into develop Oct 28, 2025
9 checks passed
@0nko 0nko deleted the feature/ondrej/split-omnibar-unified-layout branch October 28, 2025 09:21
LukasPaczos added a commit that referenced this pull request Oct 29, 2025
Task/Issue URL:
https://app.asana.com/1/137249556945/project/414730916066338/task/1211782850017596?focus=true

### Description
Resolve a regression where function invocation changed from an extension
to recursion during a refactor in
#6983.

### Steps to test this PR

- [x] Open the app.
- [x] Search and go to videos.
- [x] Start a video.
- [x] Open full screen.
- [x] Close full screen.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants