Highly ambitious ATProtocol AppView service and sdks
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

add external collections input to sync page

Chad Miller 0ed4b660 72440bdc

+37 -5
+24 -3
frontend/src/pages/SliceSyncPage.tsx
··· 66 66 67 67 <div> 68 68 <label className="block text-sm font-medium text-gray-700 mb-2"> 69 + External Collections (Optional) 70 + </label> 71 + <textarea 72 + id="external_collections" 73 + name="external_collections" 74 + rows={4} 75 + className="block w-full border border-gray-300 rounded-md px-3 py-2" 76 + placeholder="Add external collections not in your slice lexicons: 77 + 78 + app.bsky.feed.post 79 + app.bsky.actor.profile 80 + com.atproto.repo.strongRef" 81 + /> 82 + <p className="text-xs text-gray-500 mt-1"> 83 + These collections will be synced even if they're not defined in your slice lexicons 84 + </p> 85 + </div> 86 + 87 + <div> 88 + <label className="block text-sm font-medium text-gray-700 mb-2"> 69 89 Specific Repositories (Optional) 70 90 </label> 71 91 <textarea ··· 117 137 </h3> 118 138 <ul className="text-blue-700 space-y-1 text-sm"> 119 139 <li> 120 - • Collections from your slice lexicons are automatically loaded 140 + • Collections from your slice lexicons are automatically loaded above 121 141 </li> 122 142 <li> 123 - • You can add popular collections like{" "} 124 - <code>app.bsky.feed.post</code> 143 + • Use External Collections to sync popular collections like{" "} 144 + <code>app.bsky.feed.post</code> that aren't in your lexicons 125 145 </li> 146 + <li>• External collections bypass lexicon validation</li> 126 147 <li>• Large syncs may take several minutes to complete</li> 127 148 <li>• Leave repositories empty to sync from all available users</li> 128 149 <li>• Use the Records tab to browse synced data</li>
+13 -2
frontend/src/routes/slices.tsx
··· 691 691 try { 692 692 const formData = await req.formData(); 693 693 const collectionsText = formData.get("collections") as string; 694 + const externalCollectionsText = formData.get("external_collections") as string; 694 695 const reposText = formData.get("repos") as string; 695 696 696 697 // Parse collections from textarea (newline or comma separated) ··· 702 703 }); 703 704 } 704 705 705 - if (collections.length === 0) { 706 + // Parse external collections from textarea (newline or comma separated) 707 + const externalCollections: string[] = []; 708 + if (externalCollectionsText) { 709 + externalCollectionsText.split(/[\n,]/).forEach((item) => { 710 + const trimmed = item.trim(); 711 + if (trimmed) externalCollections.push(trimmed); 712 + }); 713 + } 714 + 715 + if (collections.length === 0 && externalCollections.length === 0) { 706 716 const html = render( 707 717 <SyncResult 708 718 success={false} 709 - error="Please specify at least one collection to sync" 719 + error="Please specify at least one collection (regular or external) to sync" 710 720 /> 711 721 ); 712 722 return new Response(html, { ··· 729 739 const sliceClient = getSliceClient(context, sliceId); 730 740 const syncJobResponse = await sliceClient.social.slices.slice.startSync({ 731 741 collections, 742 + externalCollections: externalCollections.length > 0 ? externalCollections : undefined, 732 743 repos: repos.length > 0 ? repos : undefined, 733 744 }); 734 745