Skip to content

Enhance tour blocks with comprehensive metadata, icons integration, and conditional registration#696

Merged
krugazul merged 7 commits into2.1-trunkfrom
refactor/tour-blocks-meta-icons
Nov 12, 2025
Merged

Enhance tour blocks with comprehensive metadata, icons integration, and conditional registration#696
krugazul merged 7 commits into2.1-trunkfrom
refactor/tour-blocks-meta-icons

Conversation

@tibiii
Copy link
Copy Markdown
Contributor

@tibiii tibiii commented Nov 11, 2025


pr: '#691'
related_issues: '#690'
blocks:

  • travel-styles
  • duration
  • single-supplement-wrapper
  • price
  • tagline
    post_types:
  • tour
    author: '@tibibuzdu'
    labels: ['enhancement', 'blocks', 'frontend']

Summary

This PR implements GitHub issue #690 by enhancing tour-related blocks with comprehensive Block API v3 metadata standardization, centralized icon integration, and conditional registration logic. The changes focus on tour-specific blocks (travel styles, duration, supplement information, pricing, and taglines) while ensuring consistent user experience and proper Block Editor integration.

The conditional registration logic was extracted into a separate js file for a better developer experience and easier maintainability.

Key Changes

Block API v3 Compliance: Enhanced metadata with comprehensive descriptions, keywords, and examples
Icon System Integration: Replaced hardcoded icons with centralized lsx-tour-operator/icons system
Conditional Registration: Implemented tour-context awareness for appropriate block visibility
Enhanced Block Metadata: Added detailed descriptions, keywords, and comprehensive example configurations
Improved User Experience: Applied consistent formatting and proper localization throughout
Code Standardization: Refactored registration logic with better error handling and readiness checks

Files Modified

Scope

✅ PHP

  • No PHP backend changes required

✅ JS/Blocks

  • Block API v3 metadata compliance for all tour blocks
  • Comprehensive block.json updates with descriptions and keywords
  • Conditional registration for tour contexts
  • Icon system integration replacing hardcoded paths
  • Enhanced example configurations for editor previews
  • Proper localization with text domains

✅ Styles

  • Integrated with centralized icon system
  • Maintains visual consistency across blocks
  • Supports theme customization through Block Editor

⏳ Tests

  • Block registration tests (future enhancement)
  • Conditional display validation (future enhancement)

✅ Docs

  • Enhanced block descriptions for user guidance
  • Comprehensive examples in block.json files
  • Improved keywords for block discovery

Technical Implementation

Enhanced Block Metadata Structure

{
  "apiVersion": 3,
  "description": "Displays the travel styles for the tour, showing the type of tour experience offered.",
  "keywords": ["travel", "styles", "tour", "type", "category", "experience"],
  "example": {
    "attributes": { /* Comprehensive example data */ }
  }
}

Icon System Integration

// Centralized icon system usage
[
  'lsx-tour-operator/icons',
  {
    iconType: 'solid',
    iconName: 'priceIcon'
  }
]

Conditional Registration Logic

// Tour context detection for appropriate block visibility
const checkAndRegister = () => {
  const postType = select('core/editor')?.getCurrentPostType();
  const postSlug = select('core/editor')?.getEditedPostSlug();
  
  return supportedPostTypes.includes(postType) || 
         (postType === 'wp_template' && postSlug.includes('tour'));
};

Meta Binding Implementation

// Post meta binding for dynamic content
metadata: {
  bindings: {
    content: {
      source: 'lsx/post-meta',
      args: { key: 'price' }
    }
  }
}

Testing Notes

  • All blocks now register conditionally based on tour post type context
  • Icon system integration maintains visual consistency
  • Enhanced descriptions improve block discoverability
  • Block metadata follows WordPress standards
  • Localization properly implemented throughout
  • Meta bindings ensure dynamic content display
  • Examples provide clear usage guidance for content creators

Related Issues

Closes #690

Summary by CodeRabbit

  • New Features

    • Enhanced Travel styles, Duration, Single supplement, Price, and Tagline blocks with richer metadata (descriptions, icons, keywords, examples)
    • Added conditional registration to show blocks only in relevant tour contexts
    • Integrated centralized icon system for consistent visual presentation
    • Implemented post meta bindings for dynamic content display
    • Added comprehensive example configurations for better editor previews
  • Refactor

    • Improved block registration logic with readiness checks and error handling
    • Standardized block metadata following Block API v3 specifications
    • Enhanced localization support throughout all blocks

Summary by CodeRabbit

  • New Features

    • Richer block metadata and editor previews for Duration, Price, Single Supplement, Tagline and Travel styles.
    • Internationalisation added to these block variations.
    • Variations now register conditionally based on editor context so only relevant options appear.
    • New conditional registration utility enabling deferred, context-aware variation registration.
  • Bug Fixes

    • Variation activation logic adjusted so variations appear correctly based on block class names.
  • Documentation

    • New guide covering conditional block registration usage and troubleshooting.
  • Chores

    • Build config updated with a module alias to simplify imports.

…egistration

- Updated block meta for duration, price, single supplement, tagline, and travel styles blocks to include descriptions, icons, keywords, and examples.
- Refactored index.js files for duration, price, single supplement, tagline, and travel styles blocks to register block variations with improved attributes and examples.
- Added support for translations using the __() function for block titles and content.
- Improved inner block structures for better layout and presentation in the editor.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Nov 11, 2025

Caution

Review failed

The pull request is closed.

Warning

CodeRabbit GitHub Action detected

The repository is using both CodeRabbit Pro and CodeRabbit Open Source (via GitHub Actions), which is not recommended as it may lead to duplicate comments and extra noise. Please remove the CodeRabbit GitHub Action.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized key(s) in object: 'commands', 'linked_issues', 'plugin_context'
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Walkthrough

Adds richer block manifests and editor examples for multiple blocks; introduces a reusable conditional block-registration utility and webpack alias; converts many block registration modules to deferred, post-type/template-gated registration with i18n, expanded innerBlocks (icons, post-meta bindings) and updated isActive predicates.

Changes

Cohort / File(s) Summary
Block manifests
src/blocks/duration/block.json, src/blocks/price/block.json, src/blocks/single-supplement-wrapper/block.json, src/blocks/tagline/block.json, src/blocks/travel-styles/block.json
Enriched block.json metadata (textdomain, description, icon, keywords), normalized titles, and replaced minimal examples with richer example objects containing attributes, innerBlocks, nested layouts and preview content.
Block registration modules (guarded/conditional)
src/blocks/duration/index.js, src/blocks/price/index.js, src/blocks/single-supplement-wrapper/index.js, src/blocks/tagline/index.js, src/blocks/travel-styles/index.js
Replace unconditional registerBlockVariation with guarded registerXVariation functions; add i18n (__) usage; add isActive predicates comparing top-level className; move to nested innerBlocks (including lsx-tour-operator/icons block and post-meta bindings); provide example preview configs; defer registration via conditional utility.
Adjusted existing variations isActive
src/blocks/booking-validity/index.js, src/blocks/departs-from/index.js, src/blocks/ends-in/index.js, src/blocks/group-size/index.js, src/blocks/included/index.js, src/blocks/not-included/index.js
Update isActive predicates to compare blockAttributes.className === variationAttributes.className (use top-level className instead of nested metadata.className).
Conditional registration utility
src/js/conditional-block-registration.js
New factory createConditionalRegistration(config) plus wrappers registerForPostTypes, registerForTemplates, registerForPostTypesAndTemplates. Validates config, checks editor context (post type / template slug supporting string or RegExp), subscribes/retries via wp.data.subscribe until criteria match or timeout, and logs errors.
Docs
docs/block-development/conditional-block-registration.md
New documentation describing API, usage examples, migration guidance, slug matching rules, error handling and testing guidance for conditional registration.
Build config
webpack.config.js
Added resolve.alias @utils -> src/js/ to simplify imports.
Changelog
changelog.md
Added entry noting extraction of conditional block registration into its own module.

Sequence Diagram(s)

