Repository navigation
Editing in the UI
This page is made from docs/editors.md on every change to
main; edit it there.
Every MNML card is in Home Assistant's card picker: Add card, then By card, where a search for MNML lists them by name, MNML Agenda to MNML Tile. Each has a description and a link to its keys. The cards that can show something with any home's entities have a live preview there, and each starts from a stub with a fitting entity of the home: a light for the slider, a media player for the media card.
- Panels, in the order of the card's keys: what it shows (the entity, the name, the icon), what it does, its colour and conditions, then its parts. Each is Home Assistant's own expansion panel, with an icon and a summary of what it holds (an entity's name, a count of parts such as 1 control or 3 controls, or not set) that follows each change; the first is open, and the others are drawn when first opened.
- Kinds. A card or part that comes in kinds starts with a switch between them, and shows only that kind's fields: a header or tile of an entity or of a name and icon, a select card of an entity or of scenes, a state line that is a text, an attribute, minutes, a relative time, a serial, the name or the value, and a control's type. Switching keeps the keys both kinds have. A kind that is only a switch of its own, such as minutes or the name, is set by the kind switch, and has no field for it.
- Parts. State lines, controls and chips, status rules, list rows, items, calendars, message sources and networks are lists. Each part is a row named by its name or entity, with its kind where the parts have kinds; it opens on a click, and its three-dot menu moves it up or down, copies it, or deletes it. The menu takes the focus when it opens: the arrow keys, Home and End walk its items, and Escape closes it and gives the focus back to its button. Add takes a kind where the parts have kinds. Paste puts the part last copied, in this browser, into any list of the same parts: a control copied from a heading pastes into a tile's chips.
-
Pickers. Entities are picked from the domains the key takes, icons with Home Assistant's icon picker, pop-ups from the hashes of this dashboard's pop-ups (its pop-ups card's, and those its template cards announce) or typed, with or without the
#, services and colours from their lists. Words are pairs of a state and its word; a state given twice is marked, and nothing is written until every state differs, while the boxes keep what was typed, so two states can be swapped. A word without a state, a new one or one whose state was emptied, stays in its boxes and out of the YAML until it has one. The report card'scolorsare pairs of a word and a colour picked from the list. The car's doors, windows and tyres are four entities each, front left, front right, rear left, rear right. -
Where a form comes from. A card's form, and its key check, read one structure of the card, in
src/contract/structure.ts: its keys in their order, each one's kind, whether it is required, the domains an entity takes and the values of a choice. The labels of the card, its kinds and its keys, the help under a field and the panels are insrc/editors/labels.ts. A key added to the card's interface goes into its structure, and the type checker refuses the structure until it does; a key reads as its humanised name (half_statesis "Half states"), and its label goes into the table only when that reads badly, which a test checks: a key whose name holds a two-letter abbreviation needs one. -
The YAML it writes holds only the card's keys. An edit writes only what it changes, and leaves the rest of the card as written. A field at the card's default writes nothing, a switch turned off removes its key, and keys keep their place. An empty list of a key with a default, such as
half_states: [], is not the default, and stays; an emptied text writes nothing, so the card's default applies. Home Assistant's Layout and Visibility tabs work as for any card.
-
The gallery, when no template is chosen, when the card names a template the dashboard does not know (said above it), or on Change: the tiles, the home's own first, then the shipped ones by family, each as the home has changed it, and under them Pop-ups and parts, folded, with the rest (Roles). A filter over names and descriptions looks among all of them, the fold open. Each template that draws a card has a live preview. One whose required slots all have rules to find them is drawn in an area where discovery fills them all: the first such area, in the order Home Assistant lists them, where it fills an optional slot too, or else the first. Any other template, or one that no area fills, is drawn with its
example, or else with what it finds in the whole home. Previews are drawn as they scroll into view, follow the home's states, take no press, focus or key, and leave the dashboard's pop-ups alone; the first opening fetches every family, which the browser caches, and a card that names a template waits for them rather than showing the gallery. A template picked there starts as its tile showed it: in that area, or with itsexample, or else in the whole home for a template whose rules look there, and filled in yourself for any other; picking the template already chosen keeps the card as it is. -
The template, under its name and description, with Change to go back to the gallery, and, for an admin, Edit this template, which closes the card's dialog (Home Assistant asks first when the card has changes not saved) and opens the template in the MNML panel. Then where its values come from:
-
Find in an area: the template finds its devices in the area picked. Each field and each part says where its value comes from: found in the area, nothing found there, set by you, or not set, for a value cleared there (
null,''or[]). A value changed in the form goes toslots, which replaces discovery for that slot alone, the slot's default too when it differs from what was found; an edit back to what was found leaves no override, and Use what the area found gives a panel's slots back to the area.slotsgoes when none is left. -
Fill in yourself: every slot in
slots, and noarea. -
Find in the whole home, offered only for a template whose rules look in the whole home (
scope: all): neitherareanorslots, and the fields show what the home found. An edit there fills the card in yourself, from what was found.
-
Find in an area: the template finds its devices in the area picked. Each field and each part says where its value comes from: found in the area, nothing found there, set by you, or not set, for a value cleared there (
-
An edit writes only the slot it changes; the others stay as written,
null,''and[]included. A field with a default, emptied, sets its slot to none (null), since a slot left out takes the default. -
Switching keeps the values. From an area to filling in yourself, what the area found and what was set become
slots; from the whole home, what the home found. Back to an area, the values that differ from what the area finds stay inslots, and a slot the area finds but the card lacked is set to none; the area is the one whose id or name matches the card'skeyorname, and when none does, the card stays as it is until an area is picked. - What it found. In an area or in the whole home, a line under the choice says what discovery found there, by the slots' labels ("Found in Living: Short name, Name, Temperature, Lights"), and another, in the error colour, each required slot nothing fills ("Needs: Protection", for AdGuard Home in a home without it). The panels start folded, but those that hold a required slot nothing fills; Change what it found opens them all. Filled in yourself, or for a template that discovers nothing, there is no such line, and the first panel starts open. A required field inside a slot counts: an area with a scene but no light needs Lights.
-
The device it found. An
objectslot filled from a device (Devices find themselves) names it under its heading, "Found: Roborock S8 in Living": the device's name as Home Assistant shows it, the name given in Home Assistant first, and its area's. Use another lists each device that fits but the one in use, all of them while the slot uses none, as when it is set by hand to other entities; picking one writes the slot's fields from that device intoslots, as the card's own values over what was found, and the note says so ("Set by you: Mini in Living"), naming the device that holds most of the slot's entities. Use what the area found goes back. In the whole home, a device picked fills the card in yourself, as any edit there does. Every entity picker of the slot's fields lists the device's entities first, then those of the devices linked to it throughvia_device(a vacuum's dock), then those of its area, then the rest, and follows each device picked: around those fields the editor answers Home Assistant's entity pickers with theirrelatedcontext, the device's entities as its entities, its linked devices as its devices and its area as its area, the three tiers Home Assistant orders a picker by. -
Panels. The slots are grouped into panels by the template's
group:, each with an icon and a summary, and labelled and explained by itslabel:andhelp:(Writing a template). Every required slot of a shipped tile has ahelp, and every slot of one whose name is not a plain word alabel. An optional part the card lacks is offered with Add, and Remove takes it away. A slot of kindobjectorobjectswithoutfieldsis kept as written, and set in YAML. - The preview is the card as it is, and leaves the dashboard's pop-ups alone: a template's pop-ups are announced by the card on the dashboard, not by its preview.
A card with a key the editor does not know, or a value it cannot hold, opens in Home Assistant's YAML editor, with the reason. The pop-ups card has no form, and opens in YAML. The editors are a file of their own beside the bundle, mnml-cards-editors-<hash>.js, named by its content and loaded the first time a card is edited; a load that fails is tried again on the next edit.
MNML in the sidebar, for admins, at /mnml, is where MNML builds dashboards from the home, and where the home's templates are kept and built. It is a file of its own, mnml-cards-panel.js, which the integration registers. Its two tabs are Dashboards, which it opens on, at /mnml (and /mnml/dashboards), and Templates, at /mnml/templates.
Dashboards lists the dashboards MNML built, each with its address and when it was built. A row opens the dashboard's builder; Open goes to the dashboard, Undo puts back the version the last rebuild replaced, and Forget stops MNML building it, leaving the dashboard in Home Assistant as it is or, with Delete it too, deleting it. A dashboard deleted in Home Assistant stays listed, without Open and Undo, and its builder makes it again. When the integration cannot give the list, the tab says why. When Home Assistant's own list of dashboards cannot be read, the tab says so instead of calling every dashboard gone, and Rebuild refuses rather than make one again. With none built, the tab offers to build one:
-
Quick start says what it makes and where, then makes it at once: a room tile for each area that is a room (as the builder's Rooms below tell) and where the room template finds something beyond its name and icon, in the order Home Assistant lists the areas; a tile for each person; the system cards whose entities MNML finds in the home; pop-ups that unfold from their tiles on a tablet and a computer. Its address is the title after
dashboard-, free of every dashboard and panel the home has. -
Step by step opens the builder on the same choices, at
/mnml/dashboards/new.
The builder is one page, a section for each part of the dashboard, in the dashboard's order: Rooms, People, Garage and System each move up and down by their heading, and the dashboard draws them in that order. Each of Rooms, People, Garage and System has, under its name, the title and the icon of its heading on the dashboard, and for all but System the template its cards are drawn with, among the tiles that take the slots its rows are given (Roles), a template changed dropping the slots set on rows that it does not have: a template of the home's own, such as a copy of room with changes, draws every room. Left empty, they are what the builder uses otherwise (Rooms, mdi:floor-plan, room; People, mdi:account-group, person; Garage, mdi:garage, car; System, mdi:server-network).
-
Dashboard: its title and icon, and for a new one its address: lower case letters and digits, with at least one
-between them, as Home Assistant asks of a dashboard's address, and at most 64 long. -
Rooms: each area, ticked to show it, its tile drawn live, and moved up and down. An area is a room when it holds something a room shows: a light, a climate, a cover, a lock, a media player, a fan, a vacuum, a camera, a humidifier, an outlet (a switch of class outlet, or the power sensor of a switch's device), a 3D printer, a washer, dryer or dishwasher, a window, door or leak sensor, or a temperature or humidity sensor that a device measures or that is the area's own in Home Assistant's area settings (a template's reading of a server's temperature, on no device, is not, and neither is one on a service device, the device of a server or of an integration itself, such as System Monitor or Glances). Nothing diagnostic, no setting and no update counts, and nothing on a device that moves with someone: one with a tracker or the companion app's entities, a phone or a car. An area is held by the entities in it, its own and those of its devices. One that is not a room starts unticked, with why under it: Only phones and trackers. when each of its devices moves with someone, Only system devices. when its devices hold nothing a room shows (servers, network gear, their updates and diagnostics), and Nothing in this area: its devices are in no area or elsewhere. when it holds no device. It can still be ticked when its template finds something to show there; an area where the template finds nothing cannot be ticked, and says why, or Its template finds nothing to show here. when it is a room. Under the areas, when devices in no area hold something a room shows, a line counts them (2 devices have no area, so no room shows them.) and links to Home Assistant's devices page, where they are given one. A spelled room, one a plan gives every slot of and no area, as a home in code does (The home dashboard), is listed by its
name. A device that moves with a person, one with a phone's or a car's tracker (source_type: gps) or the companion app's, counts for no room; a tracker a router reports is not one. - People: each person, ticked to show them, with their tile, and moved up and down. A person's devices are the trackers of theirs that the companion app made, with the app's sensors.
-
Garage: the cars, each with its tile, moved up and down, and Remove. Add a car opens the car template's editor; a car needs a key, its name in its pop-ups' hashes (
sedangives#car-sedan), and every entity the template requires. - System: each system template (Home Assistant, a Proxmox VE server, a UniFi network, a Tailscale tailnet, AdGuard Home, a media server). One whose tile shows something from what MNML finds in the whole home can be ticked: Home Assistant's load from System Monitor and the Supervisor, AdGuard Home's from its integration. Any other has Choose its entities, which opens its editor. The ones shown move up and down, and one a dashboard template brings that is none of these six is listed and kept.
- Glances: The Glances strip, ticked to show it: one line across the top of the dashboard, above the sections, the weather, the alarm and whatever needs you, which it finds in the home (More devices).
- Pop-ups: how a tile's pop-up opens on a phone, a tablet and a computer: a sheet, a dialog or unfolded from its tile, or the default (a sheet on a phone, a dialog elsewhere).
Customize, on any row shown, opens the template card's editor on that row's card, with what MNML found and the row's changes (The template card's editor). Done checks that the card still draws with its own template, and keeps only what differs from what MNML finds: a room keeps its overrides over its area, a person and a system card what differs from what MNML finds of them, so a rebuild still follows the home in the rest. A spelled row keeps every slot it is given, and discovers nothing.
Create makes the dashboard in Home Assistant, in the sidebar, and keeps what was chosen. When the dashboard is made but its cards cannot be saved, the page moves to that dashboard's builder at the same address, with the choices kept, so trying again rebuilds it rather than making a second one; a failed Create or Rebuild keeps the choices and puts back what MNML kept before. Rebuild asks first, writes each row with only the slots its template declares (a slot a row holds that the template retired or no longer has is left out), keeps the cards it is about to replace (it stops when it cannot read them), then replaces the dashboard's cards, with any change made to them by hand, and its title and icon; the version it replaces is kept, cards and choices, until the next rebuild, for Undo. A room whose area is gone, or a person who is gone, is left out of what is built; a spelled one is always built. What MNML keeps of each dashboard lives in the integration (The integration).
A dashboard MNML built is shared as a dashboard template: Share on its row shows it as YAML, to download as <address>.yaml, or to copy where the browser allows it (Home Assistant over HTTPS). It holds the dashboard's title, icon and pop-up openings, whether the Glances strip shows (glances: true, without what a home spelled in it), the order of its sections, its sections (each one with something in it, or a look) with their looks, the system templates chosen, and every template it uses, inside others too, that is not the shipped one as shipped: the home's own and the shipped ones it changed, whole, their examples with them, and their slots resolved, so that a slot that names a shape carries the shape's fields, and the template reads in any home. Its layout names no area, person, slot set on a row or car of the home; a template's example goes as it is, and may name the home's entities.
mnml_dashboard:
title: Home
icon: mdi:home-variant
glances: true
open: { tablet: unfold, desktop: unfold }
sections:
rooms: { title: Spaces, template: my-room }
people: {}
system: { templates: [home-assistant, adguard] }
templates:
my-room: { description: ..., slots: ..., card: ... }From a template, beside Quick start and Step by step, and in the head once a dashboard is built, takes a file or pasted text. It refuses what is not a dashboard template and says what it is instead (a dashboard's configuration, or a set of templates for the Templates tab), a section template that is neither shipped nor in it, and a template it brings whose slots name a shape that cannot be resolved, naming the template and why. Then it says what the template makes in this home, again as each choice below changes ("Here it makes 6 rooms, 2 people. AdGuard Home needs its entities: ..."): the areas that are rooms where its rooms template draws, every person, its system templates whose entities MNML finds, and an empty garage, since a car's entities are this home's. When its rooms template draws in none of them, it says so: "Its rooms template draws in none of this home's rooms, so there is no room." The templates it brings are listed as the library's import lists them: new, the same as here, or one that would change a template of the home or a shipped one, which it replaces (on every dashboard of the home), sits beside under a new name, the choice it starts on, or skips. A changed section-heading is replaced or skipped, since every dashboard draws its headings with it. Open in the builder saves them and opens the builder on what it makes, with the names they came in under, inside the templates too, as Step by step does; Create makes the dashboard.
The library says so at its head while a family of shipped templates could not be loaded; until it loads, Import and From a template refuse, and the shipped names stay taken. The library lists the tiles, and with Pop-ups and parts switched on (remembered in the browser) every template: shipped, customised (a shipped one with the home's changes), the home's own, and those with a conflict. The home's own templates, and the shipped ones it changed or that have a conflict, are listed whatever the switch. With the switch off, a line under the list counts the pop-ups and parts left out, and a search that matches only those says so and offers to show them. Each row has the template's family, its status ("customised, 3 changes") and where it is used ("on 9 cards, 2 dashboards", counted from every dashboard). A filter searches names, descriptions and families, and chips narrow it to a status. New asks for a name and opens a template to start from, a heading with a title slot; Import takes a YAML file or pasted text, a mapping of names to templates (or a dashboard's configuration, whose mnml_templates: it reads), shows what each becomes, lets one named like a template the home keeps replace it, sit beside it under a new name, or be skipped, and saves; a template whose slots name a shape that cannot be resolved is refused before anything is saved, with its name and why. Export writes the templates shown, or one from its row, whole, the home's own as written, to a .yaml file: a slot keeps the shape: it names, so the file needs an MNML that ships those shapes, where a shared dashboard template (Sharing a dashboard) carries its templates resolved. Each row's menu also has:
- Duplicate, a copy under a new name, as a template of the home's own, a copy of one of the home's own as written;
- History, the earlier versions, a deleted or reset template's included, the one chosen restored at once;
- Rename, for the home's own templates, which reads each dashboard kept in the UI again and updates its template cards, the changes of the customised templates that name it and the dashboards MNML built from it, names the YAML ones to change by hand, and keeps the old name beside the new one while a dashboard could not be read or saved;
- Delete, or Reset to shipped for a customised one, each saying where the template is used.
While a dashboard holds mnml_templates: that MNML does not keep, the library offers to import them: one named like a shipped template comes in as changes to it, any other as the home's own. When dashboards hold different versions of one name, the import says so and takes the first found, the mnml-templates dashboard's first. One whose slots name a shape that cannot be resolved stops the import before anything is saved, naming the template and why. Nothing on the dashboards is written. A copy of a shipped template written before parts had ids takes the shipped template's ids, so a copy that matches it is no change at all and is not offered. An action of the library that fails says why in a dialog.
The builder opens a template at /mnml/templates/<name>. Its header has the back arrow, the template's name over what it is (your template, as shipped, or its count of changes to the shipped template), Undo and Redo, a menu, and Save, which is off while there is nothing to save. The menu has:
- Discard the changes, back to the last save, or, for a new template not saved yet, back to the library; it is offered only when the draft differs from what is stored;
- Reset to shipped, for a shipped template with changes, which puts the shipped template in the draft;
- History, which puts an earlier version in the draft;
- Duplicate and Export, of the draft as it stands.
Its tabs are Design, which it opens on, and, behind More tools, Card, Pop-ups, Slots and YAML. On a phone, the Card and Pop-ups tabs show one pane at a time, chosen under the tabs.
-
Design is the template drawn large, with a panel beside it, and nothing to learn first. It is the only tab in sight: More tools shows the others. It is tried on the area of the home where the template finds the most, or on the example; Try it on changes that. Under the tabs sit buttons for the card and each of its pop-ups, drawn as sheets.
- A new template asks what to make: a tile, a list, a strip of statuses or a pop-up. Each starts with real entities of the home in it, so there is something to click at once.
- Pick a part by clicking it: a chip, a value of the line under the name, a row of a list, an item, a card of a pop-up, a card another template draws, or a card inside a native card, by the configuration Home Assistant keeps for it. The part under the pointer is outlined, and the one picked stays outlined. Nothing the card would do happens on a click: no chip is pressed and no pop-up opens. A card of any kind can be picked, a fragment's cards included.
- With the keyboard, the drawing is one stop: the arrow keys, Home and End walk the parts, Escape lets go, Delete removes the picked part and Alt with the arrows moves it earlier or later. A line out of sight says which part is picked.
- Drag a part onto a neighbour of its list to move it there: with the mouse, or on a touch screen after pressing it for a moment, so that a swipe still scrolls.
-
The panel names the part by its id and its place ("Heating", "A chip of the tile"), says what it is when another template draws it, and has crumbs to pick the part it sits in. Under that:
- What it shows: each entity the part reads, as a picker. A part with an entity of its own keeps it, and Changes with the room turns it into one the template finds by itself in each room (from the kind of entity picked: a temperature sensor, a door sensor), the one picked staying for the preview, which the browser keeps for next time. For one that already changes with the room, the picker only sets the preview, and says what the room found; Always this one writes the entity into the template instead;
- How it looks: colour, icon and name or title, where they are written in the template, a fragment's own slots included (a field emptied keeps its value);
- When it shows: always, only when found, or only when not found, depending on a slot, by the name each thing has in the Slots tab;
- Order: Earlier, Later, Copy and Delete, and Shown, a switch for a part of a list. Off takes the part out of the draft and keeps it, while the template is open, as a hidden part to switch on again; on puts it back as it was, after the part before it, and after a reload a shipped template's part comes back from the shipped template, after the nearest earlier part still there;
- Add, for each list the part holds, with the parts that fit; with nothing picked, for the card itself;
- for a piece another template draws (Shared design), Edit it here, which writes it out in this template (its slots filled in with this template's own, its conditions kept, its pop-ups added) so that anything in it can be changed and it stops following the shared piece, and Edit it for everyone, which opens that template. Where it cannot be written out, such as a piece that loops over a list written in the template, only the second is offered;
- More settings, folded: the inspector of the Card tab.
- Every change goes through the draft, so undo, the count of changes and Save work as they do in every tab.
-
The outline, on the left, is the card's tree, or the pop-ups': every card and part, fragment uses with their template's name, a sentence for each condition (
if: windowreads "when window is set",if: [ac, heating]"when ac or heating is set",unless: window"when window is not set",each: devices"one for each of devices"), and a mark on every part the home changed. A list's parts are dragged to reorder, or moved from their menu, which also duplicates and deletes; Add to takes a card, a part of a fitting kind, or a fragment. - The preview, in the middle, is the template as drawn: the expanded card, and its pop-ups behind the hashes listed under it, tried on the example or on an area picked above it. A template whose card is a pop-up (a hash and no type) is tried as that pop-up, listed with the others. A draft that does not expand says why there. A change in the home reaches the preview and the forms without drawing the builder again.
-
The inspector, on the right, is the selected part: when it is shown (always, or only if slots are set or not set), its fields bound to slots (a field holding
[[slot]], alone or in text, with a button to set it by hand instead), a binder (Setting, Link it to, Link) that gives a field a slot of a kind that fits it (an entity field anentityslot, a text field atext,number,iconorentityone), its kind where parts come in kinds, and its other fields in Home Assistant's form. A fragment use picks its template and gives its slots values or slots of this template. A part the form does not know is changed in the YAML tab. -
Slots lists the slots by panel. Each has its kind, label, help, panel, required and default, and the rules that find it as sentences: "Use the area's temperature sensor", or "Find the first sensor with device class battery from the integration ... in the area", or else another rule. In a shipped template, a slot that differs from the shipped one is marked changed. "In (area) it finds ..." tries the rules on an area as they change. The fields of an
objectorobjectsslot are slots of their own, and the fields of a "one per device" rule are written in YAML. A slot that names a shape (Writing a template) says so after its kind, "a meter", or "each a consumable" for a list of them, and lists the fields the shape gives it, as the shape and the slot's own keys make them. An edit to it, or to one of those fields, writes only what differs from the shape, such aslabel: Energyorfields: { power: { required: true } }, never the shape spelled out. Its label, help, panel and default hold only what the slot sets itself, with what the shape gives as their placeholder: emptying one goes back to the shape's, and a value the same as the shape's is no change, so the field empties to show it. A shape's fields are neither deleted nor added to and keep their kind, and what the shape requires stays required; the slot itself is deleted, or switched betweenobjectandobjects, as any other. A slot whose shape cannot be resolved, such as a shape that is not known, says why, and is deleted here or mended in YAML. Under them, Example values fills the slots for the preview and for the check on save. -
YAML is the whole template as written, a slot's
shape:included, in Home Assistant's code editor where the page has one and in a text area otherwise; Apply takes it back to the other tabs,shape:and all, and a problem is said under it.
The builder keeps the template as it is written. Wherever it draws, checks or lists the slots, in the preview, the panel's pickers and conditions, the Slots tab and the example, it resolves the shapes they name with the shipped shapes, as the store does for the cards, so a draft that names a shape is drawn as it will be once saved.
Every edit can be undone and redone. A part added in the panel gets an id that starts with my-, which no shipped part's does. A part without an id, or with the id of another part of its list, gets one when the template opens and when YAML is applied: the id of the shipped part it matches, or else a new my- one.
Save first resolves the shapes the slots name, refusing with the reason when one cannot be, then checks every default against its slot's kind, that every slot the template reads (in [[...]], a projection such as [[devices.*.update]] included, if, unless and each, wherever it sits) is one it declares, and that no two parts of a list share an id; then it expands the draft with its example and has every card check its configuration. It refuses with the reason, keeping the draft. A template of the home's own is saved whole, as written, so a slot keeps the shape: it names. A shipped one is saved as the changes from the shipped template to the draft, its shapes resolved, since the changes apply to the shipped template as resolved, and only when those changes give the draft back; an edit back to the shipped template saves no change, and resets it. A save that would store what is stored already sends nothing.
A template whose changes a release has touched since opens with them laid over, says which still apply and which are left out (a part gone, or an id the shipped template now gives a part of its own), and marks those parts in the outline; it can be saved as it stands, which keeps the changes that apply and clears the conflicts.
Leaving a template with changes not saved, by its back arrow, the browser's back or closing the page, asks first. A new template or a duplicate is kept only once saved: left without saving, it is gone, and its name is free again.
The panel follows the store while it is open, so a save from another browser shows in its library at once.