ZDDC/classifier/js
ZDDC 8ba029612e feat(shared): non-blocking toast helper available to every tool
Promote classifier's local toast (classifier/css/base.css + showToast
in classifier/js/excel.js) into shared/toast.{js,css}. Every tool's
build.sh now concatenates them, so window.zddc.toast(msg, level, opts)
is callable from any tool.

API:
  window.zddc.toast('Saved.', 'success');
  window.zddc.toast('Could not load: ' + err.message, 'error');
  window.zddc.toast('Note', 'info', { durationMs: 3000 });

Levels: info (default) | success | warning | error. Single-toast
policy — a second call replaces the first. Click anywhere on the
toast to dismiss. ARIA: error → role=alert/aria-live=assertive,
others → role=status/aria-live=polite.

Class prefix is .zddc-toast (BEM-ish) to avoid colliding with any
tool-local .toast rules. Classifier's existing showToast now
delegates to window.zddc.toast — call sites in excel.js +
selection.js are unchanged. Classifier's local .toast CSS block
deleted in favor of the shared one.

This commit only EXPOSES the API. Replacing the ~25 alert() call
sites scattered across archive/transmittal/mdedit/classifier with
toast calls is left as follow-up — each alert needs per-call review
to decide if it's truly non-blocking.

Five Playwright tests in tests/toast.spec.js lock the contract:
API exposure, level mapping, ARIA roles, single-toast replace,
click-to-dismiss.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 19:04:41 -05:00
..
app.js feat(server): authenticated CRUD + verb-based RBAC with WORM archive folders 2026-05-05 15:58:04 -05:00
excel.js feat(shared): non-blocking toast helper available to every tool 2026-05-09 19:04:41 -05:00
filter.js Initial commit 2026-04-27 11:05:47 -05:00
preview.js perf(tools): vendor jszip + docx-preview for archive/transmittal/classifier 2026-05-04 07:49:17 -05:00
resize.js Initial commit 2026-04-27 11:05:47 -05:00
scanner.js Initial commit 2026-04-27 11:05:47 -05:00
selection.js Initial commit 2026-04-27 11:05:47 -05:00
sort.js Initial commit 2026-04-27 11:05:47 -05:00
spreadsheet.js feat(server): authenticated CRUD + verb-based RBAC with WORM archive folders 2026-05-05 15:58:04 -05:00
store.js Initial commit 2026-04-27 11:05:47 -05:00
tree.js Initial commit 2026-04-27 11:05:47 -05:00
utils.js Initial commit 2026-04-27 11:05:47 -05:00
validator.js Initial commit 2026-04-27 11:05:47 -05:00