-
Notifications
You must be signed in to change notification settings - Fork 622
docs(assets): unify display_name helper docstrings + fixture tests (FE-747) #12399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
2184d25
e35bb25
2fd6725
f0299e5
283e741
edeeb2d
c52dcfc
1935b52
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -189,13 +189,9 @@ export function getAssetStoredFilename(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 populated by queue output mappers in Cloud where | ||
| * `asset.name` is a content hash. 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}. | ||
| */ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: the trimmed docstring loses the useful "queue output mappers in Cloud populate
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Intentionally left as-is. The empirical Cloud probe (PR description §6) showed |
||
| export function getAssetDisplayFilename(asset: AssetItem): string { | ||
| return ( | ||
|
|
@@ -208,7 +204,7 @@ export function getAssetDisplayFilename(asset: AssetItem): string { | |
| * Prefers a user-curated name (user_metadata.name / metadata.name) when it | ||
| * actually differs from asset.name, so a user-renamed model keeps its | ||
| * display name. Falls through to {@link getAssetDisplayFilename} when the | ||
| * curated name is absent or equal to asset.name (Cloud hash case). | ||
| * curated name is absent or equal to asset.name (hash-keyed asset case). | ||
| */ | ||
| export function getAssetCardTitle(asset: AssetItem): string { | ||
| const curatedName = getStringProperty(asset, 'name') | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit:
name: 'sunset.png'is already inherited from...ossShape— the explicit re-assignment is a no-op and slightly muddies what the test is varying (thedisplay_namefield). Safe to drop.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done — dropped the redundant re-assignment; the fixture now only varies
display_name.