From c0568027d5d4a92022b9c6ceb522d2f1cbcf6e49 Mon Sep 17 00:00:00 2001 From: Cioraneanu Mihai Date: Fri, 21 Jun 2024 21:30:23 +0300 Subject: [PATCH] * swipe to dismiss uses velocity only * docs++ --- docs/assistant.md | 16 ++++++++-------- front/composables/useSwipeToDismiss.js | 8 +++----- readme.md | 12 ++++++------ 3 files changed, 17 insertions(+), 19 deletions(-) diff --git a/docs/assistant.md b/docs/assistant.md index a52ef1c..2b8c78e 100644 --- a/docs/assistant.md +++ b/docs/assistant.md @@ -1,23 +1,23 @@ ## Transaction assistant -Easily turn words into a transaction. You can even use phone's dictation if you're hands are busy. +Easily turn words into a transaction. You can even use phone's dictation for a hands free experience :loudspeaker: Expected format: ```[Tag / category / template] [amount?] [description?]"``` - - All words until the first numerical value is the search phrase. This phrase is searched in your tags, categories and transaction-templates. It supports entering just part of the name and even getting some of the letters wrong (aka fuzzy search) -Templates have a slightly higher weight in results. + - All _words_ until the first numerical value is the "**search phrase**". This phrase is searched in your list of Tags, Categories and Templates. It supports entering just part of the name and even getting some of the letters wrong (fuzzy search). +If multiple matches are found the priority is `Templates > Tags > Categories`. -- The "amount" part can be a single or multiple numbers. If there are multiple numbers they automatically get added up +- The "**amount**" part can be a single or multiple numbers. Multiple numbers separated by a space get automatically added up `Ex. electr 20 10 1` => `electricity 31` -It alo supports mathematical expressions (just make sure to not use spaces): `Ex. 100/4+24*7`. -
This field is optional. If you have a "template", that has the amount set, you can omit this and only write the -template name. Specifying it will however overwrite the template value. +This field supports decimal values and mathematical expressions (just make sure to not use spaces): `Ex. 100/4+24.5*6`. +
This field is optional. If you have a Template, that has the amount set, you can omit this and only write the +template name. Specifying it overwrite the Template amount. - The "description" is the phrase found after the numerical part. It is also optional and will also overwrite any -"template" description if one is provided. +Template description if one is provided.

Summary

diff --git a/front/composables/useSwipeToDismiss.js b/front/composables/useSwipeToDismiss.js index c1539b1..42a4266 100644 --- a/front/composables/useSwipeToDismiss.js +++ b/front/composables/useSwipeToDismiss.js @@ -22,7 +22,7 @@ export function useSwipeToDismiss({ onSwipe, swipeRef, showDropdown }) { const { x, y } = useScroll(swipeRef) - const { lengthY: swipeYDistance, } = useSwipe(swipeRef, { + const { lengthY: swipeYDistance } = useSwipe(swipeRef, { disableTextSelect: true, onSwipeStart(e) { @@ -36,10 +36,8 @@ export function useSwipeToDismiss({ onSwipe, swipeRef, showDropdown }) { let velocity = Math.abs(swipeYDistance.value) / duration // console.log('velocity', {duration, velocity, swipeYDistance: swipeYDistance.value}) - if (zIndex === globalZIndex && swipeYDistance.value < -100) { - if (isScrollOnTop || velocity >= 1.0) { - onSwipe() - } + if (zIndex === globalZIndex && swipeYDistance.value < -100 && velocity >= 1.0) { + onSwipe() } isScrollOnTop = false diff --git a/readme.md b/readme.md index 995db3a..72d0add 100644 --- a/readme.md +++ b/readme.md @@ -54,17 +54,17 @@ Several (bad) ideas later I've come to this version. A transaction assistant :to -| Action | Result | -|---------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| - Partially write the name of a "tag" + "amount".
- Hit "Save". You're done!
(Ex. "elctr 28") | - Source account is preselected in Settings.
- Date is automatically set to "now"
- Fuzzy search found a tag with name close to what you typed ("electricity"). It also selected all of its parent tags.
- Category is selected by matching it to one of the tags above.
- The description field is copied from the child tag.
[Assistant details](./docs/assistant.md) | +| Action | Result | +|---------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| - Partially write the name of a "tag" + "amount".
- Hit "Save". You're done!
(Ex. "elctr 28") | - Source account is preselected in Settings.
- Date is automatically set to "now"
- Fuzzy search found a tag with name close to what you typed ("electricity"). It also selected all of its parent tags.
- Category is selected by matching it to one of the tags above.
- The description field is copied from the child tag.

[Assistant tutorial](./docs/assistant.md) | ## 🚀 Features -- ✅ Beautiful clean minimalistic UI :fire: -- ✅ Optimized for mobile :iphone: -- ✅ The assistant makes recording expenses feel like magic :sparkles: +- ✅ Beautiful clean minimalistic UI :fire: subtle animations and dark-theme support :first_quarter_moon_with_face: +- ✅ Optimized for mobile, with PWA support for a native feel :iphone: +- ✅ The Assistant makes recording an expense feel like magic :sparkles: - ✅ Expand Firefly data with icons for all resources :art: - ✅ Expand Firefly "tags" with the option of subtags for better granularity - ✅ Add "templates" to make auto-completing fields a breeze :loudspeaker: