Personalization component source

Created on 21 May 2025, 17 days ago

Overview

Postponed on 📌 Personalization component source Active

Once we have a Personalization component source, we need an API end-point for wrapping a component (or set of components when we allow multi-select) for personalization.

Proposed resolution

  • Add a new HTTP internal config API end-point for doing component(s) personalization.
    • This end-point will receive a set of component UIIDs that needs to wrap
    • This end-point will receive a personalization variation ID
    • This end-point will change the tree structure wrapping the received components into a "default" personalization variation ID so we can keep the existing defaults
    • This end-point will create the grafting of another personalization wrapper for the active personalization variation ID with copies of the previous components
    • This end-point will provide (or trigger an update) of the layers tree + the preview
    • This end-point should ensure that the Client UI is able to keep the focus on the (now copy) of the previously selected components for the new personalization variation by returning the new selected components UUIDs.
  • Write kernel tests for the new end-point.
  • Expand openapi specs

User interface changes

None.

📌 Task
Status

Active

Version

0.0

Component

Personalization

Created by

🇪🇸Spain penyaskito Seville 💃, Spain 🇪🇸, UTC+2 🇪🇺

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @penyaskito
  • 🇪🇸Spain penyaskito Seville 💃, Spain 🇪🇸, UTC+2 🇪🇺
  • 🇪🇸Spain penyaskito Seville 💃, Spain 🇪🇸, UTC+2 🇪🇺
  • 🇪🇸Spain penyaskito Seville 💃, Spain 🇪🇸, UTC+2 🇪🇺
  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
    • This end-point will receive a set of component UIIDs that needs to wrap
    • This end-point will receive a personalization variation ID
    • This end-point will change the tree structure wrapping the received components into a "default" personalization variation ID so we can keep the existing defaults
    • This end-point will create the grafting of another personalization wrapper for the active personalization variation ID with copies of the previous components

    🤔 I'd expect these pieces to happen client-side, and for the client to send that to /xb/api/v0/layout/{entity_type}/{entity} on the server (which will auto-save and respond with an updated preview).

    IOW: this would be equivalent to:

    • placing a new component instance
    • moving an existing component subtree into that component instance

    I do not understand why we'd rely on the server side to update the client-side data model, when it's a client-side action that causes the changes.

  • 🇪🇸Spain penyaskito Seville 💃, Spain 🇪🇸, UTC+2 🇪🇺

    That would definitely simplify things. I assumed we wanted the client to be dumb about this.

    What I had envision would be something like

    POST /xb/api/v0/layout/{entity_type}/{entity}/personalize

    with { components: {uuid-component-1, uuid-component-2}, variant: my-variant}

    And that would encapsulate the same operations you described.

  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

    The client already will have to make personalization-specific UI changes. So it'll need to be aware anyway.

    I think requiring the client to talk to the server would be *more* complexity and logic. Because it is a simple tree manipulation vs I/O over the network with all complexities that that brings.

Production build 0.71.5 2024