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

Allow cmd+1..9 to select pinned tabs #656

Merged
merged 1 commit into from
Jul 29, 2022

Conversation

ayoy
Copy link
Collaborator

@ayoy ayoy commented Jul 27, 2022

Task/Issue URL: https://app.asana.com/0/0/1202659052151493/f

Description:
Add TabIndex API that "converts" an integer index into TabIndex for a given TabCollectionViewModel.
Make showTab main menu action aware of pinned tabs, and use this API to select correct tab.
This patch also adds extra assertions to TabIndex.first(in:) and TabIndex.last(in:) and
fixes TabIndex.next(in:) when there are only pinned tabs.

Steps to test this PR:

  1. Open multiple tabs
  2. Pin a tab, Verify that cmd+1 selects the pinned tab, and cmd+2 selects the first unpinned tab
  3. Pin more tabs, verify that cmd+1..9 select proper tabs
  4. Have more than 9 tabs in total, verify that cmd+9 selects always the last tab
  5. Have a couple of pinned tabs, close all unpinned tabs, verify that cmd+9 selects the last pinned tab
  6. Unpin all tabs (you can use Debug -> Reset pinned tabs), verify that cmd+1..9 works correctly without pinned tabs.

Testing checklist:

  • Test with Release configuration

Internal references:

Software Engineering Expectations
Technical Design Template
When ready for review, remember to post the PR in MM

@tomasstrba tomasstrba self-requested a review July 27, 2022 11:46
@tomasstrba tomasstrba self-assigned this Jul 27, 2022
Copy link
Contributor

@tomasstrba tomasstrba left a comment

Choose a reason for hiding this comment

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

LGTM! 👍

@tomasstrba tomasstrba assigned ayoy and unassigned tomasstrba Jul 29, 2022
@ayoy ayoy merged commit 3811d69 into develop Jul 29, 2022
@ayoy ayoy deleted the dominik/pinned-tabs-keyboard-navigation branch July 29, 2022 12:01
samsymons added a commit that referenced this pull request Jul 29, 2022
# By Dominik Kapusta (1) and Sam Symons (1)
# Via GitHub
* develop:
  Email Manager keychain error reporting (#662)
  Allow cmd+1..9 to select pinned tabs (#656)

# Conflicts:
#	DuckDuckGo/Statistics/PixelEvent.swift
samsymons added a commit that referenced this pull request Jul 31, 2022
…improvements-phase-2

* sam/bookmarks-improvements-phase-1:
  Delete the root folder if it already exists in the wrong place.
  Email Manager keychain error reporting (#662)
  Allow cmd+1..9 to select pinned tabs (#656)
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