The assembly board, its write-to-node step and the positive/negative tabs are gone. The studio now shows the prompt boxes of the prompt node last selected on the canvas (or a draft) as tags that are edited in place: weight, edit, remove, reorder, type to add with Chinese translated to English, and an optional Chinese meaning under each tag. Every change is one node write with Ctrl+Z, and the studio has its own Undo. Cards: three common ones instead of six, plus saved prompts; a saved prompt's text is read once instead of every 30 seconds. Current node lists the prompt boxes with Edit in Prompt Studio instead of its own translation. The inspector modal, starter-card data, plan loading and about 2,000 lines of CSS for the old board are removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
28 lines
1.1 KiB
JavaScript
28 lines
1.1 KiB
JavaScript
/**
|
|
* The receipt of values written to a node from a panel (Current node's parameters):
|
|
* which node took them, with Undo.
|
|
*/
|
|
|
|
import { translate as t } from './locales.js';
|
|
import { text } from './ui_dom.js';
|
|
import { materialNodeHeading } from './material_inspector.js';
|
|
|
|
/** Shows the receipt of `result` (with `undo()`) in `parent`, replacing the one there. */
|
|
export function showApplyReceipt(parent, result, node) {
|
|
parent.querySelector('.anomalous-material-application-result')?.remove();
|
|
const receipt = text(parent, 'div', '', 'anomalous-material-application-result');
|
|
receipt.setAttribute('role', 'status');
|
|
const status = text(receipt, 'span', node ? t('materialAppliedTarget', { name: materialNodeHeading(node), id: node.id }) : t('materialNodeApplied'));
|
|
const undo = text(receipt, 'button', t('materialUndo'), 'anomalous-btn-ghost');
|
|
undo.type = 'button';
|
|
undo.onclick = () => {
|
|
try {
|
|
result.undo();
|
|
status.textContent = t('materialUndone');
|
|
undo.remove();
|
|
} catch (error) {
|
|
status.textContent = t(error.message);
|
|
}
|
|
};
|
|
}
|