Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit 6da0f45

Browse files
authored
Merge pull request #394 from atom/show-prompt-always
Show fast mode prompt on any project size
2 parents b56cd42 + 1e36f7c commit 6da0f45

File tree

3 files changed

+15
-25
lines changed

3 files changed

+15
-25
lines changed

lib/experiment-prompt.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@ const etch = require('etch')
22
const $ = etch.dom
33
const SCORING_SYSTEMS = require('./scoring-systems')
44

5-
/**
6-
* Minimum number of files in the project needed to show the fast mode prompt.
7-
*/
8-
const ThresholdForShowingPrompt = 10000
9-
105
/**
116
* For how long to show the "NEW" badge in the prompt since the first time
127
* it was seen (24h).
@@ -20,7 +15,7 @@ function shouldShowPrompt (numItems) {
2015
return false
2116
}
2217

23-
return isFastModeEnabled() || numItems > ThresholdForShowingPrompt
18+
return true
2419
}
2520

2621
function shouldShowBadge () {

spec/buffer-view-spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const BufferView = require('../lib/buffer-view')
55

66
describe('BufferView', () => {
77
it('shows the avatar for editors that are remote', async () => {
8-
const bufferView = new BufferView()
8+
const bufferView = new BufferView({incrementCounter: () => {}})
99

1010
const localEditor1 = await atom.workspace.open(path.join(temp.path(), 'a'))
1111
const localEditor2 = await atom.workspace.open(path.join(temp.path(), 'b'))

spec/fuzzy-finder-spec.js

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,17 @@ function getOrScheduleUpdatePromise () {
3030
}
3131

3232
describe('FuzzyFinder', () => {
33+
let disposable, reporterStub
3334
let rootDir1, rootDir2
3435
let fuzzyFinder, projectView, bufferView, gitStatusView, workspaceElement, fixturesPath
3536

3637
beforeEach(async () => {
38+
reporterStub = {
39+
addTiming: sinon.spy(),
40+
incrementCounter: () => {}
41+
}
42+
disposable = fuzzyFinderPackage.consumeMetricsReporter(reporterStub)
43+
3744
const ancestorDir = fs.realpathSync(temp.mkdirSync())
3845
rootDir1 = path.join(ancestorDir, 'root-dir1')
3946
rootDir2 = path.join(ancestorDir, 'root-dir2')
@@ -66,6 +73,12 @@ describe('FuzzyFinder', () => {
6673
jasmine.useRealClock()
6774
})
6875

76+
afterEach(() => {
77+
if (disposable) {
78+
disposable.dispose()
79+
}
80+
})
81+
6982
async function waitForPathsToDisplay (fuzzyFinderView) {
7083
return conditionPromise(() => fuzzyFinderView.element.querySelectorAll('li').length > 0)
7184
}
@@ -1658,21 +1671,7 @@ describe('FuzzyFinder', () => {
16581671
})
16591672

16601673
describe('logging of metrics events', () => {
1661-
let disposable
1662-
1663-
afterEach(() => {
1664-
if (disposable) {
1665-
disposable.dispose()
1666-
}
1667-
})
1668-
16691674
it('logs the crawling time', async () => {
1670-
const reporterStub = {
1671-
addTiming: sinon.spy()
1672-
}
1673-
1674-
disposable = fuzzyFinderPackage.consumeMetricsReporter(reporterStub)
1675-
16761675
// After setting the reporter it may receive some old events from previous tests
16771676
// that we want to discard.
16781677
reporterStub.addTiming.reset()
@@ -1688,10 +1687,6 @@ describe('FuzzyFinder', () => {
16881687
})
16891688

16901689
it('queues the events until a reporter is set', async () => {
1691-
const reporterStub = {
1692-
addTiming: sinon.spy()
1693-
}
1694-
16951690
// After setting the reporter it may receive some old events from previous tests
16961691
// that we want to discard.
16971692
reporterStub.addTiming.reset()

0 commit comments

Comments
 (0)