Skip to content
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

Add custom color campcollaboration #5281

Conversation

manuelmeister
Copy link
Member

@manuelmeister manuelmeister commented Jun 2, 2024

Followup PR after #5174

@manuelmeister manuelmeister force-pushed the feature/add-custom-color-campcollaboration branch 6 times, most recently from d5bd715 to dd0258d Compare June 15, 2024 17:27
@manuelmeister manuelmeister changed the title DRAFT: Add custom color campcollaboration Add custom color campcollaboration Jun 15, 2024
@manuelmeister manuelmeister marked this pull request as ready for review June 15, 2024 17:30
@manuelmeister manuelmeister force-pushed the feature/add-custom-color-campcollaboration branch from dd0258d to 26ecabb Compare June 15, 2024 21:05
@manuelmeister manuelmeister marked this pull request as draft June 15, 2024 21:07
@manuelmeister manuelmeister force-pushed the feature/add-custom-color-campcollaboration branch from aae8e88 to a9502ee Compare June 16, 2024 10:18
@manuelmeister manuelmeister force-pushed the feature/add-custom-color-campcollaboration branch from a9502ee to 555f40b Compare June 16, 2024 15:47
@manuelmeister manuelmeister marked this pull request as ready for review June 16, 2024 15:53
@manuelmeister manuelmeister added the Meeting Discuss Am nächsten Core-Meeting besprechen label Jun 16, 2024
@usu usu added the deploy! Creates a feature branch deployment for this PR label Jun 16, 2024
@usu usu temporarily deployed to feature-branch June 16, 2024 19:31 — with GitHub Actions Inactive
Copy link

github-actions bot commented Jun 16, 2024

Feature branch deployment currently inactive.

If the PR is still open, you can add the deploy! label to this PR to trigger a feature branch deployment.

Copy link
Member

@usu usu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool 🚀

api/src/Entity/CampCollaboration.php Outdated Show resolved Hide resolved
api/src/Entity/CampCollaboration.php Outdated Show resolved Hide resolved
@manuelmeister
Copy link
Member Author

Core Meeting Decision

Implement as request by @usu

@manuelmeister manuelmeister removed Meeting Discuss Am nächsten Core-Meeting besprechen deploy! Creates a feature branch deployment for this PR labels Jun 19, 2024
@manuelmeister manuelmeister force-pushed the feature/add-custom-color-campcollaboration branch from 38c0287 to a63c516 Compare June 19, 2024 08:45
@manuelmeister manuelmeister force-pushed the feature/add-custom-color-campcollaboration branch from a63c516 to 792a8db Compare June 19, 2024 08:56
@manuelmeister manuelmeister force-pushed the feature/add-custom-color-campcollaboration branch from 1a20280 to ae4ac45 Compare June 19, 2024 09:11
#[ORM\Column(type: 'text', nullable: true)]
public ?string $collaborationAcceptedBy = null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this removed? Is was not used?

Copy link
Member Author

@manuelmeister manuelmeister Jun 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was fully dead code. Unused, and not even tested.

@carlobeltrame carlobeltrame added the deploy! Creates a feature branch deployment for this PR label Jun 19, 2024
common/helpers/campCollaborationInitials.js Show resolved Hide resolved
common/helpers/colors.js Show resolved Hide resolved
['1', true],
['12', true],
['123', false],
['🧑🏼‍🔧', true],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does one of these tests check for combining emojis? Such as skin color combiners etc.. I'm not an expert on this, so I don't know whether one of your tests already accounts for that.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is already one that is made out of 3 combined emojis.

The Man Mechanic: Light Skin Tone emoji is a ZWJ sequence combining 👨 Man, 🏻 Light Skin Tone, Zero Width Joiner and 🔧 Wrench.
– Emojipedia

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's also the reason, that I've included some basic smileys below that should be each counted as one.


export default (i18n) => ({
validate: (value) => {
return /\p{Extended_Pictographic}/u.test(value) ? size(value) <= 1 : value.length <= 2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, I learned something today.
In https://stackoverflow.com/a/72727900 it says that extended pictographic does not match a lone snowflake emoji, is that really the case? Should we use (\p{Emoji}\uFE0F|\p{Emoji_Presentation}) as that post suggests? Or is that covered in your additional logic with the length?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it is covered.

Copy link
Member

@carlobeltrame carlobeltrame left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks! As a future extension, I would like to be able to always change the color and abbreviation of my own camp collaboration, even if I'm only a guest. Would you agree?

@manuelmeister
Copy link
Member Author

manuelmeister commented Jun 19, 2024

@carlobeltrame It somehow doesn't work with clientprint 😢 I didn't test it with a composed emoji until now. With "normal" emojis it works.

@manuelmeister
Copy link
Member Author

@carlobeltrame I think we may rather add a color and abbreviation on the user, instead of user editable camp collaborators.

@carlobeltrame
Copy link
Member

@carlobeltrame It somehow doesn't work with clientprint 😢 I didn't test it with a composed emoji until now. With "normal" emojis it works.

I see, but it looks like composed emoji are a general problem in client print. No reason to delay merging this feature in my opinion.

@manuelmeister manuelmeister added this pull request to the merge queue Jun 19, 2024
@manuelmeister
Copy link
Member Author

@carlobeltrame indeed, emojis are very slow with clientprint 😢. It doesn't break, but initially it needs to load all emojis, and this is probably taking a while.

@carlobeltrame
Copy link
Member

@carlobeltrame I think we may rather add a color and abbreviation on the user, instead of user editable camp collaborators.

That would work as well (though not as flexible). But if that's the ultimate goal, why didn't you implement that in the first place?

@carlobeltrame
Copy link
Member

@carlobeltrame indeed, emojis are very slow with clientprint 😢. It doesn't break, but initially it needs to load all emojis, and this is probably taking a while.

If the loading time is the biggest problem, we could preload the emojis as soon as you navigate to a page with a print button. But also, currently, the combined emoji are rendered split up into their components. I think that is actually an intended fallback in the unicode standard, so it's okay but just not optimal.

Merged via the queue into ecamp:devel with commit bb53a63 Jun 19, 2024
32 checks passed
@manuelmeister manuelmeister deleted the feature/add-custom-color-campcollaboration branch June 19, 2024 14:37
@manuelmeister
Copy link
Member Author

That would work as well (though not as flexible). But if that's the ultimate goal, why didn't you implement that in the first place?

Because it serves another purpose. I wanted a way to distinguish different users in a camp.

The user color/abbreviation would just be an override between generated and campcollaboration color/abbreviation, and be a better fallback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deploy! Creates a feature branch deployment for this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants