Skip to content

v1.6.3

Choose a tag to compare

@20syldev 20syldev released this 20 Nov 11:16
· 44 commits to master since this release
v1.6.3
47e9a92

This release lets a host page offer its own starter suggestions and placeholder in the embedded widget, and adds a direct entry to the starter suggestions, in the embed and in config.json.

Embedded widget

A host page can now offer its own starter suggestions in the empty conversation of the widget, in both variants, by adding suggestions to a config message. It is the list of one language, in the shape of the suggestions of config.json, and the host localizes it. An array replaces the previous list, an empty array clears it, a value that is not an array is ignored, and a category or an item that is malformed is dropped as it is in the configuration file. The list is kept in memory only, so a host sends it again after a reload, once the widget has posted ready. The suggestions of config.json are still never shown in an embed.

With input=bottom the suggestions sit above the message box and nothing is ever below it: the box keeps its distance from the bottom edge, whether the list arrives, hides while the reader types, or comes back. With input=center they sit under the box, which moves up once when a list arrives after the first paint. A list of exactly one category, and no direct suggestion, shows its items as pills at once, without the label of the category. The suggestions are dropped below 400 px of height, before the message box is ever squeezed, and sooner when the welcome heading is shown, below 540 px with input=bottom and 560 px with input=center, so the heading never slides under the buttons; those limits assume a short application name, as a long one wraps the heading onto more lines. The pills wrap, and their focus ring is no longer cut at the edge.

A host can also send a placeholder, which replaces the one of the message box of an empty conversation until it sends an empty string. The rotating placeholders of config.json are only shown by the sidebar variant, so it replaces them there. It is kept in memory only too.

Direct suggestions

An entry of the starter suggestions with a title and no items is now a pill of its own that is chosen at once, next to the category pills, instead of a category that opens. It sends its prompt, or writes it in the message box with the caret after it when it is marked send: false, previews it the same way, and may name an icon, arrow-up-right or reply, drawn after its title. It works in the suggestions of config.json and in the ones a host sends to the embedded widget. Opening a category replaces all the pills, and a category with one item still opens its panel.

Starter suggestions

A long title without a space now wraps inside its pill instead of running past it. The grey preview of a suggestion no longer stays in the field when the pill under the pointer goes away as the reader types. Two categories that share a label each open their own suggestions, and a panel that is open closes when the host replaces the list. In Firefox, a placeholder longer than the message box no longer adds a scroll bar and a few pixels of height to it.

Compatibility

The new fields are announced in the capabilities of the ready message, as config.suggestions, config.suggestions.actions for the direct suggestions and config.placeholder, so a host can check for them. A widget older than this version ignores the suggestions and the placeholder of a config message. Everything in this release is additive: a host written for 1.6.2 keeps working as it is. The embedding guide describes every message and parameter.