sequenceDiagram
    participant Block as Block module (index.js)
    participant Util as ConditionalRegistration
    participant WPData as wp.data
    participant Registry as wp.blocks

    Block->>Util: registerForPostTypesAndTemplates(criteria, registerXVariation)
    Util->>WPData: select('core/editor').getCurrentPostType()/getEditedPostSlug()
    WPData-->>Util: context (may be undefined)
    alt Context matches
        Util->>Registry: invoke registerXVariation() → registerBlockVariation
        Registry-->>Util: registered
    else Context not ready
        Util->>WPData: subscribe(callback)
        WPData-->>Util: state changed
        Util->>WPData: re-check criteria
        alt Now matches
            Util->>Registry: registerXVariation() and unsubscribe
            Registry-->>Util: registered
        else Timeout / no match
            Util-->>Block: log error / stop
        end
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Areas needing extra attention:
    • src/js/conditional-block-registration.js — matching logic for string vs RegExp slugs, subscribe/unsubscribe lifecycle, retry/timeout behavior, and error handling.
    • Each modified src/blocks/*/index.js — correctness of isActive predicates, i18n usage, innerBlocks nesting (icons block and post-meta bindings), and example payload shapes.
    • webpack.config.js — alias correctness and any import path changes that rely on @utils.

Possibly related issues

Possibly related PRs

  • PR #645 — Strongly related: similar guarded, post-type/template-aware block registration pattern and variation changes.
  • PR #547 — Related at code level: introduces/registers the lsx-tour-operator/icons block used by the updated innerBlocks.
  • PR #667 — Related: applies conditional registration pattern and metadata standardization to many of the same blocks.

Suggested labels

comp:block-variations, comp:block-editor, comp:block-json, comp:block-supports, comp:block-inserter

Suggested reviewers

  • ZaredRogers

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main enhancement: comprehensive metadata, icon integration, and conditional registration for tour blocks.
Description check ✅ Passed The PR description includes summary, key changes, files modified, scope, technical implementation, testing notes, and related issues, generally following the template structure despite non-standard YAML front matter.
Linked Issues check ✅ Passed The PR implements all core coding objectives from issue #690: Block API v3 metadata compliance, icon integration via centralized system, conditional registration for tour contexts, and example configurations.
Out of Scope Changes check ✅ Passed All changes are directly aligned with issue #690 objectives; the webpack.config.js alias addition and conditional-block-registration.js utility are supporting infrastructure for the main block enhancements.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 95f5479 and 9a76a2d.

⛔ Files ignored due to path filters (22)
  • build/blocks/booking-validity/index.asset.php is excluded by !build/**
  • build/blocks/booking-validity/index.js is excluded by !build/**
  • build/blocks/departs-from/index.asset.php is excluded by !build/**
  • build/blocks/departs-from/index.js is excluded by !build/**
  • build/blocks/duration/index.asset.php is excluded by !build/**
  • build/blocks/duration/index.js is excluded by !build/**
  • build/blocks/ends-in/index.asset.php is excluded by !build/**
  • build/blocks/ends-in/index.js is excluded by !build/**
  • build/blocks/group-size/index.asset.php is excluded by !build/**
  • build/blocks/group-size/index.js is excluded by !build/**
  • build/blocks/included/index.asset.php is excluded by !build/**
  • build/blocks/included/index.js is excluded by !build/**
  • build/blocks/not-included/index.asset.php is excluded by !build/**
  • build/blocks/not-included/index.js is excluded by !build/**
  • build/blocks/price/index.asset.php is excluded by !build/**
  • build/blocks/price/index.js is excluded by !build/**
  • build/blocks/single-supplement-wrapper/index.asset.php is excluded by !build/**
  • build/blocks/single-supplement-wrapper/index.js is excluded by !build/**
  • build/blocks/tagline/index.asset.php is excluded by !build/**
  • build/blocks/tagline/index.js is excluded by !build/**
  • build/blocks/travel-styles/index.asset.php is excluded by !build/**
  • build/blocks/travel-styles/index.js is excluded by !build/**
📒 Files selected for processing (11)
  • src/blocks/booking-validity/index.js (1 hunks)
  • src/blocks/departs-from/index.js (1 hunks)
  • src/blocks/duration/index.js (1 hunks)
  • src/blocks/ends-in/index.js (1 hunks)
  • src/blocks/group-size/index.js (1 hunks)
  • src/blocks/included/index.js (1 hunks)
  • src/blocks/not-included/index.js (1 hunks)
  • src/blocks/price/index.js (1 hunks)
  • src/blocks/single-supplement-wrapper/index.js (1 hunks)
  • src/blocks/tagline/index.js (1 hunks)
  • src/blocks/travel-styles/index.js (1 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added lang:php PHP code lang:css Stylesheets lang:javascript area:block-editor status:needs-review Awaiting code review meta:needs-changelog Requires a changelog entry before merge labels Nov 11, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in Tour Operator Nov 11, 2025
@tibiii tibiii added this to the v2.1.0 milestone Nov 11, 2025
@tibiii tibiii self-assigned this Nov 11, 2025
@github-actions
Copy link
Copy Markdown

github-actions bot commented Nov 11, 2025

Image description CodeRabbit


Uplevel your code reviews with CodeRabbit Pro

CodeRabbit Pro

If you like this project, please support us by purchasing the Pro version. The Pro version has advanced context, superior noise reduction and several proprietary improvements compared to the open source version. Moreover, CodeRabbit Pro is free for open source projects.

@github-actions github-actions bot added status:needs-review Awaiting code review and removed status:needs-review Awaiting code review labels Nov 11, 2025
Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

Commits Files that changed from the base of the PR and between ec7c129 and 1cbd682 commits.
Files selected (5)
  • src/blocks/duration/index.js (1)
  • src/blocks/price/index.js (1)
  • src/blocks/single-supplement-wrapper/index.js (1)
  • src/blocks/tagline/index.js (1)
  • src/blocks/travel-styles/index.js (1)
Files ignored due to filter (10)
  • build/blocks/duration/block.json
  • build/blocks/price/block.json
  • build/blocks/single-supplement-wrapper/block.json
  • build/blocks/tagline/block.json
  • build/blocks/travel-styles/block.json
  • src/blocks/duration/block.json
  • src/blocks/price/block.json
  • src/blocks/single-supplement-wrapper/block.json
  • src/blocks/tagline/block.json
  • src/blocks/travel-styles/block.json
Files not summarized due to errors (5)
  • src/blocks/single-supplement-wrapper/index.js (nothing obtained from openai)
  • src/blocks/travel-styles/index.js (nothing obtained from openai)
  • src/blocks/duration/index.js (nothing obtained from openai)
  • src/blocks/tagline/index.js (nothing obtained from openai)
  • src/blocks/price/index.js (nothing obtained from openai)
Files not reviewed due to errors (5)
  • src/blocks/price/index.js (no response)
  • src/blocks/single-supplement-wrapper/index.js (no response)
  • src/blocks/tagline/index.js (no response)
  • src/blocks/travel-styles/index.js (no response)
  • src/blocks/duration/index.js (no response)
Review comments generated (0)
  • Review: 0
  • LGTM: 0

Tips

Chat with Image description CodeRabbit Bot (@coderabbitai)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @coderabbitai in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @coderabbitai: ignore anywhere in the PR description to pause further reviews from the bot.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 9

🧹 Nitpick comments (5)
src/blocks/tagline/block.json (1)

9-18: Add accessibility guidance to the description.

Line 9 updates the block description but still misses the required editor-facing accessibility guidance noted in our manifest guidelines. Please extend the description to tell editors how to keep the tagline concise and meaningful for assistive tech users. Based on coding guidelines.

src/blocks/single-supplement-wrapper/block.json (1)

9-18: Include accessibility guidance in the block description.

Line 9’s copy still omits any instructions for editors on presenting the single supplement charge accessibly (e.g. plain text labels for screen readers). Please extend the description accordingly so we comply with the manifest accessibility guideline. Based on coding guidelines.

src/blocks/duration/block.json (1)

9-18: Document accessibility expectations in the description.

Line 9 adds a richer blurb but does not mention how editors should present duration info for assistive technologies. Please expand the text so it clearly instructs editors to keep the wording screen-reader friendly, per our block.json accessibility requirement. Based on coding guidelines.

src/blocks/travel-styles/index.js (1)

142-142: Document or extract the magic timeout value.

The 100ms delay is hard-coded without explanation. If this value is critical for allowing the editor to initialise, document it. If it's reusable across blocks, extract it as a named constant.

+    // Allow editor to initialise before checking post type.
+    const EDITOR_INIT_DELAY = 100;
+
     // Try initial registration with a small delay
-    setTimeout(() => {
+    setTimeout(() => {
src/blocks/price/index.js (1)

57-57: Ensure consistent spacing in translated strings.

Line 57 uses 'From:' (no space after colon) whilst line 114 uses 'From: ' (with space). Maintain consistent formatting for the same label.

If the space is intentional for the example, consider documenting it. Otherwise, standardise:

-                                content: '<strong>' + __('From:', 'tour-operator') + '</strong>',
+                                content: '<strong>' + __('From: ', 'tour-operator') + '</strong>',

Also applies to: 114-114

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ec7c129 and 1cbd682.

⛔ Files ignored due to path filters (92)
  • build/admin-rtl.css is excluded by !build/**
  • build/admin-script.asset.php is excluded by !build/**
  • build/blocks/accommodation-related-accommodation/index.asset.php is excluded by !build/**
  • build/blocks/accommodation-related-destination/index.asset.php is excluded by !build/**
  • build/blocks/accommodation-related-tour/index.asset.php is excluded by !build/**
  • build/blocks/accommodation-type/index.asset.php is excluded by !build/**
  • build/blocks/additional-info/index.asset.php is excluded by !build/**
  • build/blocks/banking/index.asset.php is excluded by !build/**
  • build/blocks/banner-cover/index.asset.php is excluded by !build/**
  • build/blocks/best-time-to-visit/index.asset.php is excluded by !build/**
  • build/blocks/booking-validity/index.asset.php is excluded by !build/**
  • build/blocks/checkin-time/index.asset.php is excluded by !build/**
  • build/blocks/checkout-time/index.asset.php is excluded by !build/**
  • build/blocks/climate/index.asset.php is excluded by !build/**
  • build/blocks/cuisine/index.asset.php is excluded by !build/**
  • build/blocks/day-by-day/index.asset.php is excluded by !build/**
  • build/blocks/departs-from/index.asset.php is excluded by !build/**
  • build/blocks/destination-to-accommodation/index.asset.php is excluded by !build/**
  • build/blocks/dress/index.asset.php is excluded by !build/**
  • build/blocks/duration/block.json is excluded by !build/**
  • build/blocks/duration/index.asset.php is excluded by !build/**
  • build/blocks/duration/index.js is excluded by !build/**
  • build/blocks/electricity/index.asset.php is excluded by !build/**
  • build/blocks/ends-in/index.asset.php is excluded by !build/**
  • build/blocks/facilities/index.asset.php is excluded by !build/**
  • build/blocks/facts-country-wrapper/index.asset.php is excluded by !build/**
  • build/blocks/facts-regions-wrapper/index.asset.php is excluded by !build/**
  • build/blocks/featured-accommodation/index.asset.php is excluded by !build/**
  • build/blocks/featured-destinations/index.asset.php is excluded by !build/**
  • build/blocks/featured-tours/index.asset.php is excluded by !build/**
  • build/blocks/gallery/index.asset.php is excluded by !build/**
  • build/blocks/google-map/index.asset.php is excluded by !build/**
  • build/blocks/group-size/index.asset.php is excluded by !build/**
  • build/blocks/health/index.asset.php is excluded by !build/**
  • build/blocks/icons/index.asset.php is excluded by !build/**
  • build/blocks/icons/style-index-rtl.css is excluded by !build/**
  • build/blocks/included/index.asset.php is excluded by !build/**
  • build/blocks/itinerary/index.asset.php is excluded by !build/**
  • build/blocks/lsx-destination-to-tour/index.asset.php is excluded by !build/**
  • build/blocks/minimum-child-age/index.asset.php is excluded by !build/**
  • build/blocks/modal-button/index.asset.php is excluded by !build/**
  • build/blocks/more-link/index.asset.php is excluded by !build/**
  • build/blocks/not-included/index.asset.php is excluded by !build/**
  • build/blocks/number-of-rooms/index.asset.php is excluded by !build/**
  • build/blocks/permalink-button/index.asset.php is excluded by !build/**
  • build/blocks/price-include-exclude/index.asset.php is excluded by !build/**
  • build/blocks/price/block.json is excluded by !build/**
  • build/blocks/price/index.asset.php is excluded by !build/**
  • build/blocks/price/index.js is excluded by !build/**
  • build/blocks/rating/index.asset.php is excluded by !build/**
  • build/blocks/regions/index.asset.php is excluded by !build/**
  • build/blocks/related-regions/index.asset.php is excluded by !build/**
  • build/blocks/review-related-accommodation/index.asset.php is excluded by !build/**
  • build/blocks/review-related-destination/index.asset.php is excluded by !build/**
  • build/blocks/review-related-tour/index.asset.php is excluded by !build/**
  • build/blocks/safety/index.asset.php is excluded by !build/**
  • build/blocks/single-supplement-wrapper/block.json is excluded by !build/**
  • build/blocks/single-supplement-wrapper/index.asset.php is excluded by !build/**
  • build/blocks/single-supplement-wrapper/index.js is excluded by !build/**
  • build/blocks/special-interests/index.asset.php is excluded by !build/**
  • build/blocks/spoken-languages/index.asset.php is excluded by !build/**
  • build/blocks/sticky-menu/index.asset.php is excluded by !build/**
  • build/blocks/sticky-menu/sticky-menu-editor-extension.asset.php is excluded by !build/**
  • build/blocks/sticky-menu/style-index-rtl.css is excluded by !build/**
  • build/blocks/sticky-menu/view.asset.php is excluded by !build/**
  • build/blocks/suggested-visitor-types/index.asset.php is excluded by !build/**
  • build/blocks/tagline/block.json is excluded by !build/**
  • build/blocks/tagline/index.asset.php is excluded by !build/**
  • build/blocks/tagline/index.js is excluded by !build/**
  • build/blocks/tour-related-accommodation/index.asset.php is excluded by !build/**
  • build/blocks/tour-related-destination/index.asset.php is excluded by !build/**
  • build/blocks/tour-related-tour/index.asset.php is excluded by !build/**
  • build/blocks/transport/index.asset.php is excluded by !build/**
  • build/blocks/travel-styles/block.json is excluded by !build/**
  • build/blocks/travel-styles/index.asset.php is excluded by !build/**
  • build/blocks/travel-styles/index.js is excluded by !build/**
  • build/blocks/unit-rooms/index.asset.php is excluded by !build/**
  • build/blocks/units/index.asset.php is excluded by !build/**
  • build/blocks/videos/index.asset.php is excluded by !build/**
  • build/blocks/visa/index.asset.php is excluded by !build/**
  • build/blocks/wetu-map/index.asset.php is excluded by !build/**
  • build/custom.asset.php is excluded by !build/**
  • build/general.asset.php is excluded by !build/**
  • build/linked-cover.asset.php is excluded by !build/**
  • build/maps.asset.php is excluded by !build/**
  • build/metabox-structure.asset.php is excluded by !build/**
  • build/metaboxes-rtl.css is excluded by !build/**
  • build/modals.asset.php is excluded by !build/**
  • build/scporder.asset.php is excluded by !build/**
  • build/slider-query.asset.php is excluded by !build/**
  • build/slotfills.asset.php is excluded by !build/**
  • build/style-rtl.css is excluded by !build/**
📒 Files selected for processing (10)
  • src/blocks/duration/block.json (1 hunks)
  • src/blocks/duration/index.js (1 hunks)
  • src/blocks/price/block.json (1 hunks)
  • src/blocks/price/index.js (1 hunks)
  • src/blocks/single-supplement-wrapper/block.json (1 hunks)
  • src/blocks/single-supplement-wrapper/index.js (1 hunks)
  • src/blocks/tagline/block.json (1 hunks)
  • src/blocks/tagline/index.js (1 hunks)
  • src/blocks/travel-styles/block.json (1 hunks)
  • src/blocks/travel-styles/index.js (1 hunks)
🧰 Additional context used
📓 Path-based instructions (14)
src/**/*.{js,jsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use @wordpress/eslint-plugin for JavaScript linting

Files:

  • src/blocks/travel-styles/index.js
  • src/blocks/tagline/index.js
  • src/blocks/single-supplement-wrapper/index.js
  • src/blocks/price/index.js
  • src/blocks/duration/index.js
src/**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

src/**/*.{js,jsx,ts,tsx}: Use useBlockProps() in block edit/save components when applicable
Use the text domain tour-operator for JS i18n calls

Files:

  • src/blocks/travel-styles/index.js
  • src/blocks/tagline/index.js
  • src/blocks/single-supplement-wrapper/index.js
  • src/blocks/price/index.js
  • src/blocks/duration/index.js
{assets,src}/**/*

📄 CodeRabbit inference engine (.github/instructions/block-theme-structure.instructions.md)

Keep SCSS/JS/images source assets in assets/ or src/

Files:

  • src/blocks/travel-styles/index.js
  • src/blocks/duration/block.json
  • src/blocks/tagline/index.js
  • src/blocks/single-supplement-wrapper/index.js
  • src/blocks/single-supplement-wrapper/block.json
  • src/blocks/travel-styles/block.json
  • src/blocks/price/index.js
  • src/blocks/tagline/block.json
  • src/blocks/price/block.json
  • src/blocks/duration/index.js
**/*.{js,ts}

📄 CodeRabbit inference engine (.github/instructions/javascript-react.instructions.md)

**/*.{js,ts}: Use const or let instead of var for variable declarations
Use default parameters for function arguments where appropriate
Use @wordpress/api-fetch (optionally with addQueryArgs) for REST API requests
Register blocks via registerBlockType using block metadata (imported from block.json), and localize title/description/keywords
Use wp.media for media selection in custom components/utilities when needed
Create and register custom data stores with @wordpress/data (createReduxStore + register), and structure actions/selectors clearly
Initialize frontend interactivity after DOMContentLoaded and implement ARIA attributes for toggles (aria-controls, aria-expanded)
Handle AJAX form submissions with fetch, proper loading states, and user notices; restore UI state in finally
Implement accessibility utilities like focus trapping and polite screen reader announcements for dynamic content

Files:

  • src/blocks/travel-styles/index.js
  • src/blocks/tagline/index.js
  • src/blocks/single-supplement-wrapper/index.js
  • src/blocks/price/index.js
  • src/blocks/duration/index.js
**/*.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (.github/instructions/javascript-react.instructions.md)

**/*.{js,ts,jsx,tsx}: Prefer arrow functions for callbacks and inline handlers
Use object/array destructuring for cleaner code
Use template literals for string interpolation
Use async/await for promise handling with try/catch for errors
Use WordPress i18n APIs (__/_n/sprintf) with a consistent textdomain for all user-facing strings; include translator comments where needed
Use @wordpress/data dispatch/select for interacting with WP data stores (e.g., core/notices, core/editor)

Files:

  • src/blocks/travel-styles/index.js
  • src/blocks/tagline/index.js
  • src/blocks/single-supplement-wrapper/index.js
  • src/blocks/price/index.js
  • src/blocks/duration/index.js
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.github/instructions/js-ts.instructions.md)

