-
Notifications
You must be signed in to change notification settings - Fork 318
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
Tweak tags schemas #2333
Comments
Currently implemented tag categories:
Contenders for additional tag categories:
I have notes on a full list of possible tag values for these. I'll add them to the |
Can you make this a fully inclusive list, not just "additional" categories? So add 'systems', 'type' etc. And as other contributors have additional ideas, edit the comment to include them? I just don't like bouncing around looking at various ideas. |
See #2335 for full list. |
number 3: allow non-ascii characters
Is this an either/or statement? It seems to me they aren't related--- we can allow non-ascii characters, we can reserve certain punctuation, and we can deburr when do searches (such as on the brew list page). I just want to double check your thinking here, because I think i've got the non-ascii part figured out with /^(?:(?:meta|system|type):)?[\p{L}a-z0-9][\p{L}a-z0-9 \/.\-&]{0,40}$/iu and the allowed punctuation is explicitly set in the regex as well. There is some punctuation in the extended unicode characters, but do we need to reserve those obscure characters? |
Hmm ... what was I thinking? Good question. Oh .. I was thinking we could either .. a) allow any character, but black list specific punctuation we want to reserve, or (whichever is easier to write the regex for). Regardless, (Will deburr affect obscure punctuation characters (e.g. |
regarding number 1:
I had this all set in PR #3469 and was happy with it, basically running with the suggestion of just using But then I realized this component is used for more than one instance-- brew tags and authors-- and that my simple function ( cleanValue : function(value){
value = value.trim().replace(/^(.*):/, (match)=>{return match.toLowerCase();}); // convert tag scheme (ex. 'meta:') to lowercase
return value;
}, So I'm thinking that maybe stringArrayEditor needs an additional prop-- a Lots of thinking out loud here.... |
I went this route, with |
1. make data-entry of tag prefixes case-insensitive
If someone were to enter
Type:Adventure
then the current tags data-entry widget flags that input as invalid, which could be confusing. The input should permit case-insensitive text, especially since we're ignoring case when doing searches (e.g. on the user-page).The submitted tag-type should then be normalised to lowercase. (We use the tag-type to assign a styling class to the tag element on the userpage, so it needs to be standardised there since class names are case sensitive.)
Can this be done by just tacking on the
i
flag at the end of the regex?homebrewery/client/homebrew/editor/metadataEditor/metadataEditor.jsx
Line 201 in 215b64f
(and also slimming
A-Za-z
to justa-z
since we have the case-insensitive flag in there now)We should likely also normalise the casing of known tags though to match the
datalist
options.2. allow ampersand in tag
There will likely be other suggestions for various punctuations from reddit, but at least the
&
is an obvious candidate.3. allow non-ASCII characters to support non-English language
We should however then disallow various characters, particularly punctuation characters we want to reserve for future use
Or, we run the tag through
_.deburr( )
before pattern matching (i.e. dumbify alphabetics).4. Drop the
group:
prefixThe
group:
prefix originated in early discussion of tags, when it was thought we could utilise the tag system for grouping brews into folders on the user-page. The idea of folders has been developed further and usinggroup:tag-string
looks to be the wrong direction. We also don't have any coding at all that does grouping of brews on user-pages, so dropping it now doesn't disable anything. We can always add it back if that is the way we want to go.5. Use
<datalist />
for standardised optionsSee #2335 for details — standardisation of terms, discovery of terms, discovery of
<category>:
syntax.group:
prefix<datalist />
for standardised optionsThe text was updated successfully, but these errors were encountered: