Skip to content

Commit

Permalink
* swipe to dismiss uses velocity only
Browse files Browse the repository at this point in the history
* docs++
  • Loading branch information
cioraneanu committed Jun 21, 2024
1 parent 5af14f7 commit c056802
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 19 deletions.
16 changes: 8 additions & 8 deletions docs/assistant.md
Original file line number Diff line number Diff line change
@@ -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`.
<br> 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`.
<br> 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.

<h3>Summary</h3>

Expand Down
8 changes: 3 additions & 5 deletions front/composables/useSwipeToDismiss.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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
Expand Down
12 changes: 6 additions & 6 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,17 @@ Several (bad) ideas later I've come to this version. A transaction assistant :to
<img src="docs/images/demo.gif" width="300">
</div>

| Action | Result |
|---------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| - Partially write the name of a "tag" + "amount".<br>- Hit "Save". You're done!<br>(Ex. "elctr 28") | - Source account is preselected in Settings.<br>- Date is automatically set to "now"<br>- Fuzzy search found a tag with name close to what you typed ("electricity"). It also selected all of its parent tags.<br>- Category is selected by matching it to one of the tags above.<br>- The description field is copied from the child tag. <br> [Assistant details](./docs/assistant.md) |
| Action | Result |
|---------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| - Partially write the name of a "tag" + "amount".<br>- Hit "Save". You're done!<br>(Ex. "elctr 28") | - Source account is preselected in Settings.<br>- Date is automatically set to "now"<br>- Fuzzy search found a tag with name close to what you typed ("electricity"). It also selected all of its parent tags.<br>- Category is selected by matching it to one of the tags above.<br>- The description field is copied from the child tag. <br><br> [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:
Expand Down

0 comments on commit c056802

Please sign in to comment.