Commit Graph
8 Commits
Author SHA1 Message Date
DumiFlex f8ac25f443 chore: pre-merge polish — kind-aware chips, injector + debug improvements, engine fixes
Omnibus polish landing the remaining unstaged work on the branch:

frontend
  - kind-aware RefChip — @{uuid} refs targeting non-wildcard library
    modules (constraint, combine, derivation, fixed_values, bundle) now
    render with the matching kind color + PrimeIcon instead of falling
    through as unresolved wildcards. cascade/resolveChip exposes
    resolveModuleChip; preview-resolver caches snap.type as kind;
    RichTextPreview accepts a uuid-to-kind map; RefChip honours the
    new moduleKind prop.
  - DebugViewer derives uuid-to-kind from trace entries so engine
    warnings (e.g. constraint_never_applied carrying @{constraint_id})
    render the constraint id as a colored constraint chip.
  - Injector node refactor: two-tier socket (template_subject /
    subject row pairs) + general-template row model; binding modal
    handles general rows; row reorder + cap; rows collapsed by
    default; sockets gain tooltips.
  - SPA misc: useStarterSet rebuilds cascade reverse-dep index on
    catalog refresh so just-created starters surface in cascade
    impact dialogs; tokens / resolveTokens / EmptyState height /
    AppLayout sidebar count live-refresh / ModuleListView mid-cols.

engine
  - constraint_handler: 3 dedup bugs in carrier-claim + classify the
    never_applied warning.
  - pipeline: detect via-nested constraint carriers; carrier-claim
    failsafe + clearer never_applied warning text.
  - syntax/resolve: nested @{uuid#name} optional segment recognised.

tests
  - DebugViewer / Injector / RefChip / resolveChip / preview-resolver
    test suites extended for the new behaviour.
  - Engine + integration tests adjusted for constraint dedup + new
    carrier path + nested-ref parsing.
2026-05-28 12:53:23 +03:00
DumiFlex 2d72fe4345 feat(injector): two-tier socket + general-template row model
Socket rows now scope their optional template to their OWN slot only
(top-to-bottom resolution; other $input_M stay literal). Adds a durable
general-template row (kind: "general") that survives socket churn, is
resolved after all socket rows, and composes from both raw sockets
($input_N) and socket-row bindings ($test). Engine processes socket rows
first then general rows in order; general rows honor binding validation +
the internal flag. Frontend: kind discriminator, "Add template row"
affordance, general-aware reconcile that keeps general rows, inline
binding+template editor with a refs hint, conflict-scanner + docs updates.
2026-05-28 03:39:45 +03:00
DumiFlex 0d3f462f74 fix(injector): emit __wp_internal_flags__ so internal rows hide from the prompt 2026-05-28 02:54:23 +03:00
DumiFlex 766f04b553 feat(injector): row collapse, right-click menu, template binding modal + engine
Full UX rework of WP_ContextInjector to match the Context node's design
language. Adds per-row right-click context menu, collapse/expand of the
row's summary, and a per-row edit modal for setting both the variable
binding and an optional template string with $slot_name substitution
at engine time.

Frontend:
- InjectorRow gains a caret toggle + summary line under the row header;
  flex-column root with .wp-inj-row-header wrapping the existing flex
  row so summary can render below without breaking the existing layout.
- Right-click ctxmenu (Edit / Disable / Expand-Collapse / Move-to-top /
  Move-to-bottom / Disconnect) reuses the shared ContextMenu component.
  Header reads "Type · $var".
- NEW InjectorBindingModal.vue — per-row edit panel with binding name
  field + optional template textarea + insert-slot dropdown ($own_slot
  only, no cross-row noise). Draft buffer + Esc/Cmd+Enter keybinds
  matching the module InstanceModal family. Tokenizer fixes a TDZ-
  shaped infinite loop on bare `$` typed before a name.
- Lifted drop-indicator + drag tracking to InjectorWidget at list
  level so the gap-opening margin doesn't oscillate the target under
  the pointer. Drop bar paints via ::before/::after pseudo-elements
  + 14px margin gap so the slot opens visibly. Animation parity with
  module rows (FLIP via shared flip.ts; drop-pulse via shared
  row-primitives.css keyframes).
- Slot tag + collapse-button + summary moved into shared
  row-primitives.css; ModuleRow & ContextWidget refactored to consume
  the partial. Modules' right-click and bundle headers now also use a
  type-icon + kind chip + title header on their ctxmenu (matches the
  bundle pattern; was previously bundle-only).
- New conflict label helper `shortConflictLabel` in extension/conflicts
  so injector + module rows surface identical compact wording for the
  same conflict types.
- New `--wp-kind-injector` theme token + chip variant for Debug's
  injector trace rows (added in the next commit).
- ContextMenu close-on-outside-click switched to pointerdown capture
  so descendant `@click.stop` handlers can't swallow the close.
- _shared.ts widget host: track lastAutoSetHeight alongside
  lastAutoSetWidth so each axis preserves user-resized values
  independently. fillHost widgets always preserve height (no
  ResizeObserver to bootstrap the delta-check).

Engine:
- wp_nodes/injector_node.py: per-row optional `template` field. When
  set, engine substitutes `$<slot_name>` refs with the wired socket
  value (Python str() — booleans render as "True"/"False" matching
  the pass-through path's downstream stringification). Pass-through
  unchanged when template is empty. Trace entries carry `value` so
  Debug's value cell isn't blank for injector rows.
2026-05-15 01:27:04 +03:00
DumiFlex 3eb5c6d6a8 feat(injector): internal-flag adds to __wp_internal_keys__ + emit trace per row 2026-05-10 18:19:22 +03:00
DumiFlex d78cf698f3 feat(injector): validate binding regex + reject reserved underscore-prefix 2026-05-10 18:16:50 +03:00
DumiFlex 230db93b94 feat(injector): write enabled+named+connected rows to ctx 2026-05-10 18:14:20 +03:00
DumiFlex 115e06b4c5 feat(injector): node skeleton + empty-rows pytest 2026-05-10 18:11:30 +03:00