Skip to content

Branches

Every version of a reply is kept — retry forks the conversation instead of overwriting it, and a ‹1/2› picker walks between the versions.

On this page
Open

Retrying a reply does not throw the old version away: it forks the conversation. The reply gets a sibling, and a ‹1/2› picker appears on it as soon as there is more than one version. Editing a question rewrites it in place and drops the replies under it. Moving between them shows the whole conversation that followed each version, because the transcript keeps the tree and renders one path through it.

With AparteClient running and retry turned on (see Message actions), you write nothing more: the client forks, the viewport keeps the tree, the picker appears.

The picker is drawn from the tree, so markup alone never places it. On a message you draw yourself, setSiblings(count, index) says how many versions exist and which one is shown, and aparte-branch-navigate tells you when the reader moves:

js
bubble.setSiblings(2, 0);
bubble.addEventListener('aparte-branch-navigate', (e) => showVersion(e.detail));

On the transcript, addBranch(), addSiblingOf() and navigateBranch() build and walk the tree; exportTree() and importTree() save and restore it with the conversation. The conversations and branching guide shows the whole flow.

setSiblingNavRenderer() draws the counter between the arrows your way, for a product that writes “Version 2 of 3” or draws dots; the arrows stay.

  • The previous and next buttons are named from the locale (previousResponse, nextResponse).
  • The position (2 of 3) is announced through a polite live region when the reader moves.