Personalization component source

Created on 21 May 2025, 4 months 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.

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

    Met today with @wim leers, and we reviewed 📌 Replace the postPreview action with atomic equivalents Active and it would really play really nice with the plan at #6 (doing this server side).
    That would ensure we can have concurrent editing even when doing personalization, reducing the chances of having race conditions.

    However, @mred9 has some progress on doing this as explaining #5 (client-side).

    So we are (shortly) postponing the decision here on:

    a) Reviews on 📌 Replace the postPreview action with atomic equivalents Active to decide if that's mergeable/close to mergeable and we actually want that before 1.0.
    b) Seeing the work @mred9 is doing on the client-side, which will be pushed to a new branch in 📌 Personalization PoC Active

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

    No matter the decision, this will need a IS update now that we know much more.

  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

    📌 Replace the postPreview action with atomic equivalents Active is super unlikely to land any time soon, so let's go with the client-side approach that @mred9 already had working!

    (Supposedly there is an impressive screencast of this, but I haven't seen it yet 😇)

  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
  • 🇪🇸Spain penyaskito Seville 💃, Spain 🇪🇸, UTC+2 🇪🇺

    Not a priority right now, but this is not postponed anymore.

Production build 0.71.5 2024