deckhearth/lib/collection-vocabulary.js
Randall Stillwell a6d72e19b7 Align UI copy with My Collection vs Lists vocabulary.
Replace stale ownership/list labels across pages and components, add
lib/collection-vocabulary.js as the single copy source, document the
taxonomy in AGENTS.md, and gate retired strings in CI.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-28 14:55:01 -05:00

39 lines
1.2 KiB
JavaScript

/**
* Product vocabulary — ownership vs curated lists.
* See AGENTS.md § Product vocabulary and docs/SCHEMA_MAP.md glossary.
*/
/** Internal DB name for the auto-sync system collection — never render in UI. */
export const SYSTEM_COLLECTION_DB_NAME = 'All My Cards';
export const VOCAB = {
MY_COLLECTION: 'My Collection',
LISTS: 'Lists',
LIST: 'List',
ADD_TO_MY_COLLECTION: 'Add to My Collection',
REMOVE_FROM_MY_COLLECTION: 'Remove from My Collection',
ADD_TO_LIST: 'Add to List',
SYNCED_BINDER: 'Synced binder',
SYSTEM_COLLECTION_SYNC_HINT: 'Automatically syncs with My Collection',
};
/** User-facing label for a collection row (maps system collection DB name). */
export function collectionDisplayName(collection) {
if (!collection) return '';
if (
collection.isSystemCollection ||
collection.is_system_collection ||
collection.name === SYSTEM_COLLECTION_DB_NAME
) {
return VOCAB.SYNCED_BINDER;
}
return collection.name;
}
/** Scanner / bulk-action success line: "Added to …" */
export function formatProcessedDestination(action) {
if (action === 'owned') return VOCAB.MY_COLLECTION;
if (action === 'collection') return VOCAB.LIST;
if (action === 'deck') return 'deck';
return action;
}