-
Notifications
You must be signed in to change notification settings - Fork 1
Sync viewport previews, revamp live preview, icon-trigger class hints #229
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
659 changes: 398 additions & 261 deletions
659
plugins/SLASHED-for-WP/integrations/bricks/admin-app/src/components/LivePreview.svelte
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
2 changes: 1 addition & 1 deletion
2
plugins/SLASHED-for-WP/integrations/bricks/assets/admin-app/app.css
Large diffs are not rendered by default.
Oops, something went wrong.
39 changes: 21 additions & 18 deletions
39
plugins/SLASHED-for-WP/integrations/bricks/assets/admin-app/app.js
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
plugins/SLASHED-for-WP/integrations/bricks/assets/editor-app/app.css
Large diffs are not rendered by default.
Oops, something went wrong.
10 changes: 5 additions & 5 deletions
10
plugins/SLASHED-for-WP/integrations/bricks/assets/editor-app/app.js
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
Use nullish coalescing (
??) instead of logical OR (||) for fallback defaults.The
||operator treats all falsy values (0,'',false,null,undefined) as triggers for the fallback, which could mask legitimate PHP defaults. Ifdefaults.header_height_mobileor similar fields are explicitly set to0or an empty string in PHP, the operator will incorrectly fall back to the hardcoded'3.5'or'5'instead of using the actual PHP default.Use the nullish coalescing operator (
??) to only fall back when the value is strictlynullorundefined.🔧 Proposed fix
Also applies to: 98-98, 113-113, 123-123
🤖 Prompt for AI Agents
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.
Keeping
||here intentionally. Thedefaultprop is used only as the input placeholder, and the PHP defaults for these four fields are empty strings ('header_height_mobile' => '', etc. inclass-token-defaults.php) — that empty value means "no override, fall back to the framework value". Switching to??would yield'' ?? '3.5'→'', which re-introduces the very missing-placeholder bug this change fixes. With||, an empty PHP default correctly surfaces the framework value (3.5rem / 5rem) as the placeholder.meta.defaultsis the read-only framework default map, so a legitimate0is never expected for these height fields.Generated by Claude Code
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.
@jackgranatowski, thanks for the clear explanation — that makes complete sense. Sinceclass-token-defaults.phpuses''as the "no override" sentinel for these height fields,||is exactly right: it correctly promotes an empty-string PHP default to the visible framework placeholder (3.5/5), whereas??would pass the empty string through and silently swallow the placeholder. I'll withdraw the suggestion.✏️ Learnings added
🧠 Learnings used