**/*.{ts,tsx,js,jsx}: Debounce user inputs to prevent excessive processing
Avoid blocking the UI thread (prefer async/non-blocking operations)

Files:

  • src/blocks/travel-styles/index.js
  • src/blocks/tagline/index.js
  • src/blocks/single-supplement-wrapper/index.js
  • src/blocks/price/index.js
  • src/blocks/duration/index.js
**/*.{js,mjs,ts,tsx}

📄 CodeRabbit inference engine (.github/instructions/performance.instructions.md)

Defer non-critical JavaScript and avoid synchronous blocking operations

Files:

  • src/blocks/travel-styles/index.js
  • src/blocks/tagline/index.js
  • src/blocks/single-supplement-wrapper/index.js
  • src/blocks/price/index.js
  • src/blocks/duration/index.js
**/*.{php,js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.github/instructions/review.instructions.md)

Internationalize user‑facing strings using WordPress i18n APIs

Files:

  • src/blocks/travel-styles/index.js
  • src/blocks/tagline/index.js
  • src/blocks/single-supplement-wrapper/index.js
  • src/blocks/price/index.js
  • src/blocks/duration/index.js
**/*.{css,js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.github/instructions/reviews.instructions.md)

Minimize CSS/JS payload size

Files:

  • src/blocks/travel-styles/index.js
  • src/blocks/tagline/index.js
  • src/blocks/single-supplement-wrapper/index.js
  • src/blocks/price/index.js
  • src/blocks/duration/index.js
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.github/instructions/reviews.instructions.md)

