Repair corrupted tailwind.config in generated dashboards#99
Merged
suiyangqiu merged 2 commits intomasterfrom May 5, 2026
Merged
Repair corrupted tailwind.config in generated dashboards#99suiyangqiu merged 2 commits intomasterfrom
suiyangqiu merged 2 commits intomasterfrom
Conversation
Add a post-processor validation step that parses every inline <script> block in the generated dashboard. If a syntax error is found and the tailwind.config block is the cause, the canonical block is re-injected from templates/dashboard.html before deployment. Also normalize the template so 'sans-serif' appears in only one syntactic context (as a quoted JS array element), removing the ambiguous bare-keyword forms that the model was occasionally cross-pollinating into the JS config. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Drop the template-side change. The validator alone is the safety net, and removing 'sans-serif' from the CSS body rule and Chart.js font string was a marginal probability-reduction with a small fallback-chain cost. Keep the template as it was on master. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Member
Author
🤖 Agent Review🚨 Must Fix / Address
|
Member
Author
|
In response to the Agent Review, I won't be actioning changes to address the additonal validation just yet, primarily because that is beyond the scope of the PR and the issue here. It definitely is a valid point and something that I have noted down however. |
Lewkans
approved these changes
May 5, 2026
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.
📝 Summary of Changes
Corresponding issue: #98
tailwind.configblock (which made the dashboard render mostly black-and-white with invisible text) are now auto-detected and auto-repaired before deployment instead of shipping broken.🤷♂️ Why
The dashboard's inline
tailwind.configscript defines thessw-red,ssw-charcoal, andssw-graypalettes. In rare regenerations the model emits a JS syntax error in this block (e.g. dropping the leading quote on'sans-serif'), the entire script throws on parse, and every utility built on those palettes silently produces no CSS - so brand colours and most text become invisible. The failure rate is low but the user-facing impact when it happens is severe (whole dashboard unreadable).The fix is a post-processor validation step that runs after Claude writes the dashboard but before deployment:
<script>block vianew Function(body)(parse-only, no execution).tailwind.configblock, confirm it is the corrupted one, and replace it with the canonical block fromtemplates/dashboard.html.🧪 Test plan
index.html(e.g. break a quote in the tailwind block) and confirm the processor repairs it before deploy🤖 Generated with Claude Code