Skip to content

Commit 204feda

Browse files
authored
Merge pull request #724 from appwrite/fix-nps-feedback-design-review
fix: nps feedback design review
2 parents 47ba549 + 04434cb commit 204feda

File tree

7 files changed

+36
-27
lines changed

7 files changed

+36
-27
lines changed

src/lib/components/feedback/evaluation.svelte

+7-5
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22
export let value: number = null;
33
</script>
44

5-
<fieldset class="u-margin-block-start-8">
5+
<fieldset class="u-margin-block-start-8 u-min-width-0">
66
<legend class="label is-required u-margin-0 u-line-height-1-5 u-bold">
77
<slot />
88
</legend>
9-
<ul class="u-flex u-main-space-between u-margin-block-start-16">
9+
<ol
10+
class="u-flex u-main-space-between u-margin-block-start-16 u-overflow-x-auto"
11+
style="padding-block: 0.13rem">
1012
{#each Array(11) as _, i}
1113
<li>
1214
<input
@@ -18,9 +20,9 @@
1820
checked={value === i} />
1921
</li>
2022
{/each}
21-
</ul>
23+
</ol>
2224
<div class="u-flex u-main-space-between u-margin-block-start-8">
23-
<span>Not at all likely</span>
24-
<span>Extremely likely</span>
25+
<span class:u-color-text-gray={value === null}>Not at all likely</span>
26+
<span class:u-color-text-gray={value === null}>Extremely likely</span>
2527
</div>
2628
</fieldset>

src/lib/components/feedback/feedback.svelte

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
);
2121
addNotification({
2222
type: 'success',
23-
message: 'Feedback submitted successfully'
23+
message: 'Thank you for your feedback'
2424
});
2525
feedback.toggleFeedback();
2626
feedbackData.reset();
@@ -33,15 +33,15 @@
3333
}
3434
</script>
3535

36-
<section class="drop-section">
36+
<section class="drop-section u-padding-24">
3737
<header class="u-flex u-main-space-between u-gap-16">
38-
<h4 class="body-text-1 u-bold">{$selectedFeedback.title}</h4>
38+
<h4 class="label u-bold" style:font-size="var(--font-size-1)">{$selectedFeedback.title}</h4>
3939
<button
4040
type="button"
4141
class="button is-text is-only-icon u-margin-inline-start-auto"
4242
style="--button-size:1.5rem;"
43-
aria-label="Close Modal"
44-
title="Close Modal"
43+
aria-label="Close feedback"
44+
title="Close feedback"
4545
on:click={() => feedback.toggleFeedback()}>
4646
<span class="icon-x" aria-hidden="true" />
4747
</button>

src/lib/components/feedback/feedbackNPS.svelte

+7-7
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
import Evaluation from './evaluation.svelte';
55
</script>
66

7-
<Evaluation bind:value={$feedbackData.value}>
8-
How likely are you to recommend Appwrite to a friend or colleague?
9-
</Evaluation>
10-
{#if $feedbackData.value}
11-
<FormList>
7+
<FormList>
8+
<Evaluation bind:value={$feedbackData.value}>
9+
How likely are you to recommend Appwrite to a friend or colleague?
10+
</Evaluation>
11+
{#if $feedbackData.value !== null}
1212
<InputTextarea
1313
id="feedback"
1414
placeholder="Your message here"
@@ -26,5 +26,5 @@
2626
id="email"
2727
bind:value={$feedbackData.email}
2828
placeholder="Enter email" />
29-
</FormList>
30-
{/if}
29+
{/if}
30+
</FormList>

src/lib/layout/header.svelte

+5
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@
124124
{/if}
125125
<DropList show={$feedback.show} scrollable on:blur={toggleFeedback}>
126126
<button class="button is-small is-text" on:click={toggleFeedback}>
127+
{#if $feedback.notification}
128+
<span
129+
class="notification u-position-absolute u-inset-block-start-8 u-inset-inline-end-8"
130+
></span>
131+
{/if}
127132
<span class="text">Feedback</span>
128133
</button>
129134
<svelte:fragment slot="other">

src/lib/stores/feedback.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ export type FeedbackOption = {
3030
export const feedbackOptions: FeedbackOption[] = [
3131
{
3232
type: 'general',
33-
title: 'How can we improve?',
34-
desc: 'Your feedback is important to us. Please be honest and tell us what you think.',
33+
title: 'Help us improve Appwrite',
34+
desc: 'Appwrite evolves with your input. Share your thoughts and help us improve Appwrite.',
3535
component: FeedbackGeneral
3636
},
3737
{
3838
type: 'nps',
39-
title: 'How are we doing?',
40-
desc: "At Appwrite, we value the feedback of our users. That means you! We'd love to hear what you think.",
39+
title: 'Help us improve Appwrite',
40+
desc: 'Appwrite evolves with your input. Share your thoughts and help us improve Appwrite. If you would like to be contacted regarding your feedback, please share your contact details below.',
4141
component: FeedbackNps
4242
}
4343
];
@@ -49,7 +49,7 @@ function createFeedbackDataStore() {
4949
message: '',
5050
name: '',
5151
email: '',
52-
value: 0
52+
value: null
5353
});
5454
return {
5555
set,
@@ -60,7 +60,7 @@ function createFeedbackDataStore() {
6060
feedbackData.message = '';
6161
feedbackData.name = '';
6262
feedbackData.email = '';
63-
feedbackData.value = 0;
63+
feedbackData.value = null;
6464
return feedbackData;
6565
});
6666
}
@@ -71,8 +71,8 @@ export const feedbackData = createFeedbackDataStore();
7171

7272
function createFeedbackStore() {
7373
const { subscribe, update } = writable<Feedback>({
74-
elapsed: browser ? parseInt(localStorage.getItem('feedbackElapsed')) : 0,
75-
visualized: browser ? parseInt(localStorage.getItem('feedbackVisualized')) : 0,
74+
elapsed: browser ? parseInt(localStorage.getItem('feedbackElapsed')) ?? 0 : 0,
75+
visualized: browser ? parseInt(localStorage.getItem('feedbackVisualized')) ?? 0 : 0,
7676
notification: false,
7777
type: 'general',
7878
show: false

src/routes/console/+layout.svelte

+3-1
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,9 @@
236236
let isOpen = false;
237237
onMount(async () => {
238238
loading.set(false);
239-
239+
if (!localStorage.getItem('feedbackElapsed')) {
240+
localStorage.setItem('feedbackElapsed', '0');
241+
}
240242
setInterval(() => {
241243
checkForFeedback(INTERVAL);
242244
}, INTERVAL);

src/routes/console/wizard/feedback/step1.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
);
2121
addNotification({
2222
type: 'success',
23-
message: 'Feedback submitted successfully'
23+
message: 'Thank you for your feedback'
2424
});
2525
} catch (error) {
2626
addNotification({

0 commit comments

Comments
 (0)