Lazy-load code and resources where possible

Files:

  • src/blocks/travel-styles/index.js
  • src/blocks/tagline/index.js
  • src/blocks/single-supplement-wrapper/index.js
  • src/blocks/price/index.js
  • src/blocks/duration/index.js
**/*.{js,ts,tsx,jsx}

⚙️ CodeRabbit configuration file

**/*.{js,ts,tsx,jsx}: Perform a detailed review of the provided code with following key aspects in mind:

  • Review the code to ensure it is well-structured and adheres to best practices.
  • Verify compliance with WordPress coding standards and @wordpress/eslint-plugin rules.
  • Ensure the code is well-documented with proper JSDoc comments.
  • Check for security vulnerabilities and confirm the code is secure.
  • Optimize the code for performance, removing any unnecessary elements.
  • Validate JSDoc comments for accuracy, currency, and adherence to WordPress coding standards.
  • Ensure each line comment concludes with a period.
  • Confirm every JSDoc comment includes a @SInCE tag indicating the next version of the plugin to include the code.
  • Guarantee compatibility with the latest version of WordPress, avoiding deprecated functions or features.
  • Follow WordPress JavaScript coding standards and use WordPress script localization.
  • Use WordPress script dependencies and enqueue properly.
  • Ensure React/JSX best practices for blocks and modern JavaScript/TypeScript patterns.
  • Implement proper error handling and loading states.
  • Use WordPress components and design system where applicable.
  • For Tour Operator: Focus on tour booking interfaces, search functionality, and tour display components.

Files:

  • src/blocks/travel-styles/index.js
  • src/blocks/tagline/index.js
  • src/blocks/single-supplement-wrapper/index.js
  • src/blocks/price/index.js
  • src/blocks/duration/index.js
src/blocks/**/*.{js,jsx,ts,tsx}

⚙️ CodeRabbit configuration file

src/blocks/**/*.{js,jsx,ts,tsx}: - Follow WordPress JavaScript coding standards and @wordpress/scripts configuration.

  • Use WordPress components from @wordpress/components and design system.
  • Implement proper React/JSX patterns for WordPress blocks.
  • Ensure proper WordPress script dependencies and localization.
  • Use WordPress data store patterns with @wordpress/data.
  • Implement proper error boundaries and loading states.
  • Follow modern JavaScript/TypeScript patterns with proper typing.
  • Ensure accessibility in interactive block components.
  • Use WordPress block editor APIs correctly (useBlockProps, InspectorControls, etc.).
  • Implement proper block validation and save/edit functionality.

Files:

  • src/blocks/travel-styles/index.js
  • src/blocks/tagline/index.js
  • src/blocks/single-supplement-wrapper/index.js
  • src/blocks/price/index.js
  • src/blocks/duration/index.js
src/**/block.json

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

src/**/block.json: Prefer block.json with server-side registration for blocks (avoid ad‑hoc registration)
Use the block namespace lsx-to in block names

Files:

  • src/blocks/duration/block.json
  • src/blocks/single-supplement-wrapper/block.json
  • src/blocks/travel-styles/block.json
  • src/blocks/tagline/block.json
  • src/blocks/price/block.json
**/block.json

📄 CodeRabbit inference engine (.github/instructions/accessibility.instructions.md)

**/block.json: Provide meaningful block titles, descriptions, and keywords in block.json
Include editor-specific accessibility guidance in block descriptions (block.json)
Include accessibility considerations in block registration (e.g., supports, attributes)

**/block.json: In block.json, include required fields: name, title, description, category, keywords, and supports
Ensure accessible metadata in block.json: use clear, descriptive title and description
Provide reasonable default values for attributes in block.json
Use usesInnerBlocks in block.json only when the block actually contains InnerBlocks
Define block variations in block.json to provide common starting points
Ensure i18n and RTL safety for user-facing strings in block.json (including variations)

Files:

  • src/blocks/duration/block.json
  • src/blocks/single-supplement-wrapper/block.json
  • src/blocks/travel-styles/block.json
  • src/blocks/tagline/block.json
  • src/blocks/price/block.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: review
  • GitHub Check: Summary
🔇 Additional comments (2)
src/blocks/travel-styles/block.json (1)

1-70: LGTM! Comprehensive block metadata.

The block.json enhancements follow WordPress Block API v3 standards with appropriate textdomain, description, icon, keywords, and a detailed example configuration for editor previews.

src/blocks/price/block.json (1)

1-34: LGTM! Well-structured block metadata.

The price block metadata follows Block API v3 standards with appropriate textdomain, description, icon, keywords, and example configuration.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances tour-related blocks with Block API v3 compliance, centralized icon integration, and conditional registration logic. The changes focus on five tour blocks (travel styles, duration, single supplement, price, and tagline) with comprehensive metadata updates and improved user experience.

Key Changes

  • Block API v3 metadata standardization with descriptions, keywords, and examples
  • Centralized icon system integration replacing hardcoded image paths
  • Conditional registration for tour-context awareness in editor

Reviewed Changes

Copilot reviewed 102 out of 102 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/blocks/travel-styles/index.js Added conditional registration logic and icon system integration with internationalization
src/blocks/travel-styles/block.json Enhanced with comprehensive metadata, keywords, and example configuration
src/blocks/duration/index.js Implemented conditional registration with centralized icon system
src/blocks/duration/block.json Added Block API v3 metadata with descriptions and keywords
src/blocks/single-supplement-wrapper/index.js Refactored with tour-context detection and icon integration
src/blocks/single-supplement-wrapper/block.json Updated with comprehensive metadata and example configuration
src/blocks/price/index.js Enhanced with conditional registration and centralized icons
src/blocks/price/block.json Added API v3 compliance with detailed examples
src/blocks/tagline/index.js Implemented conditional registration and improved layout
src/blocks/tagline/block.json Enhanced metadata with keywords and examples
build/* Compiled assets with updated dependencies and version hashes

@github-actions github-actions bot added area:ci Build and CI pipelines lang:md Markdown content/docs and removed status:needs-review Awaiting code review labels Nov 11, 2025
…edwp/tour-operator into refactor/tour-blocks-meta-icons
@github-actions github-actions bot added status:needs-review Awaiting code review and removed status:needs-review Awaiting code review labels Nov 11, 2025
Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

Commits Files that changed from the base of the PR and between 489a278 and 95f5479 commits.
Files selected (5)
  • src/blocks/duration/index.js (1)
  • src/blocks/price/index.js (1)
  • src/blocks/single-supplement-wrapper/index.js (1)
  • src/blocks/tagline/index.js (1)
  • src/blocks/travel-styles/index.js (1)
Files ignored due to filter (2)
  • build/blocks/price/block.json
  • src/blocks/price/block.json
Files not summarized due to errors (5)
  • src/blocks/price/index.js (nothing obtained from openai)
  • src/blocks/duration/index.js (nothing obtained from openai)
  • src/blocks/travel-styles/index.js (nothing obtained from openai)
  • src/blocks/tagline/index.js (nothing obtained from openai)
  • src/blocks/single-supplement-wrapper/index.js (nothing obtained from openai)
Files not reviewed due to errors (5)
  • src/blocks/duration/index.js (no response)
  • src/blocks/single-supplement-wrapper/index.js (no response)
  • src/blocks/price/index.js (no response)
  • src/blocks/tagline/index.js (no response)
  • src/blocks/travel-styles/index.js (no response)
Review comments generated (0)
  • Review: 0
  • LGTM: 0

Tips

Chat with Image description CodeRabbit Bot (@coderabbitai)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @coderabbitai in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @coderabbitai: ignore anywhere in the PR description to pause further reviews from the bot.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

♻️ Duplicate comments (2)
src/blocks/single-supplement-wrapper/index.js (1)

22-24: Fix the isActive comparator to match the correct attribute path.

The variation defines className at attributes.className (line 29), not metadata.className. The current comparison will always fail.

Apply this diff:

             isActive: (blockAttributes, variationAttributes) => {
-                return blockAttributes.metadata?.className === variationAttributes.metadata?.className;
+                return blockAttributes.className === variationAttributes.attributes?.className;
             },
src/blocks/tagline/index.js (1)

21-23: Fix the isActive comparator to match the correct attribute path.

The variation defines className at attributes.className (line 37), not metadata.className. The current comparison will always fail because variationAttributes.metadata?.className is undefined.

Apply this diff:

             isActive: (blockAttributes, variationAttributes) => {
-                return blockAttributes.metadata?.className === variationAttributes.metadata?.className;
+                return blockAttributes.className === variationAttributes.attributes?.className;
             },
🧹 Nitpick comments (9)
src/blocks/travel-styles/index.js (2)

1-116: Add JSDoc documentation with @SInCE tags.

Per the coding guidelines, all functions and modules require JSDoc comments with @since tags indicating the next plugin version. Add a module-level JSDoc block describing the file's purpose and function-level JSDoc for registerTravelStylesVariation.

As per coding guidelines.


50-50: Consider using template literals for improved readability.

The string concatenation using + operators could be replaced with template literals for cleaner, more maintainable code.

Example for line 50:

-                                content: '<strong>' + __('Travel Styles:', 'tour-operator') + '</strong>',
+                                content: `<strong>${__('Travel Styles:', 'tour-operator')}</strong>`,

Also applies to: 98-98

src/blocks/price/index.js (2)

1-132: Add JSDoc documentation with @SInCE tags.

Per the coding guidelines, all functions and modules require JSDoc comments with @since tags. Add module-level and function-level JSDoc for registerPriceVariation.

As per coding guidelines.


55-55: Consider using template literals and standardise spacing.

The string concatenation could use template literals for better readability. Also note the spacing inconsistency: line 55 has no space after the colon, whilst line 112 includes a space.

Example for line 55:

-                                content: '<strong>' + __('From:', 'tour-operator') + '</strong>',
+                                content: `<strong>${__('From:', 'tour-operator')}</strong>`,

Also applies to: 112-112

src/blocks/tagline/index.js (1)

1-64: Add JSDoc documentation with @SInCE tags.

Per the coding guidelines, all functions and modules require JSDoc comments with @since tags. Add module-level and function-level JSDoc for registerTaglineVariation.

As per coding guidelines.

src/blocks/single-supplement-wrapper/index.js (2)

1-128: Add JSDoc documentation with @SInCE tags.

Per the coding guidelines, all functions and modules require JSDoc comments with @since tags. Add module-level and function-level JSDoc for registerSingleSupplementVariation.

As per coding guidelines.


56-56: Consider using template literals and standardise spacing.

The string concatenation could use template literals for better readability. Also note the spacing inconsistency: line 56 has no space after the colon, whilst line 110 includes a space.

Example for line 56:

-                                content: '<strong>' + __('Single supplement:', 'tour-operator') + '</strong>',
+                                content: `<strong>${__('Single supplement:', 'tour-operator')}</strong>`,

Also applies to: 110-110

src/blocks/duration/index.js (2)

1-148: Add JSDoc documentation with @SInCE tags.

Per the coding guidelines, all functions and modules require JSDoc comments with @since tags. Add module-level and function-level JSDoc for registerDurationVariation.

As per coding guidelines.


55-55: Consider using template literals and standardise spacing.

The string concatenation could use template literals for better readability. Also note the spacing inconsistency: line 55 has no space after the colon, whilst line 128 includes a space.

Example for line 55:

-                                content: '<strong>' + __('Duration:', 'tour-operator') + '</strong>',
+                                content: `<strong>${__('Duration:', 'tour-operator')}</strong>`,

Also applies to: 128-128

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 489a278 and 95f5479.

⛔ Files ignored due to path filters (165)
  • build/admin-rtl.css is excluded by !build/**
  • build/admin-script.asset.php is excluded by !build/**
  • build/admin-script.js is excluded by !build/**
  • build/admin.css is excluded by !build/**
  • build/blocks/accommodation-related-accommodation/index.asset.php is excluded by !build/**
  • build/blocks/accommodation-related-accommodation/index.js is excluded by !build/**
  • build/blocks/accommodation-related-destination/index.asset.php is excluded by !build/**
  • build/blocks/accommodation-related-destination/index.js is excluded by !build/**
  • build/blocks/accommodation-related-tour/index.asset.php is excluded by !build/**
  • build/blocks/accommodation-related-tour/index.js is excluded by !build/**
  • build/blocks/accommodation-type/index.asset.php is excluded by !build/**
  • build/blocks/accommodation-type/index.js is excluded by !build/**
  • build/blocks/additional-info/index.asset.php is excluded by !build/**
  • build/blocks/additional-info/index.js is excluded by !build/**
  • build/blocks/banking/index.asset.php is excluded by !build/**
  • build/blocks/banking/index.js is excluded by !build/**
  • build/blocks/banner-cover/index.asset.php is excluded by !build/**
  • build/blocks/banner-cover/index.js is excluded by !build/**
  • build/blocks/best-time-to-visit/index.asset.php is excluded by !build/**
  • build/blocks/best-time-to-visit/index.js is excluded by !build/**
  • build/blocks/booking-validity/index.asset.php is excluded by !build/**
  • build/blocks/booking-validity/index.js is excluded by !build/**
  • build/blocks/checkin-time/index.asset.php is excluded by !build/**
  • build/blocks/checkin-time/index.js is excluded by !build/**
  • build/blocks/checkout-time/index.asset.php is excluded by !build/**
  • build/blocks/checkout-time/index.js is excluded by !build/**
  • build/blocks/climate/index.asset.php is excluded by !build/**
  • build/blocks/climate/index.js is excluded by !build/**
  • build/blocks/cuisine/index.asset.php is excluded by !build/**
  • build/blocks/cuisine/index.js is excluded by !build/**
  • build/blocks/day-by-day/index.asset.php is excluded by !build/**
  • build/blocks/day-by-day/index.js is excluded by !build/**
  • build/blocks/departs-from/index.asset.php is excluded by !build/**
  • build/blocks/departs-from/index.js is excluded by !build/**
  • build/blocks/destination-to-accommodation/index.asset.php is excluded by !build/**
  • build/blocks/destination-to-accommodation/index.js is excluded by !build/**
  • build/blocks/dress/index.asset.php is excluded by !build/**
  • build/blocks/dress/index.js is excluded by !build/**
  • build/blocks/duration/index.asset.php is excluded by !build/**
  • build/blocks/duration/index.js is excluded by !build/**
  • build/blocks/electricity/index.asset.php is excluded by !build/**
  • build/blocks/electricity/index.js is excluded by !build/**
  • build/blocks/ends-in/index.asset.php is excluded by !build/**
  • build/blocks/ends-in/index.js is excluded by !build/**
  • build/blocks/facilities/index.asset.php is excluded by !build/**
  • build/blocks/facilities/index.js is excluded by !build/**
  • build/blocks/facts-country-wrapper/index.asset.php is excluded by !build/**
  • build/blocks/facts-country-wrapper/index.js is excluded by !build/**
  • build/blocks/facts-regions-wrapper/index.asset.php is excluded by !build/**
  • build/blocks/facts-regions-wrapper/index.js is excluded by !build/**
  • build/blocks/featured-accommodation/index.asset.php is excluded by !build/**
  • build/blocks/featured-accommodation/index.js is excluded by !build/**
  • build/blocks/featured-destinations/index.asset.php is excluded by !build/**
  • build/blocks/featured-destinations/index.js is excluded by !build/**
  • build/blocks/featured-tours/index.asset.php is excluded by !build/**
  • build/blocks/featured-tours/index.js is excluded by !build/**
  • build/blocks/gallery/index.asset.php is excluded by !build/**
  • build/blocks/gallery/index.js is excluded by !build/**
  • build/blocks/google-map/index.asset.php is excluded by !build/**
  • build/blocks/google-map/index.js is excluded by !build/**
  • build/blocks/group-size/index.asset.php is excluded by !build/**
  • build/blocks/group-size/index.js is excluded by !build/**
  • build/blocks/health/index.asset.php is excluded by !build/**
  • build/blocks/health/index.js is excluded by !build/**
  • build/blocks/icons/index.asset.php is excluded by !build/**
  • build/blocks/icons/index.js is excluded by !build/**
  • build/blocks/icons/style-index-rtl.css is excluded by !build/**
  • build/blocks/icons/style-index.css is excluded by !build/**
  • build/blocks/included/index.asset.php is excluded by !build/**
  • build/blocks/included/index.js is excluded by !build/**
  • build/blocks/itinerary/index.asset.php is excluded by !build/**
  • build/blocks/itinerary/index.js is excluded by !build/**
  • build/blocks/lsx-destination-to-tour/index.asset.php is excluded by !build/**
  • build/blocks/lsx-destination-to-tour/index.js is excluded by !build/**
  • build/blocks/minimum-child-age/index.asset.php is excluded by !build/**
  • build/blocks/minimum-child-age/index.js is excluded by !build/**
  • build/blocks/modal-button/index.asset.php is excluded by !build/**
  • build/blocks/modal-button/index.js is excluded by !build/**
  • build/blocks/more-link/index.asset.php is excluded by !build/**
  • build/blocks/more-link/index.js is excluded by !build/**
  • build/blocks/not-included/index.asset.php is excluded by !build/**
  • build/blocks/not-included/index.js is excluded by !build/**
  • build/blocks/number-of-rooms/index.asset.php is excluded by !build/**
  • build/blocks/number-of-rooms/index.js is excluded by !build/**
  • build/blocks/permalink-button/index.asset.php is excluded by !build/**
  • build/blocks/permalink-button/index.js is excluded by !build/**
  • build/blocks/price-include-exclude/index.asset.php is excluded by !build/**
  • build/blocks/price-include-exclude/index.js is excluded by !build/**
  • build/blocks/price/block.json is excluded by !build/**
  • build/blocks/price/index.asset.php is excluded by !build/**
  • build/blocks/price/index.js is excluded by !build/**
  • build/blocks/rating/index.asset.php is excluded by !build/**
  • build/blocks/rating/index.js is excluded by !build/**
  • build/blocks/regions/index.asset.php is excluded by !build/**
  • build/blocks/regions/index.js is excluded by !build/**
  • build/blocks/related-regions/index.asset.php is excluded by !build/**
  • build/blocks/related-regions/index.js is excluded by !build/**
  • build/blocks/review-related-accommodation/index.asset.php is excluded by !build/**
  • build/blocks/review-related-accommodation/index.js is excluded by !build/**
  • build/blocks/review-related-destination/index.asset.php is excluded by !build/**
  • build/blocks/review-related-destination/index.js is excluded by !build/**
  • build/blocks/review-related-tour/index.asset.php is excluded by !build/**
  • build/blocks/review-related-tour/index.js is excluded by !build/**
  • build/blocks/safety/index.asset.php is excluded by !build/**
  • build/blocks/safety/index.js is excluded by !build/**
  • build/blocks/single-supplement-wrapper/index.asset.php is excluded by !build/**
  • build/blocks/single-supplement-wrapper/index.js is excluded by !build/**
  • build/blocks/special-interests/index.asset.php is excluded by !build/**
  • build/blocks/special-interests/index.js is excluded by !build/**
  • build/blocks/spoken-languages/index.asset.php is excluded by !build/**
  • build/blocks/spoken-languages/index.js is excluded by !build/**
  • build/blocks/sticky-menu/index.asset.php is excluded by !build/**
  • build/blocks/sticky-menu/index.js is excluded by !build/**
  • build/blocks/sticky-menu/sticky-menu-editor-extension.asset.php is excluded by !build/**
  • build/blocks/sticky-menu/sticky-menu-editor-extension.js is excluded by !build/**
  • build/blocks/sticky-menu/style-index-rtl.css is excluded by !build/**
  • build/blocks/sticky-menu/style-index.css is excluded by !build/**
  • build/blocks/sticky-menu/view.asset.php is excluded by !build/**
  • build/blocks/sticky-menu/view.js is excluded by !build/**
  • build/blocks/suggested-visitor-types/index.asset.php is excluded by !build/**
  • build/blocks/suggested-visitor-types/index.js is excluded by !build/**
  • build/blocks/tagline/index.asset.php is excluded by !build/**
  • build/blocks/tagline/index.js is excluded by !build/**
  • build/blocks/tour-related-accommodation/index.asset.php is excluded by !build/**
  • build/blocks/tour-related-accommodation/index.js is excluded by !build/**
  • build/blocks/tour-related-destination/index.asset.php is excluded by !build/**
  • build/blocks/tour-related-destination/index.js is excluded by !build/**
  • build/blocks/tour-related-tour/index.asset.php is excluded by !build/**
  • build/blocks/tour-related-tour/index.js is excluded by !build/**
  • build/blocks/transport/index.asset.php is excluded by !build/**
  • build/blocks/transport/index.js is excluded by !build/**
  • build/blocks/travel-styles/index.asset.php is excluded by !build/**
  • build/blocks/travel-styles/index.js is excluded by !build/**
  • build/blocks/unit-rooms/index.asset.php is excluded by !build/**
  • build/blocks/unit-rooms/index.js is excluded by !build/**
  • build/blocks/units/index.asset.php is excluded by !build/**
  • build/blocks/units/index.js is excluded by !build/**
  • build/blocks/videos/index.asset.php is excluded by !build/**
  • build/blocks/videos/index.js is excluded by !build/**
  • build/blocks/visa/index.asset.php is excluded by !build/**
  • build/blocks/visa/index.js is excluded by !build/**
  • build/blocks/wetu-map/index.asset.php is excluded by !build/**
  • build/blocks/wetu-map/index.js is excluded by !build/**
  • build/custom.asset.php is excluded by !build/**
  • build/custom.js is excluded by !build/**
  • build/general.asset.php is excluded by !build/**
  • build/general.js is excluded by !build/**
  • build/linked-cover.asset.php is excluded by !build/**
  • build/linked-cover.js is excluded by !build/**
  • build/maps.asset.php is excluded by !build/**
  • build/maps.js is excluded by !build/**
  • build/metabox-structure.asset.php is excluded by !build/**
  • build/metabox-structure.js is excluded by !build/**
  • build/metaboxes-rtl.css is excluded by !build/**
  • build/metaboxes.css is excluded by !build/**
  • build/modals.asset.php is excluded by !build/**
  • build/modals.js is excluded by !build/**
  • build/scporder.asset.php is excluded by !build/**
  • build/scporder.js is excluded by !build/**
  • build/slider-query.asset.php is excluded by !build/**
  • build/slider-query.js is excluded by !build/**
  • build/slotfills.asset.php is excluded by !build/**
  • build/slotfills.js is excluded by !build/**
  • build/style-rtl.css is excluded by !build/**
  • build/style.css is excluded by !build/**
📒 Files selected for processing (6)
  • src/blocks/duration/index.js (1 hunks)
  • src/blocks/price/block.json (1 hunks)
  • src/blocks/price/index.js (1 hunks)
  • src/blocks/single-supplement-wrapper/index.js (1 hunks)
  • src/blocks/tagline/index.js (1 hunks)
  • src/blocks/travel-styles/index.js (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/blocks/price/block.json
🧰 Additional context used
📓 Path-based instructions (12)
src/**/*.{js,jsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use @wordpress/eslint-plugin for JavaScript linting

Files:

  • src/blocks/travel-styles/index.js
  • src/blocks/tagline/index.js
  • src/blocks/single-supplement-wrapper/index.js
  • src/blocks/price/index.js
  • src/blocks/duration/index.js
src/**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

src/**/*.{js,jsx,ts,tsx}: Use useBlockProps() in block edit/save components when applicable
Use the text domain tour-operator for JS i18n calls

Files:

  • src/blocks/travel-styles/index.js
  • src/blocks/tagline/index.js
  • src/blocks/single-supplement-wrapper/index.js
  • src/blocks/price/index.js
  • src/blocks/duration/index.js
{assets,src}/**/*

📄 CodeRabbit inference engine (.github/instructions/block-theme-structure.instructions.md)

Keep SCSS/JS/images source assets in assets/ or src/

Files:

  • src/blocks/travel-styles/index.js
  • src/blocks/tagline/index.js
  • src/blocks/single-supplement-wrapper/index.js
  • src/blocks/price/index.js
  • src/blocks/duration/index.js
**/*.{js,ts}

📄 CodeRabbit inference engine (.github/instructions/javascript-react.instructions.md)

**/*.{js,ts}: Use const or let instead of var for variable declarations
Use default parameters for function arguments where appropriate
Use @wordpress/api-fetch (optionally with addQueryArgs) for REST API requests
Register blocks via registerBlockType using block metadata (imported from block.json), and localize title/description/keywords
Use wp.media for media selection in custom components/utilities when needed
Create and register custom data stores with @wordpress/data (createReduxStore + register), and structure actions/selectors clearly
Initialize frontend interactivity after DOMContentLoaded and implement ARIA attributes for toggles (aria-controls, aria-expanded)
Handle AJAX form submissions with fetch, proper loading states, and user notices; restore UI state in finally
Implement accessibility utilities like focus trapping and polite screen reader announcements for dynamic content

Files:

  • src/blocks/travel-styles/index.js
  • src/blocks/tagline/index.js
  • src/blocks/single-supplement-wrapper/index.js
  • src/blocks/price/index.js
  • src/blocks/duration/index.js
**/*.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (.github/instructions/javascript-react.instructions.md)

**/*.{js,ts,jsx,tsx}: Prefer arrow functions for callbacks and inline handlers
Use object/array destructuring for cleaner code
Use template literals for string interpolation
Use async/await for promise handling with try/catch for errors
Use WordPress i18n APIs (__/_n/sprintf) with a consistent textdomain for all user-facing strings; include translator comments where needed
Use @wordpress/data dispatch/select for interacting with WP data stores (e.g., core/notices, core/editor)

Files:

  • src/blocks/travel-styles/index.js
  • src/blocks/tagline/index.js
  • src/blocks/single-supplement-wrapper/index.js
  • src/blocks/price/index.js
  • src/blocks/duration/index.js
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.github/instructions/js-ts.instructions.md)

