docs(assets): tighten getMediaDisplayName and getAssetDisplayFilename docstrings

This commit is contained in:
dante01yoon
2026-05-21 20:21:57 +09:00
parent e35bb25d7c
commit 2fd67256fd
2 changed files with 6 additions and 17 deletions

View File

@@ -172,15 +172,9 @@ export function getAssetFilename(asset: AssetItem): string {
}
/**
* Gets the human-readable filename to render in UI surfaces.
* Fallback chain: user_metadata.filename → metadata.filename →
* asset.display_name → asset.name.
*
* `display_name` is the unified user-facing label emitted by both Core
* and Cloud per the BE-808 Asset Identity RFC — required where
* `asset.name` is a content hash (hash-keyed assets). Use this helper
* for labels/titles only; for serialized identifiers use
* {@link getAssetFilename}.
* Human-readable filename for UI labels.
* Fallback: user_metadata.filename → metadata.filename → display_name → asset.name.
* For serialized identifiers use {@link getAssetFilename}.
*/
export function getAssetDisplayFilename(asset: AssetItem): string {
return (

View File

@@ -85,14 +85,9 @@ export function getNodeDisplayLabel(
}
/**
* Resolve display name for a media file.
* Widget values may be content hashes (Cloud) or filenames (OSS); look the
* asset up in the unified `inputAssetsByFilename` map and delegate the
* label resolution to {@link getAssetDisplayFilename} so this helper
* shares the fallback chain (`user_metadata.filename` →
* `metadata.filename` → `display_name` → `asset.name`) with the asset
* card / browser surfaces. Falls through to the raw input when no asset
* matches.
* Resolve a media widget value (hash or filename) to a display label via the
* shared {@link getAssetDisplayFilename} fallback chain. Returns the input
* unchanged when no asset matches.
*/
export function getMediaDisplayName(name: string): string {
const asset = useAssetsStore().inputAssetsByFilename.get(name)