Lower the frequency of the respectful tips

Replace the icon with `Not helpful` text for dismiss

Change-Id: I0ad3472eeeb65fc545819e53ec58a9c23098ca30
This commit is contained in:
Tao Zhou
2020-03-27 14:11:00 +01:00
parent 136e3db63e
commit e540985d87
4 changed files with 13 additions and 12 deletions

View File

@@ -60,11 +60,12 @@ const FILE = 'FILE';
* All candidates tips to show, will pick randomly.
*/
const RESPECTFUL_REVIEW_TIPS= [
'DO: Assume competence.',
'DO: Provide rationale or context.',
'DO: Consider how comments may be interpreted.',
'DONT: Criticize the person.',
'DONT: Use harsh language.',
'Assume competence.',
'Provide rationale or context.',
'Consider how comments may be interpreted.',
'Avoid harsh language.',
'Make your comments specific and actionable.',
'When disagreeing, explain the advantage of your approach.',
];
/**
@@ -294,8 +295,8 @@ class GrComment extends mixinBehaviors( [
'respectful-tip-dismissed',
{tip: this._respectfulReviewTip}
);
// add a 3 day delay to the tip cache
this.$.storage.setRespectfulTipVisibility(/* delayDays= */ 3);
// add a 14-day delay to the tip cache
this.$.storage.setRespectfulTipVisibility(/* delayDays= */ 14);
}
_onRespectfulReadMoreClick() {

View File

@@ -282,7 +282,7 @@ export const htmlTemplate = html`
<a tabindex="-1" on-click="_onRespectfulReadMoreClick" href="https://testing.googleblog.com/2019/11/code-health-respectful-reviews-useful.html" target="_blank">
Read more
</a>
<iron-icon class="close pointer" on-click="_dismissRespectfulTip" icon="gr-icons:close"></iron-icon>
<a tabindex="-1" class="close pointer" on-click="_dismissRespectfulTip">Not helpful</a>
</div>
</div>
</template>

View File

@@ -1161,7 +1161,7 @@ suite('gr-comment tests', () => {
});
});
test('add 3 day delays once dismissed', done => {
test('add 14-day delays once dismissed', done => {
// fake stub for storage
const respectfulGetStub = sinon.stub();
const respectfulSetStub = sinon.stub();
@@ -1185,7 +1185,7 @@ suite('gr-comment tests', () => {
MockInteractions.tap(element.shadowRoot
.querySelector('.respectfulReviewTip .close'));
flushAsynchronousOperations();
assert.isTrue(respectfulSetStub.lastCall.args[0] === 3);
assert.isTrue(respectfulSetStub.lastCall.args[0] === 14);
done();
});
});

View File

@@ -26,8 +26,8 @@ const DURATION_DAY = 24 * 60 * 60 * 1000;
const CLEANUP_THROTTLE_INTERVAL = DURATION_DAY;
const CLEANUP_PREFIXES_MAX_AGE_MAP = {
// respectfultip has a 3 day expiration
'respectfultip:': 3 * DURATION_DAY,
// respectfultip has a 14-day expiration
'respectfultip:': 14 * DURATION_DAY,
'draft:': DURATION_DAY,
'editablecontent:': DURATION_DAY,
};