31 Commits

Author SHA1 Message Date
c6fd5cee13 refactor: entity selector full overhaul — Mar 2026
- Unified _setBadgeCount for ALL badge updates
- target-conditions-trait → entity-selector-trait
- target-* → es-* class rename (20+ classes)
- SCSS recompiled: zero duplicate selectors
- CSS transitions replace jQuery slideDown/slideUp
- Serialize cache, method swap cache
- Badge: no-matches gray, consistent hover, no blending
- Inline condition count always visible
- Preview popover refreshes in-place on sort change
- Categories add chips immediately
- Entity type icons on chips
- Consistent info_outline icons via buildHelpIcon
- Method dropdown text clipping fix (line-height)
- mpr-input-compact on all inputs
- Dropdown padding fixed in SCSS source
- Chips wrapper: same container always
- Reusable helpers: _buildEmptyState, _buildSearchBoxHtml, _buildInfoTooltip
- Asset path: uses $this->module->getPathUri() not reflection
- Debug logs removed

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 18:05:43 +00:00
d2d4f96c5e chore: remove duplicated nested directories
Remove assets/assets/ and sources/sources/ artifact directories
created by sync script symlink resolution.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 14:48:02 +01:00
1945da88b2 feat: icon abstraction layer for PS 1.6-9.x compatibility
Add esIcon() JS helper and renderIcon() PHP helper that auto-detect
the icon framework (Material Icons on PS 8+/9+, FontAwesome 4 on PS
1.6/1.7) and render appropriate HTML. Includes bidirectional mapping
between FA4 class names and Material Icons names.

- Replace all hardcoded <i class="material-icons"> with esIcon()/renderIcon()
- Add FA4_MAP (Material→FA4) and reverse FA4→Material mapping in both JS and PHP
- Add detectIconMode() with PHP data-attribute hint and font-family probe fallback
- Fix 4 self/this scope bugs in esIcon calls across _methods.js, _tree.js, _preview.js
- Add esIconUpdate() for dynamically updating existing icon elements
- Add normalizeIconName() to handle both FA4 and Material input formats

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 14:47:50 +01:00
55e3135903 feat: unified preview eye icon component, enhanced search & preview
- Unify filter group and filter value preview icons into shared
  .filter-chip-wrapper + .chip-preview-btn component pattern
- Remove old .toggle-count.clickable inline eye icon approach
- Add dropdown-level event handler for preview buttons (dropdown
  appended to body, needs separate delegation)
- Enhanced EntitySearchEngine with improved product condition
  resolution and preview data