**/*.{ts,tsx,js,jsx}: Debounce user inputs to prevent excessive processing
Avoid blocking the UI thread (prefer async/non-blocking operations)

Files:

  • src/blocks/travel-styles/index.js
  • src/blocks/tagline/index.js
  • src/blocks/single-supplement-wrapper/index.js
  • src/blocks/price/index.js
  • src/blocks/duration/index.js
**/*.{js,mjs,ts,tsx}

📄 CodeRabbit inference engine (.github/instructions/performance.instructions.md)

Defer non-critical JavaScript and avoid synchronous blocking operations

Files:

  • src/blocks/travel-styles/index.js
  • src/blocks/tagline/index.js
  • src/blocks/single-supplement-wrapper/index.js
  • src/blocks/price/index.js
  • src/blocks/duration/index.js
**/*.{php,js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.github/instructions/review.instructions.md)

Internationalize user‑facing strings using WordPress i18n APIs

Files:

  • src/blocks/travel-styles/index.js
  • src/blocks/tagline/index.js
  • src/blocks/single-supplement-wrapper/index.js
  • src/blocks/price/index.js
  • src/blocks/duration/index.js
**/*.{css,js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.github/instructions/reviews.instructions.md)

Minimize CSS/JS payload size

Files:

  • src/blocks/travel-styles/index.js
  • src/blocks/tagline/index.js
  • src/blocks/single-supplement-wrapper/index.js
  • src/blocks/price/index.js
  • src/blocks/duration/index.js
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.github/instructions/reviews.instructions.md)

