mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-24 06:35:10 +00:00
docs(assets): tighten getMediaDisplayName and getAssetDisplayFilename docstrings
This commit is contained in:
@@ -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 (
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user