Adding badge when people start editing code from someone else's project #553
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adding badge when people start editing code from someone else's project (full designs)

The fork button is in
app/web/src/components/IdeHeader/IdeHeader.tsxso that's probably where changes need to go.the following logic should help determine if there's been changes to the code
const hasUnsavedChanges = project?.code && state?.code && project?.code !== state?.codeand there is already a
canEditboolean which effectively is where the project belongs to the current user, since we want to add tell the user to fork when they have made changes but it's not their project we'll use something likeconst showForkMessage = !canEdit && hasUnsavedChangesNow that

showForkMessagecan be used to show the badge below the fork button.Changes will look something like
But you'll have to figure out the badge yourself.
Please use Tailwind for styles and the svg is part of
@heroiconscalledexclamation-circleFollow the instructions in CONTRIBUTING.md to get setup, and of course ask for help here or in the dev-help discord channel.
If you'd like to contribute the CadHub but this issue is taken or you'd prefer something else, have a look at #535 to see if there's something else you would like
Hi, i would like to take a look on this
Go for it @javibodas 😁
I've assigned it to you. Let me know if you need any help.
Some steps I just realised I missed is that you need to sign in locally with one of the demo users
localUser1@kurthutten.com: abc123
Create a project (plus button up the top right)
Then sign in as another user
localUser2@kurthutten.com: abc123
and edit the project in order to cause
showForkMessageto becometrue.Hi, I have created #554 PR, please check it out and let met know if there is something to modify
Thanks @javibodas
Resolved by #554