Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed new tab is not shown when it's first tab #27477

Merged
merged 2 commits into from
Feb 4, 2025

Conversation

simonhong
Copy link
Member

@simonhong simonhong commented Feb 4, 2025

fix brave/brave-browser#43656
fix brave/brave-browser#43688
possibly fixes brave/brave-browser#43700

So far, we only do re-layout vertical tab strip when it gets child's preferred size changed noti.
However, upstream doesn't give it for first tab. See TabContainerImpl::AddTab() for more detail.
We optimized like that to avoid redundant re-layout but we need to relayout whenever child view's layout is invalidated. That constraints was added to fix brave/brave-browser#28967
but confirmed that it doesn't happen anymore w/o this constraints.

Resolves

Submitter Checklist:

  • I confirm that no security/privacy review is needed and no other type of reviews are needed, or that I have requested them
  • There is a ticket for my issue
  • Used Github auto-closing keywords in the PR description above
  • Wrote a good PR/commit description
  • Squashed any review feedback or "fixup" commits before merge, so that history is a record of what happened in the repo, not your PR
  • Added appropriate labels (QA/Yes or QA/No; release-notes/include or release-notes/exclude; OS/...) to the associated issue
  • Checked the PR locally:
    • npm run test -- brave_browser_tests, npm run test -- brave_unit_tests wiki
    • npm run presubmit wiki, npm run gn_check, npm run tslint
  • Ran git rebase master (if needed)

Reviewer Checklist:

  • A security review is not needed, or a link to one is included in the PR description
  • New files have MPL-2.0 license header
  • Adequate test coverage exists to prevent regressions
  • Major classes, functions and non-trivial code blocks are well-commented
  • Changes in component dependencies are properly reflected in gn
  • Code follows the style guide
  • Test plan is specified in PR before merging

After-merge Checklist:

Test Plan:

VerticalTabStripBrowserTest.LayoutAfterFirstTabCreation
See the linked issue for manual test STR.
Also see brave/brave-browser#43656 (comment)

fix brave/brave-browser#43656

So far, we only do re-layout vertical tab strip when it gets child's preferred size
changed noti. However, upstream doesn't give it for first tab. See
TabContainerImpl::AddTab() for more detail. We optimized like that to avoid redundant
re-layout but we need to relayout whenever child view's layout is invalidated.
That constraints was added to fix brave/brave-browser#28967
but confirmed that it doesn't happen anymore w/o this constraints.
@simonhong simonhong self-assigned this Feb 4, 2025
Copy link
Member

@goodov goodov left a comment

Choose a reason for hiding this comment

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

with the fix I can't reproduce this anymore: brave/brave-browser#43688
nice!

@simonhong simonhong merged commit ed60011 into master Feb 4, 2025
18 checks passed
@simonhong simonhong deleted the fix_vertical_tab_layout_invalidation branch February 4, 2025 07:41
@github-actions github-actions bot added this to the 1.77.x - Nightly milestone Feb 4, 2025
@simonhong
Copy link
Member Author

with the fix I can't reproduce this anymore: brave/brave-browser#43688 nice!

Thanks for testing! 👍🏼

@brave-builds
Copy link
Collaborator

Released in v1.77.14

@goodov
Copy link
Member

goodov commented Feb 5, 2025

should be uplifted as #27301 landed to beta (and release?).

@bsclifton
Copy link
Member

Uplifts created - thanks @simonhong @goodov

@MadhaviSeelam
Copy link

MadhaviSeelam commented Feb 5, 2025

Verification PASSED using

Brave | 1.77.17 Chromium: 133.0.6943.54 (Official Build) nightly (64-bit)
-- | --
Revision | 60e80309502393906c45fa5c1765c21d09407071
OS | Windows 11 Version 24H2 (Build 26100.2894)

Test Case 1: Fix verified for brave/brave-browser#43656

Reproduced the scenarios 1 & 2 from brave/brave-browser#43656 (comment) in 1.76.50

Case 1: New tab is shown after when it's first tab when rest of the tabs are pinned

Verified the issue using STR from brave/brave-browser#43656 (comment)

Confirmed new tab is shown when clicked New Tab button after all other tabs are pinned

2025-02-05_12h07_36.mp4

Case 2: Pinned tab from window B to window A is visible

Verified the issue using STR from brave/brave-browser#43656 (comment) (Scenario 1)

Confirmed that Pinned tab from Window B moved to Window A is shown

2025-02-05_11h51_44.mp4

Case 3: unpinned tab from window A is visible in window B

Verified the issue using STR from brave/brave-browser#43656 (comment) (Scenario 2)

Test Case 2: Fix verified for the issue brave/brave-browser#43688

Case 1: New Tab button repositioned after last tab is closed

Could not reproduce the issue using STR brave/brave-browser#43688 (comment) in 1.77.5

Verified the issue using STR from brave/brave-browser#43688 (comment)

Confirmed New Tab button repositioned after last tab is closed

2025-02-05_12h41_59.mp4

kjozwiak pushed a commit that referenced this pull request Feb 5, 2025
kjozwiak pushed a commit that referenced this pull request Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment