-
Notifications
You must be signed in to change notification settings - Fork 868
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
Use the proper index when dragging a tab group #25160
Use the proper index when dragging a tab group #25160
Conversation
@sangwoo108 Can you have a look. Thanks! |
@tech-zilla Thanks for submitting.. I think this is the right fix. |
@simonhong Thanks for the review. I will try to find some spare time for a test. |
@simonhong I've added an interactive UI test for this crash and fixed the interactive_ui_tests. Please have a look to see if everything is ok. |
@Ilie-Lesan Thanks for adding test. |
and if you want to fix broken interactive ui test taget build as a separated issue, it's really welcome. |
@@ -187,9 +187,9 @@ void TabDragController::DetachAndAttachToNewContext( | |||
std::vector<tabs::TabHandle> tabs; | |||
auto* tab_strip_model = browser->tab_strip_model(); | |||
DCHECK_EQ(tab_strip_model, attached_context_->GetTabStripModel()); | |||
for (const auto& tab_drag_data : drag_data_) { | |||
for (size_t i = first_tab_index(); i < drag_data_.size(); ++i) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice- took me a minute to spot the fix 😄 Basically starting at first_tab_index and not iterating every item
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change this to something like:
auto drag_data = base::span(drag_data_).subspan(first_tab_index());
for (const auto& tab_drag_data : drag_data) {
...
This will avoid build failures with the unsafe buffers warning as we don't access the subscript directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops - I missed this before merging; @Ilie-Lesan you're welcome to do a follow up or I can do that. Just let me know!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pushed #26055
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code change looks great! Verified the fix in local build. Nice work 😄
+1 from me on the comments from @simonhong (RE: browser test would be great)
I will try to add a browser test(let's hope this can be done using the browser test target). Thanks for your time! :) |
You should be able to try it out via |
@simonhong I've added a browser test for the tab group drag issue. Let me know if everything is ok |
ecd32a8
to
890a61a
Compare
Rebased and created a CI run here: #26018 |
checking the CI failures. My last commit didn't fix. Got same result after adding |
…window when split view is enabled and fix interactive ui test build
… of the window when split view is enabled and fix interactive ui test build" This reverts commit 40ed7c1.
971c077
to
2543edb
Compare
upstream also only runs this test on Windows. Also use //brave/browser/ui/views/tabs::browser_tests target for tab browser test cases.
2543edb
to
60990c1
Compare
@bsclifton #26018 got all greens. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM % changes.
Thanks for submitting this PR.
Nice work @Ilie-Lesan! Thanks for putting in the time on this one 😄 |
Released in v1.73.18 |
@bsclifton You're welcome, thanks too! :) |
Resolves brave/brave-browser#39486
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
wikinpm run presubmit
wiki,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan:
TabDragControllerTest.*
See the linked issue for manual test.