Skip to content

Conversation

@takaokouji
Copy link

@takaokouji takaokouji commented Aug 25, 2025

Summary

  • Implements only_blocks URL parameter to filter displayed blocks for tutorial scenarios
  • Supports exact match (e.g., motion_movesteps) and prefix match (e.g., motion_) filtering
  • Supports comma-separated multiple patterns (e.g., motion_,looks_)
  • Always displays variables, myBlocks, and extension categories regardless of filter
  • Automatically hides empty categories when all blocks are filtered out
  • Includes comprehensive integration tests for all filtering scenarios

Test plan

  • Manual testing with various URL parameter combinations
  • Integration tests covering all filtering scenarios
  • Verification that exception categories (variables, myBlocks, extensions) always appear
  • Error handling for invalid/non-matching patterns
  • Run full test suite to ensure no regressions

Usage Examples

# Show only motion blocks
http://localhost:8601?only_blocks=motion_

# Show motion and looks blocks  
http://localhost:8601?only_blocks=motion_,looks_

# Show specific blocks only
http://localhost:8601?only_blocks=motion_movesteps,looks_sayforsecs

closes #369

🤖 Generated with Claude Code

takaokouji and others added 3 commits August 25, 2025 09:09
Implements block filtering functionality for tutorial use cases where
instructors want to limit visible blocks to reduce student confusion.

- Add URL parameter parsing for only_blocks query parameter
- Support exact match and prefix match filtering (e.g., motion_movesteps or motion_)
- Support comma-separated multiple patterns (e.g., motion_,looks_)
- Always show variables, myBlocks, and extension categories
- Hide empty categories when all blocks are filtered out
- Add comprehensive integration tests for all filtering scenarios

Fixes #369

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Fix newline-per-chained-call in parseOnlyBlocks
- Fix arrow-body-style in shouldIncludeBlock
- Remove trailing spaces
- Fix arrow-parens in addCategoryIfNotEmpty helper

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Use findByText instead of textExists for more reliable testing
- Use specific block parameter values (10, 15, Hello!, 2) from actual blocks
- Match testing patterns used in existing blocks.test.js
- Ensure tests wait for elements rather than just checking existence

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

Co-Authored-By: Claude <noreply@anthropic.com>
@takaokouji takaokouji merged commit 36658fc into develop Aug 25, 2025
2 checks passed
@takaokouji takaokouji deleted the feature/only-blocks-filter branch August 25, 2025 01:01
github-actions bot pushed a commit that referenced this pull request Aug 25, 2025
…blocks-filter

feat: add only_blocks URL parameter to filter displayed blocks
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.

URL に only_blocks クエリーパラメーターが指定されていたら特定のブロックだけを選択可能にする

2 participants