mirror of
https://github.com/HeyPuter/puter.git
synced 2026-08-24 15:07:17 +00:00
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:
@@ -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 };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user