Remove client fallback for readonly item property display

This commit is contained in:
Jage9
2026-02-27 01:34:32 -05:00
parent 4840aa454b
commit 0fbd4f3615
3 changed files with 3 additions and 58 deletions

View File

@@ -7,12 +7,8 @@ import {
itemPropertyLabel,
} from './itemRegistry';
type PresentationDeps = {
formatTimestampMs: (value: unknown) => string;
};
/** Builds shared item-property presentation/validation helpers used by item menus and message echoes. */
export function createItemPropertyPresentation(deps: PresentationDeps): {
export function createItemPropertyPresentation(): {
getItemPropertyValue: (item: WorldItem, key: string) => string;
isItemPropertyEditable: (item: WorldItem, key: string) => boolean;
describeItemPropertyHelp: (item: WorldItem, key: string) => string;
@@ -59,17 +55,6 @@ export function createItemPropertyPresentation(deps: PresentationDeps): {
if (metadata?.valueType === 'list' || metadata?.valueType === 'text') {
return rawValue === undefined || rawValue === null ? '' : String(rawValue);
}
if (key === 'type') return item.type;
if (key === 'x') return String(item.x);
if (key === 'y') return String(item.y);
if (key === 'carrierId') return item.carrierId ?? 'none';
if (key === 'version') return String(item.version);
if (key === 'createdBy') return item.createdBy;
if (key === 'createdAt') return deps.formatTimestampMs(item.createdAt);
if (key === 'updatedAt') return deps.formatTimestampMs(item.updatedAt);
if (key === 'capabilities') return item.capabilities.join(', ') || 'none';
if (key === 'useSound') return toSoundDisplayName(item.params.useSound ?? item.useSound);
if (key === 'emitSound') return toSoundDisplayName(item.params.emitSound ?? item.emitSound);
if (paramValue !== undefined) return String(paramValue);
if (globalValue !== undefined) return String(globalValue);
return '';