Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Add an option for "no delay" in tab preview timing #12832

Merged
merged 2 commits into from
Jan 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions app/common/constants/settingsEnums.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ const bookmarksToolbarMode = {
}

const tabPreviewTiming = {
LONG: 2000,
NORMAL: 1000,
SHORT: 500
NONE: 50, // add a bit of delay to avoid flashing of unwanted previews
SHORT: 400,
LONG: 750
}

const tabCloseAction = {
Expand Down
3 changes: 2 additions & 1 deletion app/extensions/brave/locales/en-US/preferences.properties
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ newTabHomePage=Home page
newTabMode=A new tab shows
newTabNewTabPage=Dashboard
nextContribution=Next contribution:
none=None
nonVerifiedPublishers=Allow contributions to non-verified sites
noPaymentHistory=No previous contributions
normal=Normal
Expand Down Expand Up @@ -357,7 +358,7 @@ tabCloseActionLastActive=Select the last viewed tab
tabCloseActionNext=Select the next tab
tabCloseActionParent=Select its parent tab
tableEmptyText=No table data.
tabPreviewTiming=Time to wait before previewing a tab
tabPreviewTiming=Tab Preview Delay
tabs=Tabs
tabSettings=Tab Settings
tabsPerTabPage=Number of tabs per tab set:
Expand Down
12 changes: 6 additions & 6 deletions app/renderer/components/preferences/tabsTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@ class TabsTab extends ImmutableComponent {
get tabPreviewTimingOptions () {
return [
{
id: 'long',
action: tabPreviewTiming.LONG
},
{
id: 'normal',
action: tabPreviewTiming.NORMAL
id: 'none',
action: tabPreviewTiming.NONE
},
{
id: 'short',
action: tabPreviewTiming.SHORT
},
{
id: 'long',
action: tabPreviewTiming.LONG
}
]
}
Expand Down
4 changes: 2 additions & 2 deletions js/constants/appConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const isTest = process.env.NODE_ENV === 'test'

const buildConfig = require('./buildConfig')
const isProduction = buildConfig.nodeEnv === 'production'
const {fullscreenOption, autoplayOption} = require('../../app/common/constants/settingsEnums')
const {fullscreenOption, autoplayOption, tabPreviewTiming} = require('../../app/common/constants/settingsEnums')
const Channel = require('../../app/channel')

module.exports = {
Expand Down Expand Up @@ -153,7 +153,7 @@ module.exports = {
'tabs.tabs-per-page': 20,
'tabs.close-action': 'parent',
'tabs.show-tab-previews': true,
'tabs.preview-timing': 1000,
'tabs.preview-timing': tabPreviewTiming.SHORT,
Copy link
Member

Choose a reason for hiding this comment

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

nice!! Love this 😄

'tabs.show-dashboard-images': true,
'privacy.history-suggestions': true,
'privacy.bookmark-suggestions': true,
Expand Down
4 changes: 2 additions & 2 deletions test/unit/app/renderer/components/preferences/tabsTabTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ describe('TabsTab component', function () {
true
)
})
it('can switch tab previews time to activate previews to NORMAL', function () {
settingDefaultValue = tabPreviewTiming.NORMAL
it('can switch tab previews time to activate previews to NONE', function () {
settingDefaultValue = tabPreviewTiming.NONE
const wrapper = shallow(<TabsTab settings={settingDefaultValue} />)

assert.equal(
Expand Down