{% from "_macros.html" import icon %} {# The head, the tab strip and whichever file is in front. Everything the panel swaps, in one fragment. Both together, always: rendering only the body would leave the strip showing a tab that is no longer there after a close, and rendering only the strip would leave the previous file on screen after a switch. #}

{{ icon("file-text", "icon--sm") }} {{ doc.title if doc else "Canvas" }} {% if doc and doc.subtitle %} {{ doc.subtitle }} {% endif %}

{% if doc and doc.key.startswith("scratch:") %} {# A copy, like every other attach path -- a transcript must not change because the pad was edited afterwards. #} {% endif %}
{% include "chat/_canvas_tabs.html" %} {# Opening one by hand. This was a path box, and it was the one control left in the application that asked somebody to remember an absolute path on another machine -- the same complaint the folder page's directory field answered with a picker. The model opens what it touches, which is still the commonest way a file gets here, but "open that other file" should not mean typing it out. The dialog itself still takes a typed path, so nothing has been removed: what has gone is having to type one when you would rather look. #}
{% if canvas_agent %} {# The profile is what the browse endpoint is hung off, so the button carries it. `data-canvas-open` rather than an `hx-` verb because the path is not known until the dialog closes -- app.js posts it once it is. #} {% endif %}
{% if error %} {% elif conflict %} {% include "chat/_canvas_conflict.html" %} {% elif doc %} {% include "chat/_canvas_doc.html" %} {% else %}

Nothing open. A file the model reads or writes appears here, and {% if canvas_agent %}the @ menu can put one here too.{% else %}notes, skills and this chat's own scratch document can be opened from the @ menu. {% endif %}

{% endif %}