-
Notifications
You must be signed in to change notification settings - Fork 70
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
Improve names edit handling (fixes #123) (fixes #149) #404
Improve names edit handling (fixes #123) (fixes #149) #404
Conversation
Great, thanks! Let me know when it's ready for review. One comment: please don't modify the langugage JSONs, they are updated via Weblate. Unfortunately changing the english string is only possible by adding a new one (unless I'm mistaken). |
I was also unsure about the language jsons. I will change it. Generally I am not a JavaScript crack at all, so I am really happy for feedback for improvements. 😄 |
Unfortunately there are no unit tests for this repo as I'm not good with Javascript unit tests 🙁 . Are you referring to the Web API (Python) tests? |
src/components/GrampsjsPerson.js
Outdated
: given | ||
return html`${given} ${surname} ${suffix}` | ||
return html`${given} ${nick ? `"${nick}" ` : ''}${surname} ${suffix}` |
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.
Would be nice to use typographical quotation marks (although strictly speaking that would even by locale dependent)
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.
But on second thought I am not sure I would like to always have the nickname displayed as part of the page title ... does Gramps Desktop do it like that? I think we can use that as guidance to have a more consistent user experience. For instance, if both Gramps & Gramps Web would display nicknames as part of the person profile's title, I would likely want to move more informal nick names to a secondary name to prevent them from showing up...
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.
How do you deal with those kind of suggestions in the project? Should I open a discussion here in gitlab?
But you are right. I guess the best thing would be, if the user could choose (and define it in the user settings).
The scenario I came up with this was: It used to be like that, that parents and children often share the same given name. Sometimes they differ in second or third given names (which might not be known). To make it easier to distinguish persons, this might help.
I will remove this for now.
In my family tree there are some persons with this issue 😄 This is why they mostly have a nickname. To distinguish e.g. between mother and daughter.
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.
Maybe I can implement this when solving #67
for="button-switch-type" | ||
content="${this._hasCustomType | ||
? this._('Switch to default type') | ||
: this._('Add custom type')}" |
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.
I suggest to leave the string as it was orginally to not lose the translations.
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.
I can do that. Still I would like to propose to add the string 'Add custom type' for this scenario. It's more self explaning. But I woulf leave it like it was for now. 😄
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.
Or maybe I add the string. From UX-perspective I see it like this:
If I set a custom type and save it will become a "default type" (as it is now in the default types list in the frontend). When users read "switch" they might expect to see the custom type set before there.
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.
Not sure what you mean. There are two kinds of types in Gramps: default types and custom types. The default types are translated, while the custom types are just arbitrary strings. You can either select from a list of default types, or use a custom type instead. If you want to replace a custom type by a default type again, you have to switch back to the dropdown list.
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.
After trying it out I get your point and I think you're right 😄 I missed the fact that the dropdown contains both custom and default types.
So: great idea.
I couldn't resist to already add a couple of comments. The code looks really good overall! |
I haven't really gotten into this by now. I just thought there were some, because there is this "test"-script in the package.json. But okay, then I will ignore this. Maybe I can add some someday 😄 |
I am still not quite sure how to introduce new strings. I found the Or does Weblate identifies them inside the code? (I doubt it. 😄 ) |
Yes, just add new strings to |
I tried out your code, great work! It brings the whole name editing experience to a new level. Just two small things:
Can you hide them? |
Thanks a lot! And yes! 1.I wanted to add changing the primary name. Thanks for the hint. Just forgot it last week. 😄 |
Hi @BlitzundBogen should we merge it as is right now or two you want to implement the two points above? However there is a conflict right now. |
I am sorry, I didn't have the time to improve. I will try to at least solve the conflicts this week. If I do not find the time I will definitely find it the week after. Then I could also do the improvements. |
I had some issues with my dev environment again, which took me some time to solve. For now only the order of names/changing primary name is missing. I would suggest, if you are ready to merge, just do it and I will open a new PR for this issue. If I am faster, i will add it here. But currently I doubt that. 😄 PS: David, what happened to you profile? I cannot find you anymore. 😱 |
I am a big fan of these changes, thank you for taking care. Looking forward to do thorough testing and giving feedback. (I have no dev setup yet, so I will have to wait until the release. Is there documentation for a proper dev setup?) |
Not sure about the "proper" 😉 but here is the documentation: https://www.grampsweb.org/dev-frontend/setup/ |
Yes, Github (or its AI) suspended my account (in error) and it took them one month to process my appeal 😭 |
I'm rebasing now. |
6999dd9
to
b589112
Compare
🎉 |
…project#149) (gramps-project#404) * Fix type not shown as selected * Align names edit ux as editable list * Add delete name * Add validation to name form * Improve name type ux * Use classMap instead of style * Add ui improvements to surnames * Fix show more in name edit * Add edit features to surnames * Add nick to name * Use existing strings * Adjust call and remove nickname * Add language strings * Only show edit buttons on "show more" --------- Co-authored-by: BlitzundBogen <code@blitzundbogen.de>
Added some fixes and improvements in names' edit handling.
Fixes:
Features:
UX/UI improvements:
Fixes: