atproto explorer pdsls.dev
atproto tool

add handling of app links on search #8

merged
opened by aylac.top targeting main from aylac.top/pdsls: apphandling

adds handling of links for some (the same that are in the templates.ts file) atproto apps

it lets you paste links like https://tangled.org/@pdsls.dev/pdsls and it will convert it to the at:// link

unfortunately doesn't work with links that don't provide all the necessary information to get the record (like the links for issues on tangled)

if it detects a link on the search it will try seeing if it has an app that matches it and then runs a function to handle it

it uses an enum for the apps thing because i thought it would look cool, but can easily be replaced with strings if that's preferred

really hope i didn't mess anything up

0
by aylac.top 2 comments
expand 1 commit
add handling of app links

at:// inputs don't work (yes i know this is annoying, a lot of different input types to handle)

sign up or login to add to the discussion
1
by aylac.top 2 comments
expand 2 commits
add handling of app links
fix at:// links support oops

looks fine so i'll merge

just some tips:

  • enums dont need to be initialized if it's just gonna be a sequence of integers
  • instead of const app = appList[host as keyof typeof appList] you can directly use the AppUrl type: const app = appList[host as AppUrl]
  • idk about declaring types for the Record objects, i kinda like not abstracting away too much

the logic inside the appHandleLink looks fine, maybe some of the if chains could be made more generic but it's not a problem at this scale

thanks

yw!! on const app = appList[host as keyof typeof appList] i was going to just do as appurl but the autocomplete told offered me that and i thought ok whatever

pull request successfully merged
sign up or login to add to the discussion
Labels

None yet.

assignee

None yet.

Participants 2
AT URI
at://did:plc:3c6vkaq7xf5kz3va3muptjh5/sh.tangled.repo.pull/3m2crc5gghu22