Skip to content

Commit 47a2ad0

Browse files
committed
feat(ux): improve push to community feedback and filter low-quality configs
- Add detailed tooltip on disabled "Push to Community" button showing specific missing requirements - Filter @openboot/default config from Explore page (still accessible via direct URL and user profile)
1 parent 3c942bd commit 47a2ad0

File tree

2 files changed

+39
-4
lines changed

2 files changed

+39
-4
lines changed

src/routes/api/configs/public/+server.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ export const GET: RequestHandler = async ({ platform, url }) => {
1313
let orderClause: string;
1414
let whereClause = `c.visibility = 'public'`;
1515

16+
if (!username) {
17+
whereClause += ` AND NOT (u.username = 'openboot' AND c.slug = 'default')`;
18+
}
19+
1620
if (sort === 'featured') {
1721
orderClause = 'c.featured DESC, c.install_count DESC, c.updated_at DESC';
1822
} else if (sort === 'installs') {

src/routes/dashboard/+page.svelte

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,31 @@
521521
return packageCount >= 5 && hasValidName && hasValidDescription;
522522
}
523523
524+
function getPushToCommunityTooltip(config: Config): string {
525+
const packages = Array.isArray(config.packages) ? config.packages : [];
526+
const packageCount = packages.length;
527+
const hasValidName = config.name !== 'Default';
528+
const hasValidDescription = !!config.description && config.description !== '' && config.description !== 'My default configuration';
529+
530+
const missing: string[] = [];
531+
532+
if (packageCount < 5) {
533+
missing.push(`At least 5 packages required (current: ${packageCount})`);
534+
}
535+
if (!hasValidName) {
536+
missing.push('Custom name required (cannot be "Default")');
537+
}
538+
if (!hasValidDescription) {
539+
missing.push('Description required');
540+
}
541+
542+
if (missing.length === 0) {
543+
return 'Push to Community';
544+
}
545+
546+
return 'Cannot push to community:\n' + missing.map(m => '' + m).join('\n');
547+
}
548+
524549
async function pushToCommunity(config: Config) {
525550
if (!canPushToCommunity(config)) {
526551
alert('Your configuration needs at least 5 packages, a custom name, and a description to be shared with the community.');
@@ -623,12 +648,13 @@
623648
{:else}
624649
<button
625650
class="push-to-community-disabled"
626-
title="Add at least 5 packages, a custom name, and a description to share with the community"
627651
disabled
628652
>
629-
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
630-
<circle cx="12" cy="12" r="10"/><line x1="12" y1="8" x2="12" y2="12"/><line x1="12" y1="16" x2="12.01" y2="16"/>
631-
</svg>
653+
<span class="icon-wrapper" title={getPushToCommunityTooltip(config)}>
654+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
655+
<circle cx="12" cy="12" r="10"/><line x1="12" y1="8" x2="12" y2="12"/><line x1="12" y1="16" x2="12.01" y2="16"/>
656+
</svg>
657+
</span>
632658
Push to Community
633659
</button>
634660
{/if}
@@ -1126,6 +1152,11 @@
11261152
flex-shrink: 0;
11271153
}
11281154
1155+
.push-to-community-disabled .icon-wrapper {
1156+
display: inline-flex;
1157+
cursor: help;
1158+
}
1159+
11291160
.modal-overlay {
11301161
position: fixed;
11311162
inset: 0;

0 commit comments

Comments
 (0)