You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(toast): migrate to trigger-attribute ephemeral component (#290)
* feat(toast): migrate to trigger-attribute pattern (client-side ephemeral component)
Server now emits a lightweight hidden <span data-toast-trigger data-pending='[...]'>
instead of full toast HTML. Client reads data-pending after each DOM update and
manages toast DOM entirely client-side.
- container.tmpl: render trigger span only; data-pending omitted when no messages
- toast.go: add TakePendingJSON() with hasNewMessages flag + renderedJSON cache
to handle LiveTemplate's double-render (HTML pass + diff-tree pass per action)
- bundle: rebuilt from client feat commit
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(components): embed CSS in component templates (toast + modal)
Each component template now renders a <style> block alongside its trigger/content.
Because these templates are included on every server render, morphdom preserves
the CSS across all DOM patches — no JS injection needed.
- toast/container.tmpl: add <style> with [data-lvt-toast-stack/item/content] rules
- modal/confirm.tmpl: add <style> with full confirm-dialog layout rules
- modal/default.tmpl: add <style> with overlay + button-width overrides
- modal/sheet.tmpl: add <style> with overlay + button-width overrides
- bundle: rebuilt (injectToastStyles removed, -1.1kb)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: handle json.Marshal error in TakePendingJSON, update toast tests
Addresses bot review: explicit error handling in TakePendingJSON,
update template tests for trigger-only output, add TakePendingJSON
idempotency tests.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: use max-width for toast stack to avoid overflow on narrow viewports
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: address claude review — Position support, drain docs, aria-live confirmation
1. Emit data-position on trigger span so client directive positions
the toast stack per Container.Position (top-right, bottom-left, etc.)
2. Document that TakePendingJSON drains Messages (Count()/HasMessages()
return zero after template execution — by design)
3. Add comment explaining intentional CSS duplication across modal templates
4. aria-live="polite" confirmed present in client directive (getOrCreateToastStack)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
0 commit comments