Goal
The default variant icon of `el-notification` is visible whether the element was server-rendered or created in the browser.
Context
`variantIconTemplate()` nests a template result (`${paths[this.variant] ?? info}`) inside an ``. When the element renders in the browser (a toast, or a notification added after a form action), the nested `` / `` nodes end up in the HTML namespace (`namespaceURI` is `http://www.w3.org/1999/xhtml\`), so the browser draws nothing: a 20×20 empty box. Server-rendered notifications (Declarative Shadow DOM from `@webtides/element-js-ssr-renderer`) are parsed by the browser and show the icon. Seen in loewen-digital/sveltekit-ai-starter-template (issue #10 there), where inline alerts after a form submit and all toasts lose their icon; the template slots its own icon until this is fixed.
Acceptance criteria
Proposal (non-binding)
Render the whole `` per variant as one template (no nested template result inside the SVG), or create the nested nodes with `createElementNS`. This may be an element-js concern (template parts inside SVG) rather than a notification one.
Out of scope
Custom icons passed through the `icon` slot, which work.
Goal
The default variant icon of `el-notification` is visible whether the element was server-rendered or created in the browser.
Context
`variantIconTemplate()` nests a template result (`${paths[this.variant] ?? info}`) inside an ``. When the element renders in the browser (a toast, or a notification added after a form action), the nested `` / `` nodes end up in the HTML namespace (`namespaceURI` is `http://www.w3.org/1999/xhtml\`), so the browser draws nothing: a 20×20 empty box. Server-rendered notifications (Declarative Shadow DOM from `@webtides/element-js-ssr-renderer`) are parsed by the browser and show the icon. Seen in loewen-digital/sveltekit-ai-starter-template (issue #10 there), where inline alerts after a form submit and all toasts lose their icon; the template slots its own icon until this is fixed.
Acceptance criteria
Proposal (non-binding)
Render the whole `` per variant as one template (no nested template result inside the SVG), or create the nested nodes with `createElementNS`. This may be an element-js concern (template parts inside SVG) rather than a notification one.
Out of scope
Custom icons passed through the `icon` slot, which work.