Skip to content

Conversation

@takaokouji
Copy link

Summary

Adds functionality to control block display/visibility through Stage comments in project files. This allows projects to specify which blocks should be visible without requiring URL parameters.

Implementation Details

  • Stage Comment Parsing: Extract only_blocks=... pattern from Stage comments using regex
  • Priority System: Stage comments > URL parameters > GUI settings
  • Redux Integration: Update selectedBlocks in Redux store to reflect in block-display-modal checkboxes
  • Workspace Refresh: Trigger workspace update after project file loading to apply block filtering

Usage Example

Add a comment to the Stage with text like:

only_blocks=motion_

This will show only motion category blocks, overriding any URL parameters.

Files Modified

  • src/containers/blocks.jsx: Added Stage comment extraction and updated filtering priority
  • src/lib/sb-file-uploader-hoc.jsx: Added selectedBlocks update after project loading

Testing

  • ✅ Lint checks pass
  • ✅ Build successful
  • ✅ Stage comment parsing works correctly
  • ✅ Block-display-modal checkboxes reflect Stage comment settings

🤖 Generated with Claude Code

- Extract only_blocks from Stage comments with regex pattern
- Apply priority: Stage comments > URL params > GUI settings
- Update selectedBlocks in Redux store to reflect in block-display-modal
- Trigger workspace refresh after project file loading

This allows projects to specify block visibility via Stage comments
like 'only_blocks=motion_' which overrides URL parameters.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@takaokouji
Copy link
Author

@takaokouji takaokouji merged commit f1d1506 into develop Sep 2, 2025
2 checks passed
@takaokouji takaokouji deleted the feature/block-display-from-comment branch September 2, 2025 00:18
github-actions bot pushed a commit that referenced this pull request Sep 2, 2025
…-display-from-comment

Add support for only_blocks setting from Stage comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants