Treat .md like .txt; remove markus suggestion

Merge the .md extension case into the plain-text branch so it suggests ['editor', 'code'] instead of ['markus', 'editor', 'code']. Update the related test to use 'viewer'/'png' as the built-in guard example since 'markus'/'md' no longer applies.
This commit is contained in:
jelveh
2026-08-23 21:17:28 -07:00
parent 2d787c3fdf
commit 76cea02513
2 changed files with 6 additions and 7 deletions
@@ -285,10 +285,12 @@ describe('SuggestedAppsService hosted-backing guard', () => {
const { userId } = await makeUser();
const sub = uniqueName('builtinlive');
await server.stores.subdomain.create({ userId, subdomain: sub });
// 'markus' is the first built-in opener mapped to `.md`.
await pointBuiltinAt('markus', userId, hostedUrl(sub));
// 'viewer' is the first built-in opener mapped to `.png`.
await pointBuiltinAt('viewer', userId, hostedUrl(sub));
expect((await suggestFor('md')).map((a) => a.name)).toContain('markus');
expect((await suggestFor('png')).map((a) => a.name)).toContain(
'viewer',
);
});
it('drops a built-in-name opener whose hosted backing is gone', async () => {
@@ -156,12 +156,9 @@ function suggestionsForExtension(ext: string): {
if (CODE_EXTS.has(lower)) {
return { names: ['code', 'editor'], isFallback: false };
}
if (lower === 'txt' || lower === '') {
if (lower === 'txt' || lower === 'md' || lower === '') {
return { names: ['editor', 'code'], isFallback: false };
}
if (lower === 'md') {
return { names: ['markus', 'editor', 'code'], isFallback: false };
}
if (IMAGE_EXTS.has(lower)) {
return { names: ['viewer', 'draw'], isFallback: false };
}