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

[VerticalTab] Move the new tab button to appear immediately after the last tab #27117

Conversation

jagadeshjai
Copy link
Collaborator

@jagadeshjai jagadeshjai commented Jan 4, 2025

Move the new tab button to appear immediately after the last tab last tab as per the new design.
And Keep the new tab button fixed at the bottom when tabs overflow.

Also this new tab button position change reveals another bug and
VerticalTabStripRootViewBrowserTest.DragAfterCurrentTab caught it.
Converting point from root view to tab strip view was wrong in chromium_src/chrome/browser/ui/views/frame/browser_root_view.cc.

Resolves brave/brave-browser#42533
Resolves brave/brave-browser#43226

OutCome

Screenshot 2025-01-14 at 2 10 56 PM

image

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:

See the linked issue.

@jagadeshjai jagadeshjai force-pushed the feature__Move_new_tab_below_last_tab_in_vtabs branch from b74a8ee to 75bc6ba Compare January 4, 2025 14:54
@jagadeshjai jagadeshjai marked this pull request as ready for review January 4, 2025 14:54
@jagadeshjai
Copy link
Collaborator Author

@simonhong Could you kindly review this PR?

@simonhong simonhong self-requested a review January 6, 2025 06:50
@simonhong
Copy link
Member

simonhong commented Jan 6, 2025

@jagadeshjai Can you adjust the height of new tab button to 32px like this?

image

and maybe we also want to adjust its hover color?
cc @aguscruiz

Screenshot 2025-01-06 163555

@aguscruiz
Copy link
Collaborator

Thanks @simonhong for catching that one. Yeah, hover color should be the same as the hover color for tabs

@jagadeshjai
Copy link
Collaborator Author

Just now noticed that @rebron mentioned adding a separator between the tabs and the New Tab button in the issue description

There should be a separator between the last tab in the vertical tabs mode list and the New Tab button.

@aguscruiz Can we update the same in design as well?

@aguscruiz
Copy link
Collaborator

Of course, added
image

@simonhong
Copy link
Member

fyi, CI gave test failure with this PR.
VerticalTabStripRootViewBrowserTest.DragAfterCurrentTab(../../brave/browser/ui/views/frame/vertical_tab_strip_root_view_browsertest.cc:97)

@simonhong simonhong self-assigned this Jan 10, 2025
@jagadeshjai
Copy link
Collaborator Author

fyi, CI gave test failure with this PR. VerticalTabStripRootViewBrowserTest.DragAfterCurrentTab(../../brave/browser/ui/views/frame/vertical_tab_strip_root_view_browsertest.cc:97)

The test failure is actually due to this bug.

@jagadeshjai jagadeshjai force-pushed the feature__Move_new_tab_below_last_tab_in_vtabs branch from 03d5d2a to 5dd5cbb Compare January 10, 2025 09:45
@simonhong simonhong force-pushed the feature__Move_new_tab_below_last_tab_in_vtabs branch 2 times, most recently from 0f41677 to 8d79126 Compare January 13, 2025 04:15
@simonhong simonhong marked this pull request as draft January 13, 2025 04:24
@simonhong simonhong force-pushed the feature__Move_new_tab_below_last_tab_in_vtabs branch from 8d79126 to defb49d Compare January 13, 2025 04:58
@jagadeshjai jagadeshjai force-pushed the feature__Move_new_tab_below_last_tab_in_vtabs branch from d611153 to 4d9a5c7 Compare January 13, 2025 08:21
@simonhong simonhong force-pushed the feature__Move_new_tab_below_last_tab_in_vtabs branch 3 times, most recently from 773297f to 1b31143 Compare January 14, 2025 03:07
@simonhong
Copy link
Member

This PR reveals another bug - brave/brave-browser#43226
As, #27198 will fix that issue, this PR could be merged after this fix is merged to master.

@simonhong simonhong marked this pull request as ready for review January 14, 2025 11:49
@simonhong simonhong requested a review from a team as a code owner January 14, 2025 11:49
if (views::View* target_v = TARGET_GETTER; \
tabs::utils::ShouldShowVerticalTabs(browser_view_->browser()) && \
(target_v == tabstrip() || !THIS->Contains(target_v))) { \
ConvertPointToScreen(THIS, POINT); \
Copy link
Member

Choose a reason for hiding this comment

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

As this POINT is from THIS, we should call ConvertPointToScreen() with THIS and POINT.

jagadeshjai and others added 2 commits January 14, 2025 20:57
… last tab as per the new design.

And Keep the new tab button fixed at the bottom when tabs overflow.
@simonhong simonhong force-pushed the feature__Move_new_tab_below_last_tab_in_vtabs branch from 7fb3f5b to 791df83 Compare January 14, 2025 12:13
@simonhong
Copy link
Member

CI looks good for this PR - #27125

Copy link
Contributor

@fallaciousreasoning fallaciousreasoning left a comment

Choose a reason for hiding this comment

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

This looks good to me, but I'll leave final approval to @simonhong, as he knows a lot more about this code than me 😄

Copy link
Member

@simonhong simonhong left a comment

Choose a reason for hiding this comment

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

Thanks @jagadeshjai 👍🏼

Copy link
Collaborator

@mkarolin mkarolin left a comment

Choose a reason for hiding this comment

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

chromium_src++

@simonhong
Copy link
Member

@bsclifton , needs your power :) I think all good to merge now.

@bsclifton bsclifton merged commit 49c326a into brave:master Jan 16, 2025
8 checks passed
@brave-builds
Copy link
Collaborator

Released in v1.76.19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
7 participants