0

p13n: Remove link to freeform on load

When thumbnails are loading, remove the link to freeform.

http://shortn/_o6OdDbjHBI

BUG=b:394960640
TEST=browser_tests *SeaPen*TemplateQuery*

Change-Id: I160c5ab0787e8e1b9f5faed96acbed1daddb7b10
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6251523
Reviewed-by: Jerry Liu <pzliu@google.com>
Commit-Queue: Erica Lee <ericamlee@google.com>
Reviewed-by: Jeffrey Young <cowmoo@google.com>
Cr-Commit-Position: refs/heads/main@{#1418965}
This commit is contained in:
Erica Lee
2025-02-11 15:56:27 -08:00
committed by Chromium LUCI CQ
parent 8ce8371caf
commit 4b791c9242
3 changed files with 45 additions and 3 deletions
ash/webui/common/resources/sea_pen
chrome/test/data/webui/chromeos/personalization_app

@ -175,7 +175,7 @@
</cr-button>
</template>
</div>
<template is="dom-if" if="[[shouldShowFreeformNavigationInfo_()]]">
<template is="dom-if" if="[[shouldShowFreeformNavigationInfo_(thumbnailsLoading_)]]">
<div id="freeformInfo"
inner-h-t-m-l="[[i18nAdvanced('seaPenFreeformNavigationDescription')]]">
</div>

@ -403,8 +403,10 @@ export class SeaPenTemplateQueryElement extends WithSeaPenStore {
return isNonEmptyArray(options);
}
private shouldShowFreeformNavigationInfo_(): boolean {
return isSeaPenTextInputEnabled() && isPersonalizationApp();
private shouldShowFreeformNavigationInfo_(thumbnailsLoading: boolean):
boolean {
return isSeaPenTextInputEnabled() && isPersonalizationApp() &&
!thumbnailsLoading;
}
private shouldEnableTextAnimation(

@ -587,4 +587,44 @@ suite('SeaPenTemplateQueryElementTest', function() {
'#freeformInfo'),
'freeform navigation info displays');
});
test('hides Freeform navigation info if thumbnails are loading', async () => {
loadTimeData.overrideValues({isSeaPenTextInputEnabled: true});
seaPenTemplateQueryElement = initElement(
SeaPenTemplateQueryElement,
{templateId: SeaPenTemplateId.kFlower.toString()});
await waitAfterNextRender(seaPenTemplateQueryElement);
assertTrue(
isVisible(
seaPenTemplateQueryElement.shadowRoot!.querySelector<HTMLElement>(
'#freeformInfo')),
'freeform navigation info displays');
// Simulate loading start.
personalizationStore.data.wallpaper.seaPen = {
...personalizationStore.data.wallpaper.seaPen};
personalizationStore.data.wallpaper.seaPen.loading.thumbnails = true;
personalizationStore.notifyObservers();
await waitAfterNextRender(seaPenTemplateQueryElement);
assertFalse(
isVisible(
seaPenTemplateQueryElement.shadowRoot!.querySelector<HTMLElement>(
'#freeformInfo')),
'freeform navigation info no longer displays');
// Simulate loading end.
personalizationStore.data.wallpaper.seaPen = {
...personalizationStore.data.wallpaper.seaPen};
personalizationStore.data.wallpaper.seaPen.loading.thumbnails = false;
personalizationStore.notifyObservers();
await waitAfterNextRender(seaPenTemplateQueryElement);
assertTrue(
isVisible(
seaPenTemplateQueryElement.shadowRoot!.querySelector<HTMLElement>(
'#freeformInfo')),
'freeform navigation info displays');
});
});