- Add EntityPreviewHandler for richer preview popovers
- Various SCSS improvements for chips, groups, and list-preview

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 21:34:37 +00:00
a7fbfa372c revert: form-content layout defaults to collapsed (clean tab bar)
Reverts collapsed default to true for form-content layout.
The expanded state showed too many wrappers/borders, making
forms look cluttered. Collapsed default shows a clean tab bar
with expand chevron — matches mprfriendlyurl reference style.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 10:21:58 +00:00
83c7dd28b6 fix: form-content layout always shows tabs + expanded content
Reverts single-block optimization. All form-content layouts now render
identically: tab bar visible, content expanded by default (collapsed=false).
Single-block selectors (warehouse) now match multi-block selectors
(mprfriendlyurl) in structure.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 09:31:29 +00:00
2dad54a647 fix: skip tab bar for single-block form-content layout
When form-content layout has only one entity type (e.g., just Products
or just Materials), the tab bar with a single tab looks broken. Now:
- Single block: no tab bar, no collapse toggle, content shown directly
- Multi block: tab bar with collapse toggle, collapsed by default (unchanged)
- Reverts previous collapsed default change (was wrong approach)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 09:21:04 +00:00
c4c6ca13d2 Fix form-content layout to show widget content by default
Change collapsed default from true to false so entity selector
blocks display their content (search, chips, method dropdown)
immediately without requiring user to expand manually.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 08:42:45 +00:00
4d14afa767 Add unified badge and dropdown preview components for admin lists
- Add .mpr-badge--preview base class with consistent sizing (20px height, pill shape)
- Add color variants: -primary, -success, -warning, -muted
- Add .mpr-dropdown-preview component for inline schedule details
- Add schedule row layout with day/hours styling
- Support material icons inside badges with proper sizing

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 13:27:53 +00:00
7c9b57aaa2 Remove schedule-specific styles, use shared mpr-dropdown-preview
Schedule preview now uses mpr-dropdown-preview from prestashop-admin package.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 12:08:41 +00:00
451a47cdcd Add schedule preview dropdown styles and various improvements
- Add .schedule-preview-dropdown and .schedule-preview-item CSS classes
- Add .btn-schedule-preview badge styling
- Add preview functionality for entity list views
- Improve modal and dropdown styling
- Various JS and SCSS enhancements

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 11:49:01 +00:00
4eeb8d85ae Feature: embedded layout mode and schedule improvements
- Add layout-embedded class for nested entity selectors
- Simplified styling for embedded widgets (less padding, borders)
- Schedule toggle row with summary badges
- Summary badges show datetime range, weekly schedule, holiday count
- Flag fallback styling for countries without valid ISO codes
- Section hint margin after embedded entity selector
- Holiday countries group without modifiers section

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 10:52:13 +01:00
7d4d1ec618 Fix preview popover styling and icon preservation
- Preserve icon structure when updating total count in trait badge
- Add gap between title and count in preview popover header
- Style the count badge with background, padding, and rounded corners

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 09:34:14 +01:00
cd714d8400 Refactor: create shared entity-item base, remove duplicate CSS
- Add _entity-item.scss shared component for chips and list items
- Refactor _list-preview.scss to use shared patterns
- Delete entity-list-preview.css (duplicate hardcoded styles)
- All preview styling now comes from SCSS build only

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 09:01:15 +01:00
334e62e157 Cleanup: remove debug console.log from preview module
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 23:00:35 +01:00
603be61f71 Style: chips toolbar compact design with bootstrap specificity fix
- Add bootstrap specificity overrides for input/select in chips toolbar
- Use #content.bootstrap selector with doubled classes for specificity
- Reduce toolbar height with consistent padding (0.2rem vertical)
- Change border-radius from pill to subtle rounded corners
- Simplify input structure (embedded search icon via background)
- Align all toolbar elements (input, select, count, clear button)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 22:40:57 +01:00
acbcf55b1c Feature: enhanced chips toolbar with sorting and load select
Chips toolbar improvements:
- Filter input now uses all available space (flex: 1)
- Added sort dropdown: Order added, Name A-Z, Name Z-A
- Changed "Show X more" button to select dropdown pattern
  - Load 20, 50, 100, or All
  - Shows remaining count
- Collapse button to return to default view

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 19:44:56 +00:00
b7054f11f9 Style: integrated chips filter toolbar design
- Wrap filter input in pill-shaped container (.chips-filter-group)
- Remove hard border separation between toolbar and chips
- Make toolbar feel like part of the chips area with shared background
- Smaller, subtler count badge and clear button
- Clear button styled as danger pill that fills on hover
- Responsive: hide clear text on small screens

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 19:15:56 +00:00
5ee4617cb1 Fix: pendingSelections sync and chips toolbar display
1. Fix Select All not persisting in list view:
   - Updated Select All handler to populate pendingSelections array
   - Updated Clear selection handler to clear pendingSelections for list view
   - Updated dropdown item click to add/remove from pendingSelections
   - Updated chip remove handler to filter pendingSelections

2. Fix chips toolbar (search/delete all) not showing:
   - PHP renderer was pre-creating chips-wrapper without toolbar
   - JS ensureChipsWrapper was skipping because wrapper existed
   - Removed wrapper from PHP so JS creates complete wrapper with toolbar

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 18:41:22 +00:00
743e9c8020 Fix tree view selection and add entity-specific sort options
- Fix validation mixin not being merged in _core.js which broke tree item selection
- Add data-entities attribute to sort options for entity-specific filtering
- Improve event handlers and filter panel updates

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 18:10:18 +00:00
af5066dd26 Add selection validation and improve tooltip component
- Add validation system to prevent contradicting conditions:
  - Same entity in include/exclude detection
  - Parent-child conflict detection for tree entities
  - Redundant selection prevention
  - Toast notifications for validation errors

- Fix entity icons (employees: briefcase, taxes: calculator)

- Improve tooltip component:
  - Use Material Icons instead of broken FA4 icons
  - Fix positioning using getBoundingClientRect for viewport coords
  - Add click-to-pin functionality with close button
  - Pinned tooltips show X icon and close button in corner

