diff --git a/extension/lib/__tests__/rules.test.ts b/extension/lib/__tests__/rules.test.ts index adccfa2..53d1145 100644 --- a/extension/lib/__tests__/rules.test.ts +++ b/extension/lib/__tests__/rules.test.ts @@ -150,15 +150,13 @@ describe('buildRules', () => { it('allows redirects inside the standard-site family', () => { const rules = buildRules(prefs({ autoRedirect: true, - defaults: { leaflet: { profile: 'pckt' } }, + defaults: { leaflet: { profile: 'anisotaReader' } }, })); const leafletRule = rules.find(r => r.condition.regexFilter?.includes('leaflet\\.pub') ); expect(leafletRule).toBeDefined(); - // pckt currently proxies through pdsls in its getUrl, so just assert the - // rule exists (compat filter allowed it through). - expect(leafletRule?.action.redirect?.regexSubstitution).toBeTruthy(); + expect(leafletRule?.action.redirect?.regexSubstitution).toContain('anisota.net'); }); it('family favorite for standard-site does not leak into bluesky-social sources', () => { diff --git a/src/utils/waypoints.data.ts b/src/utils/waypoints.data.ts index 1a79ee2..a0c6de6 100644 --- a/src/utils/waypoints.data.ts +++ b/src/utils/waypoints.data.ts @@ -565,13 +565,18 @@ export const WAYPOINT_DESTINATIONS_DATA: Record = { offprint: { id: 'offprint', name: 'Offprint', - description: 'View on offprint.app', + description: (collection) => { + if (collection?.startsWith('site.standard.') || collection?.startsWith('pub.leaflet.')) { + return 'Read document on offprint.app'; + } + return 'View on offprint.app'; + }, getUrl: (handle, collection, rkey, did) => { + // offprint only has record-level URLs; without a collection+rkey there's + // no meaningful destination, so hide the waypoint in profile-only views. + if (!collection || !rkey) return null; const identifier = did || handle; - if (collection && rkey) { - return `https://pdsls.dev/at://${identifier}/${collection}/${rkey}`; - } - return `https://pdsls.dev/at://${identifier}`; + return `https://offprint.app/${identifier}/${collection}/${rkey}`; }, supportedTypes: ['post', 'profile', 'list', 'record'], category: 'publications', @@ -581,13 +586,18 @@ export const WAYPOINT_DESTINATIONS_DATA: Record = { pckt: { id: 'pckt', name: 'pckt', - description: 'View on pckt.blog', + description: (collection) => { + if (collection?.startsWith('site.standard.') || collection?.startsWith('pub.leaflet.')) { + return 'Read document on pckt.blog'; + } + return 'View on pckt.blog'; + }, getUrl: (handle, collection, rkey, did) => { + // pckt only has record-level URLs; without a collection+rkey there's no + // meaningful destination, so hide the waypoint in profile-only views. + if (!collection || !rkey) return null; const identifier = did || handle; - if (collection && rkey) { - return `https://pdsls.dev/at://${identifier}/${collection}/${rkey}`; - } - return `https://pdsls.dev/at://${identifier}`; + return `https://pckt.blog/${identifier}/${collection}/${rkey}`; }, supportedTypes: ['post', 'profile', 'list', 'record'], category: 'publications',