fix(apps): stop suggesting draw as a built-in opener for images

Images now map to viewer alone. An app named draw is suggested for an
image only when it registers the extension, like any other app.
This commit is contained in:
Nariman Jelveh committed 2026-11-17 14:59:45 -07:00
1 parent 25ba1de867
commit 7d046acdb9
2 files changed
+12 -1

No files matched your search

@@ -371,6 +371,17 @@ describe('SuggestedAppsService hosted-backing guard', () => {
expect(names).toContain(name);
});
it('offers viewer as the only built-in opener for images', async () => {
// An app named `draw` opens images only if it registers the
// extension like any other app.
const { userId } = await makeUser();
await pointBuiltinAt('viewer', userId, 'https://viewer.example.com/');
await pointBuiltinAt('draw', userId, 'https://draw.example.com/');
const names = (await suggestFor('tiff')).map((a) => a.name);
expect(names).toEqual(['viewer']);
});
it('does not hit the subdomain store for non-hosted index_urls', async () => {
// Built-ins and apps on a developer's own domain aren't on a
// hosting domain, so the guard short-circuits on the URL alone.
@@ -160,7 +160,7 @@ function suggestionsForExtension(ext: string): {
return { names: ['editor', 'code'], isFallback: false };
}
if (IMAGE_EXTS.has(lower)) {
return { names: ['viewer', 'draw'], isFallback: false };
return { names: ['viewer'], isFallback: false };
}
if (lower === 'pdf') return { names: ['pdf'], isFallback: false };
if (MEDIA_EXTS.has(lower)) return { names: ['player'], isFallback: false };