Skip to content

Commit ca02361

Browse files
authored
chore: feedback rework (#99)
* chore: feedback rework * chore: update
1 parent e0480e5 commit ca02361

16 files changed

Lines changed: 89 additions & 57 deletions

apps/atrium-telegram/app/app.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default defineAppConfig({
2626
},
2727
modal: {
2828
slots: {
29-
content: 'divide-y-0',
29+
content: 'divide-y-0 !ring-muted/50',
3030
header: 'pb-0 min-h-12',
3131
title: 'text-lg/5 font-semibold',
3232
},

apps/atrium-telegram/app/components/Button.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<button
33
class="p-3 tg-bg-button w-full rounded-2xl font-medium cursor-pointer active:scale-95 duration-200"
4-
@click="vibrate"
4+
@click="vibrate()"
55
>
66
<slot />
77
</button>

apps/atrium-telegram/app/components/CreateCard.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
base: 'px-3 rounded-full',
1212
label: 'font-medium',
1313
}"
14-
@click="vibrate"
14+
@click="vibrate()"
1515
/>
1616
</div>
1717
</template>

apps/atrium-telegram/app/components/Loader.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
<img
33
src="/sushi-heart.svg"
44
alt=""
5-
class="w-12 grayscale-100 opacity-10 motion-preset-pulse motion-duration-1000"
5+
class="w-12 opacity-50 invert-50 motion-preset-pulse motion-duration-1000"
66
>
77
</template>

apps/atrium-telegram/app/components/Navigation.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<nav class="z-50 touch-pan-x fixed bottom-0 left-0 right-0 w-full h-25 tg-bg-bottom-bar border-t border-default rounded-t-lg">
2+
<nav class="z-50 touch-pan-x fixed bottom-0 left-0 right-0 w-full h-25 tg-bg-bottom-bar border-t border-default rounded-t-lg motion-preset-slide-up">
33
<div class="max-w-[28rem] mx-auto">
44
<div class="mt-3 grid grid-cols-4">
55
<button
@@ -11,7 +11,7 @@
1111
<div
1212
class="relative py-1 w-full rounded-2xl flex flex-row items-center justify-center"
1313
:class="[
14-
router.currentRoute.value.path === route.path && 'tg-bg-button tg-text-button',
14+
router.currentRoute.value.path === route.path && 'tg-bg-button tg-text-button motion-translate-y-in',
1515
]"
1616
>
1717
<UIcon :name="route.icon" class="size-6" />

apps/atrium-telegram/app/components/TaskCard.vue

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
],
4444
}"
4545
class="group/task duration-200 motion-preset-bounce"
46-
@click="vibrate"
46+
@click="vibrate()"
4747
>
4848
<div class="w-full flex flex-col gap-2 items-start">
4949
<div class="flex flex-col gap-1 items-start text-left">
@@ -90,9 +90,7 @@ const { task } = defineProps<{
9090
task: Task
9191
}>()
9292
93-
const { t } = useI18n()
9493
const { vibrate } = useFeedback()
95-
const actionToast = useActionToast()
9694
const taskStore = useTaskStore()
9795
const userStore = useUserStore()
9896
@@ -154,32 +152,28 @@ const items = computed<DropdownMenuItem[]>(() => {
154152
})
155153
156154
async function onFocus() {
157-
const toastId = actionToast.start()
158-
159155
try {
160156
await taskStore.setAsFocused(task.id)
161157
await taskStore.update()
162158
await userStore.update()
163159
164-
actionToast.success(toastId, t('toast.task-focused'))
160+
vibrate('success')
165161
} catch (error) {
166162
console.error(error)
167-
actionToast.error(toastId)
163+
vibrate('error')
168164
}
169165
}
170166
171167
async function onUnfocus() {
172-
const toastId = actionToast.start()
173-
174168
try {
175169
await taskStore.setAsUnfocused(task.id)
176170
await taskStore.update()
177171
await userStore.update()
178172
179-
actionToast.success(toastId, t('toast.task-unfocused'))
173+
vibrate('success')
180174
} catch (error) {
181175
console.error(error)
182-
actionToast.error(toastId)
176+
vibrate('error')
183177
}
184178
}
185179

apps/atrium-telegram/app/components/TasksTodaySwitch.vue

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@
33
v-model="taskStore.isTodayOnly"
44
size="xl"
55
color="secondary"
6-
:label="taskStore.isTodayOnly ? 'Сегодня' : 'Все задачи'"
7-
:default-value="taskStore.isTodayOnly"
6+
:label="taskStore.isTodayOnly ? 'Задачи на сегодня' : 'Показаны все задачи'"
87
:ui="{
9-
root: 'flex-row-reverse items-center',
10-
label: 'mr-3 text-base/5 font-semibold',
8+
root: 'items-center',
9+
label: 'ml-1.5 text-base/5 font-semibold',
1110
}"
12-
@change="vibrate"
11+
@change="vibrate()"
1312
/>
1413
</template>
1514

apps/atrium-telegram/app/components/form/CompleteTask.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ const { taskId } = defineProps<{
5050
const emit = defineEmits(['success', 'submitted'])
5151
5252
const { t } = useI18n()
53+
const { vibrate } = useFeedback()
5354
const actionToast = useActionToast()
5455
const userStore = useUserStore()
5556
const taskStore = useTaskStore()
@@ -80,10 +81,12 @@ async function onSubmit(event: FormSubmitEvent<CompleteTask>) {
8081
])
8182
8283
actionToast.success(toastId, t('toast.task-completed'))
84+
vibrate('success')
8385
emit('success')
8486
} catch (error) {
8587
console.error(error)
8688
actionToast.error(toastId)
89+
vibrate('error')
8790
}
8891
}
8992
</script>

apps/atrium-telegram/app/components/form/CreateTask.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ const { performerId, listId } = defineProps<{
9696
const emit = defineEmits(['success', 'submitted'])
9797
9898
const { t } = useI18n()
99+
const { vibrate } = useFeedback()
99100
const actionToast = useActionToast()
100101
101102
const taskStore = useTaskStore()
@@ -170,10 +171,12 @@ async function onSubmit(event: FormSubmitEvent<CreateTask>) {
170171
await taskStore.update()
171172
172173
actionToast.success(toastId, t('toast.task-created'))
174+
vibrate('success')
173175
emit('success')
174176
} catch (error) {
175177
console.error(error)
176178
actionToast.error(toastId)
179+
vibrate('error')
177180
}
178181
}
179182
</script>

apps/atrium-telegram/app/components/form/CreateTaskList.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ const emit = defineEmits(['success', 'submitted'])
5959
type FormMember = { label: string, value: string, avatar: { src: string | undefined, alt: string } }
6060
6161
const { t } = useI18n()
62+
const { vibrate } = useFeedback()
6263
const actionToast = useActionToast()
6364
6465
const userStore = useUserStore()
@@ -103,10 +104,12 @@ async function onSubmit(event: FormSubmitEvent<CreateTaskList>) {
103104
])
104105
105106
actionToast.success(toastId, t('toast.task-list-created'))
107+
vibrate('success')
106108
emit('success')
107109
} catch (error) {
108110
console.error(error)
109111
actionToast.error(toastId)
112+
vibrate('error')
110113
}
111114
}
112115
</script>

0 commit comments

Comments
 (0)