deckhearth/lib/collection-vocabulary.js
Randall Stillwell 4bc0cfecfc Follow-up vocabulary cleanup and dashboard h1 fix.
Correct dashboard title (My Collection overview, not Lists), sweep
remaining marketing/auth copy, update system-list seed description,
add vocabulary unit tests, and close the convoy record.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-29 09:57:46 -05:00

42 lines
1.4 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',
ADD_TO_LISTS: 'Add to Lists',
SYNCED_BINDER: 'Synced binder',
SYSTEM_COLLECTION_SYNC_HINT: 'Automatically syncs with My Collection',
SYSTEM_COLLECTION_SEED_DESCRIPTION:
'Automatically syncs with My Collection. This list cannot be deleted or made public.',
};
/** 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;
}