Lazy-load code and resources where possible

Files:

  • src/blocks/travel-styles/index.js
  • src/blocks/tagline/index.js
  • src/blocks/single-supplement-wrapper/index.js
  • src/blocks/price/index.js
  • src/blocks/duration/index.js
**/*.{js,ts,tsx,jsx}

⚙️ CodeRabbit configuration file

**/*.{js,ts,tsx,jsx}: Perform a detailed review of the provided code with following key aspects in mind:

  • Review the code to ensure it is well-structured and adheres to best practices.
  • Verify compliance with WordPress coding standards and @wordpress/eslint-plugin rules.
  • Ensure the code is well-documented with proper JSDoc comments.
  • Check for security vulnerabilities and confirm the code is secure.
  • Optimize the code for performance, removing any unnecessary elements.
  • Validate JSDoc comments for accuracy, currency, and adherence to WordPress coding standards.
  • Ensure each line comment concludes with a period.
  • Confirm every JSDoc comment includes a @SInCE tag indicating the next version of the plugin to include the code.
  • Guarantee compatibility with the latest version of WordPress, avoiding deprecated functions or features.
  • Follow WordPress JavaScript coding standards and use WordPress script localization.
  • Use WordPress script dependencies and enqueue properly.
  • Ensure React/JSX best practices for blocks and modern JavaScript/TypeScript patterns.
  • Implement proper error handling and loading states.
  • Use WordPress components and design system where applicable.
  • For Tour Operator: Focus on tour booking interfaces, search functionality, and tour display components.

Files:

  • src/blocks/travel-styles/index.js
  • src/blocks/tagline/index.js
  • src/blocks/single-supplement-wrapper/index.js
  • src/blocks/price/index.js
  • src/blocks/duration/index.js
src/blocks/**/*.{js,jsx,ts,tsx}

⚙️ CodeRabbit configuration file

src/blocks/**/*.{js,jsx,ts,tsx}: - Follow WordPress JavaScript coding standards and @wordpress/scripts configuration.

  • Use WordPress components from @wordpress/components and design system.
  • Implement proper React/JSX patterns for WordPress blocks.
  • Ensure proper WordPress script dependencies and localization.
  • Use WordPress data store patterns with @wordpress/data.
  • Implement proper error boundaries and loading states.
  • Follow modern JavaScript/TypeScript patterns with proper typing.
  • Ensure accessibility in interactive block components.
  • Use WordPress block editor APIs correctly (useBlockProps, InspectorControls, etc.).
  • Implement proper block validation and save/edit functionality.

