New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Format transaction notes as clickable tags #2670
base: master
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for actualbudget ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Bundle Stats — desktop-clientHey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
Changeset
View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger
Smaller No assets were smaller Unchanged
|
Bundle Stats — loot-coreHey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
Changeset
View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger
Smaller No assets were smaller Unchanged No assets were unchanged |
The colors probably could use some work, but other than that this looks great |
Any suggestions on the colors? Would it be better to apply primary colors to them? But that would make the tags stand out on the table. |
I don't think I have good recommendations for specific colors. What I was seeing is that the pill colors can be hard to see when the transaction is hovered and highlighted (the same color in midnight mode), and the pill hover color was usually really close to the normal color so it was like nothing happened when hovering. |
Those colors look good to me |
If you're already on the All Accounts screen, clicking the tag doesn't apply the filtering. |
|
Thanks! :) I also like the new behaviour where it only filters the current account screen when clicked on, I think it's more intuitive. |
488b421
to
eea961a
Compare
const filterConditions = [ | ||
{ field: 'notes', op: 'contains', value: noteTag, type: 'string' }, | ||
]; | ||
onApplyFilters(filterConditions); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💭 thought: currently the click on a tag REPLACES the existing filters. Would it be better to instead append
a filter?
I can see a use case where I filter by category. And then click on a tag to narrow it down even further. Currently that would remove the category filter.
WDYT?
function notesTagFormatter(value, onNoteTagClick) { | ||
const words = value.split(' '); | ||
return ( | ||
<> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥜 nitpick: unnecessary wrapping fragment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First of all this is amazing and I love the functionality. Any chance we could add an autocomplete list to the tags?
There's a lot going on in this PR.
I'm not sure why changing naming conventions for filters across the entire app is relevant for this PR, would be better as a separate PR.
I like the tag colors, they look good to me. Pill color changes are no good. They are used in 4 other pages and the proposed changes do not pass AA (eg they are harder to read). Might also be best in a different PR as the pill color doesn't really relate to the core functionality of this PR.
If tags have overlap in their names then you get multiple tags in the filter. Example: make tags for |
...actions.test.js-snapshots/Transactions-filters-transactions-by-category-7-chromium-linux.png
Outdated
Show resolved
Hide resolved
Wouldn't the existing #tag/b still work if that other expression was used to mark the tags? |
I think the regex needs to be something like |
I guess maybe we need to nail down what we want to have count as a tag and what is allowed in a tag. After that its pretty simple to make a regex to match those rules we want to enforce |
I would say we should just allow any characters in tags |
Probably it is because of the regex characters in it - you might need to escape the tag when building the regex? |
@psybers I have pushed a commit which escapes the regex. Tested some special characters and it seem to work fine expect when using |
If we want only "whole tags" and consider that to mean whitespace delineated, then the regex could be |
Yeah, when clicking tags, this is how I would expect the filters to behave. |
I still don't like that |
So there are three options for
Is there a commonly accepted answer used by many other software? If so I would say mimic the common behavior. If not, my vote is for 1. The current solution is 2. If we decide to switch to one of the other solutions, the regex will probably need updated too. |
I would vote for option 1. I think that would be the most obvious to people and we can easily parse that with /b in a regex. Finding the tags should be pretty straight forward to. Look for a |
This behavior seems good to me. |
That seems to be working really well. Some things of note:
|
Here is a weird one: Turns it into |
And possibly related? |
Updated the rendering logic of tags. The current regex doesn't seem work for tags that are in the middle of a string. |
Might have to allow it to be bordered by another tag... maybe something like this?
|
@psybers The problem string is when tag is preceded by a |
@joel-jeremy I mean the simple fix is to add But this regex is feeling more and more hacky and I worry it will match things we do not intend. The best approach would be to know a more or less complete set of all cases we want to match (and cases to avoid), build the NFA by hand, and then turn it into a regex. |
For #531