- Add lightweight test suite (31 tests) for validation logic

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 17:05:56 +01:00
7d79273743 Add hierarchical tree view for category selection
Features:
- Tree view mode for categories with expand/collapse
- Product count badges with clickable preview popover
- Select parent with all children button
- Client-side tree filtering (refine search)
- Keyboard shortcuts: Ctrl+A (select all), Ctrl+D (clear)
- View mode switching between tree/list/columns
- Tree view as default for categories, respects user preference

Backend:
- Add previewCategoryProducts and previewCategoryPages AJAX handlers
- Support pagination and filtering in category previews

Styling:
- Consistent count-badge styling across tree and other views
- Loading and popover-open states for count badges

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 15:03:51 +01:00
b79a89bbb4 Add AJAX filtering for preview popover with width lock
- Convert preview filter from client-side JS to server-side AJAX
- Add debounce utility function for 300ms delayed AJAX calls
- Add filter handlers for all 4 preview types (tab, condition, group, filter-group)
- Add filterProductIdsByQuery() method to EntityPreviewHandler
- Update all AJAX handlers to support filter parameter
- Lock popover width when filtering to prevent resize
- Add loading overlay CSS for filter state

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 14:07:56 +01:00
6f248605a7 Refactor preview popover and fix dropdown header styling
- Refactor preview popover into reusable component with filter input and load more
- Fix sort controls: connect sort-field-select to btn-sort-dir (shared border)
- Fix refine controls: connect btn-refine-negate to refine-input
- Add flex-shrink: 0 and min-width to prevent button shrinking
- Fix grid view items: border on all 4 sides, no padding
- Add EXCEPT separator styling for selection groups
- Various button width and height fixes for consistency

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 12:13:13 +00:00
eb15170e1c Add previewFilterGroupProducts AJAX handler
- Add case in handleEntitySelectorAjax switch for previewFilterGroupProducts
- Implement ajaxPreviewFilterGroupProducts() to get products by attribute/feature group
- Returns items with name, reference, manufacturer, image for popover preview

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 10:46:55 +00:00
2988385acd Add debug console.log for filter preview popover 2026-01-28 10:35:15 +00:00
cbebb32af5 Fix filter toggle preview: use $dropdown.on() instead of $(document).on()
- Move toggle-count click handler next to filter-group-toggle handler
- Use this.$dropdown.on() for proper event delegation within dropdown context
- Ensures self reference is correctly captured for showFilterGroupPreviewPopover

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 10:32:44 +00:00
ea73b31e58 Fix filter toggle click propagation to preview badge
- Added check to ignore clicks on .toggle-count.clickable in filter-group-toggle handler
- Prevents parent button from expanding values when clicking preview badge
- Added .gitignore to exclude node_modules

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 10:23:59 +00:00
6ebf94e15b Add clickable preview popover to filter group toggles
- Add showFilterGroupPreviewPopover method in _preview.js
- Make toggle-count badges clickable with data attributes
- Add event binding for .toggle-count.clickable in _events.js
- Add hover/active/loading styles for clickable toggle-count
- Requires previewFilterGroupProducts AJAX handler in PHP backend

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 10:18:42 +00:00
aa9f28bb7e Refactor from Tailwind CSS to SCSS/Bootstrap
Major changes:
- Replace Tailwind with SCSS using Bootstrap-compatible variables
- Add Gulp build system for SCSS and JS compilation
- Split JS into modular partials (_events, _filters, _preview, etc.)

CSS fixes:
- Fix preview popover visibility (remove conflicting modal.scss rule)
- Fix search input max-width override for parent form styles
- Add filter panel styling (toggle buttons, chips, values row)
- Add group-body padding with negative margins on modifiers
- Style filter-group-toggle with eye icon for preview

JS additions:
- Add showGroupPreviewPopover for group count badge clicks
- Add showItemsPopover for rendering preview popover
- Add renderPreviewItems for product list rendering
- Add eye icon to filter toggle button generation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 11:11:22 +01:00
a285018e0d Initial commit: prestashop-entity-selector
Forked from prestashop-target-conditions
Renamed all references from target-conditions to entity-selector
2026-01-26 14:02:54 +00:00