Files:

  • src/blocks/travel-styles/index.js
  • src/blocks/tagline/index.js
  • src/blocks/single-supplement-wrapper/index.js
  • src/blocks/price/index.js
  • src/blocks/duration/index.js
🧬 Code graph analysis (5)
src/blocks/travel-styles/index.js (2)
src/js/conditional-block-registration.js (2)
  • wp (32-32)
  • registerForPostTypesAndTemplates (170-177)
src/blocks/duration/index.js (1)
  • conditionalRegister (141-145)
src/blocks/tagline/index.js (2)
src/js/conditional-block-registration.js (1)
  • registerForPostTypesAndTemplates (170-177)
src/blocks/duration/index.js (1)
  • conditionalRegister (141-145)
src/blocks/single-supplement-wrapper/index.js (5)
src/js/conditional-block-registration.js (2)
  • wp (32-32)
  • registerForPostTypesAndTemplates (170-177)
src/blocks/duration/index.js (1)
  • conditionalRegister (141-145)
src/blocks/price/index.js (1)
  • conditionalRegister (125-129)
src/blocks/tagline/index.js (1)
  • conditionalRegister (57-61)
src/blocks/travel-styles/index.js (1)
  • conditionalRegister (109-113)
src/blocks/price/index.js (1)
src/js/conditional-block-registration.js (2)
  • wp (32-32)
  • registerForPostTypesAndTemplates (170-177)
src/blocks/duration/index.js (5)
src/js/conditional-block-registration.js (2)
  • wp (32-32)
  • registerForPostTypesAndTemplates (170-177)
src/blocks/price/index.js (1)
  • conditionalRegister (125-129)
src/blocks/single-supplement-wrapper/index.js (1)
  • conditionalRegister (121-125)
src/blocks/tagline/index.js (1)
  • conditionalRegister (57-61)
src/blocks/travel-styles/index.js (1)
  • conditionalRegister (109-113)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: review
  • GitHub Check: Summary

Comment on lines +21 to 23
isActive: (blockAttributes, variationAttributes) => {
return blockAttributes.metadata?.className === variationAttributes.metadata?.className;
},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Fix the isActive comparator to match the correct attribute path.

The variation defines className at attributes.className (line 28), not metadata.className. The current comparison will always fail because variationAttributes.metadata?.className is undefined.

Apply this diff:

             isActive: (blockAttributes, variationAttributes) => {
-                return blockAttributes.metadata?.className === variationAttributes.metadata?.className;
+                return blockAttributes.className === variationAttributes.attributes?.className;
             },
🤖 Prompt for AI Agents
In src/blocks/duration/index.js around lines 21 to 23, the isActive comparator
is checking variationAttributes.metadata?.className but the variation defines
className under variationAttributes.attributes.className; change the comparator
to compare blockAttributes.metadata?.className ===
variationAttributes.attributes?.className (use optional chaining for safety:
variationAttributes?.attributes?.className) so the comparison uses the correct
attribute path.

Comment on lines +20 to 22
isActive: (blockAttributes, variationAttributes) => {
return blockAttributes.metadata?.className === variationAttributes.metadata?.className;
},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Fix the isActive comparator to match the correct attribute path.

The variation defines className at attributes.className (line 32), not metadata.className. The current comparison will always fail.

Apply this diff:

             isActive: (blockAttributes, variationAttributes) => {
-                return blockAttributes.metadata?.className === variationAttributes.metadata?.className;
+                return blockAttributes.className === variationAttributes.attributes?.className;
             },
🤖 Prompt for AI Agents
In src/blocks/price/index.js around lines 20-22, the isActive comparator is
comparing variationAttributes.metadata.className but the variation actually
defines className at variationAttributes.attributes.className; update the
comparator so it compares the same paths (e.g.,
blockAttributes.metadata?.className ===
variationAttributes.attributes?.className) to correctly detect active
variations.

Comment on lines +20 to 22
isActive: (blockAttributes, variationAttributes) => {
return blockAttributes.metadata?.className === variationAttributes.metadata?.className;
},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Fix the isActive comparator to match the correct attribute path.

The variation defines className at attributes.className (line 27), not metadata.className. The current comparison will always fail because variationAttributes.metadata?.className is undefined.

Apply this diff to fix the comparator:

             isActive: (blockAttributes, variationAttributes) => {
-                return blockAttributes.metadata?.className === variationAttributes.metadata?.className;
+                return blockAttributes.className === variationAttributes.attributes?.className;
             },
🤖 Prompt for AI Agents
In src/blocks/travel-styles/index.js around lines 20 to 22, the isActive
comparator is checking metadata.className on both sides but the variation stores
className under attributes.className; update the comparator to compare
blockAttributes.attributes?.className ===
variationAttributes.attributes?.className instead of metadata paths so the check
correctly matches the defined attribute path.

@github-project-automation github-project-automation bot moved this from 🔎 In Review to Needs Triage in Tour Operator Nov 11, 2025
@github-actions github-actions bot added status:needs-review Awaiting code review and removed status:needs-review Awaiting code review lang:css Stylesheets labels Nov 12, 2025
Copy link
Copy Markdown
Collaborator

@krugazul krugazul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tibiii I have tested the blocks locally, and i was experiencing an issue with the tagline always being selected for a paragraph. I have updated the isActive selectors.

Image

@krugazul krugazul merged commit 0359cbb into 2.1-trunk Nov 12, 2025
6 of 9 checks passed
@krugazul krugazul deleted the refactor/tour-blocks-meta-icons branch November 12, 2025 09:46
@github-project-automation github-project-automation bot moved this from Needs Triage to ✅ Done in Tour Operator Nov 12, 2025
@github-actions github-actions bot added status:needs-review Awaiting code review and removed status:needs-review Awaiting code review labels Nov 12, 2025
Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

Commits Files that changed from the base of the PR and between 95f5479 and 9a76a2d commits.
Files selected (11)
  • src/blocks/booking-validity/index.js (1)
  • src/blocks/departs-from/index.js (1)
  • src/blocks/duration/index.js (1)
  • src/blocks/ends-in/index.js (1)
  • src/blocks/group-size/index.js (1)
  • src/blocks/included/index.js (1)
  • src/blocks/not-included/index.js (1)
  • src/blocks/price/index.js (1)
  • src/blocks/single-supplement-wrapper/index.js (1)
  • src/blocks/tagline/index.js (1)
  • src/blocks/travel-styles/index.js (1)
Files not summarized due to errors (11)
  • src/blocks/group-size/index.js (nothing obtained from openai)
  • src/blocks/included/index.js (nothing obtained from openai)
  • src/blocks/departs-from/index.js (nothing obtained from openai)
  • src/blocks/ends-in/index.js (nothing obtained from openai)
  • src/blocks/booking-validity/index.js (nothing obtained from openai)
  • src/blocks/duration/index.js (nothing obtained from openai)
  • src/blocks/single-supplement-wrapper/index.js (nothing obtained from openai)
  • src/blocks/tagline/index.js (nothing obtained from openai)
  • src/blocks/not-included/index.js (nothing obtained from openai)
  • src/blocks/travel-styles/index.js (nothing obtained from openai)
  • src/blocks/price/index.js (nothing obtained from openai)
Files not reviewed due to errors (11)
  • src/blocks/duration/index.js (no response)
  • src/blocks/included/index.js (no response)
  • src/blocks/ends-in/index.js (no response)
  • src/blocks/booking-validity/index.js (no response)
  • src/blocks/departs-from/index.js (no response)
  • src/blocks/group-size/index.js (no response)
  • src/blocks/not-included/index.js (no response)
  • src/blocks/travel-styles/index.js (no response)
  • src/blocks/single-supplement-wrapper/index.js (no response)
  • src/blocks/tagline/index.js (no response)
  • src/blocks/price/index.js (no response)
Review comments generated (0)
  • Review: 0
  • LGTM: 0

Tips

Chat with Image description CodeRabbit Bot (@coderabbitai)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @coderabbitai in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @coderabbitai: ignore anywhere in the PR description to pause further reviews from the bot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:block-editor area:ci Build and CI pipelines lang:javascript lang:md Markdown content/docs lang:php PHP code meta:needs-changelog Requires a changelog entry before merge status:needs-review Awaiting code review

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

Block Audit: travel-styles, duration, single-supplement-wrapper, price, tagline (Tour post type meta & icons integration)

3 participants