-
Notifications
You must be signed in to change notification settings - Fork 8
Include settings & color-scheme when sharing in the demo #84 #151
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
Conversation
tmr232
left a comment
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.
Thanks for the PR!
It seems to work well, but there are a few changes I want to make.
I think the entire shared data should go in a single query parameter.
That single parameter should be a JSON serialized object with all the rest of the data inside it, including the version number.
That way, when there is an update, we can modify things without the users seeing that or being affected.
Additionally, I want users to still be able to link to a specific language (not code, just a language setting) as it makes it easier to tell people "here, use this with C code" if they don't need to change the selected language.
Please tell me if you have any further questions - it seems I was not clear enough the first time, and I don't want to make you do duplicate work.
|
Hi Tamir! |
|
Hi Tamir, |
tmr232
left a comment
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.
This is looking much better!
There are still some changes I'd like to see though.
Mostly around error handling and code structure.
Thank you for contributing!
|
Hi Tamir, how are you? |
tmr232
left a comment
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.
This is looking much better, great work!
Still a few things to fix though, and you need to update the branch.
Also - feel free to add yourself to the CONTRIBUTORS.md file.
|
Hi Tamir, |
tmr232
left a comment
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.
So the code looks a lot nicer, and I don't really have comments on that.
But it seems that this PR breaks the color-picker feature.
With this patch, if you use the color-picker to change the colors - they don't change at all.
Please solve this bug.
|
Hi Tamir, |
|
If you open the color-picker and change a color, it should update live. When I try your PR locally - it does not. |
|
It's really weird everything seems to be working fine on my side. |
|
Try running |
|
I tried running |
tmr232
left a comment
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 have no idea what changed - but it works on my machine now.
Type of changes
Checklist
bun linton the code.Description
Pull Request Summary
Added
onMountimport (line 10): This ensures the color scheme is updated only once when the page loads.Initialized color scheme (line 83): Now retrieves the color scheme when the demo first loads.
I chose not to place this in the
runfunction, as doing so would prevent users from updating the color scheme later via state changes.Added support for new query parameters in the URL:
fontSizesimplifyflatSwitchhighlightversioncolorList(compressed)URL version:
Introduced to support future changes to the URL structure without breaking backward compatibility for shared links.
When a new format is introduced, the currentVersion variable should be incremented accordingly.
Moved fontSize parsing (from line 112 to line 74):
This was done to ensure it’s parsed early with the other URL parameters.
URL structure:
fontSize, simplify, flatSwitch, and version are added as-is to the URL to save space, while colorList is compressed.
Fixed language comparison bug (previously line 129 → now line 169):
The condition now compares language values rather than objects.
This solves a bug where clicking “Share” again after loading a shared link would incorrectly reset the language to the default (Go).
Changed the “Share (experimental)” label to simply “Share”.
Updated CHANGELOG.md with all relevant changes.
Closes #84