Draft
Conversation
Co-authored-by: bodhish <14979190+bodhish@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] The hero part appears to be all white after being hosted for a week
Fix hero section theme persistence issue
May 28, 2025
Owner
|
@copilot do you want to try building it again from scratch |
Co-authored-by: bodhish <14979190+bodhish@users.noreply.github.com>
Author
I've rebuilt the fix from scratch with a cleaner approach (commit 853fe4e). Key changes:
This approach is cleaner because it fixes the root cause - ensuring the exported JSON never contains Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
Users who selected the dark theme when building their site reported that the hero section appeared all white after being hosted for a week.
Root Cause
When exporting a site, if the user selected a theme color in the UI but the JSON data still had
"primaryColor": null, the client-side code wasn't properly defaulting to "indigo" after the site had been hosted for some time.Changes
Modified the
encodefunction inpackages/mytemplate/src/types/Data.resto always write the actual color value instead ofnull:("primaryColor", nullable(string, t.primaryColorString))to("primaryColor", string(primaryColor(t)))nullvalues in the exported dataUpdated the CDN references from version 0.7 to @latest in
src/utils/Config.res:These changes ensure theme persistence by making the color selection explicit in the exported HTML data rather than relying on client-side defaults.
Fixes #69.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.