opral / inlang-message-ui-components

Issue tracker for UI components
0 stars 0 forks source link

separate `<inlang-message-pattern>` component #18

Open samuelstroschein opened 6 months ago

samuelstroschein commented 6 months ago

Problem

Inlang apps render message patterns outside the scope of an "editing" experience that opral/inlang-message-ui-components#16 will provide.

For example, @opral/inlang-ide-extension renders a pattern in inline decorations. With the upcoming https://github.com/opral/monorepo/discussions/913, rendering a pattern will become complex to the point that apps won't be able to deal with the complexity.

Proposal

  1. Offer an <inlang-message-pattern> component that apps can use separately of opral/inlang-message-ui-components#16.
  2. opral/inlang-message-ui-components#16 uses the <inlang-message-pattern> under the hood to render pattern.

<inlang-message>
  <-- patterns -->
  <inlang-message-pattern></inlang-message-pattern>
  <inlang-message-pattern></inlang-message-pattern>
  <inlang-message-pattern></inlang-message-pattern>
  <inlang-message-pattern></inlang-message-pattern>
  <inlang-message-pattern></inlang-message-pattern>
</inlang-message>

Additional information

This discussion emerged in https://discord.com/channels/897438559458430986/1209962134751019138/1209965163013214259

felixhaeberle commented 6 months ago

Second point is likely over-engineering. Just do an editor component which has all the editing functionality and a separate pattern preview component.

This way, we do not fall into the trap of building editing functionality into a component which is supposed to only render the edited output.

TLDR: Just to clarify, I don't see editing capabilities in the pattern component. The UX would likely be that you have an editing & a preview experience.

felixhaeberle commented 6 months ago

default assigning @NilsJacobsen because he will likely do this task.