amyjko / faculty

Amy's faculty webpage
Creative Commons Zero v1.0 Universal
22 stars 21 forks source link

Fixed pdf links in papers. #185

Closed karlin closed 11 months ago

karlin commented 11 months ago

Hi! I was reading more of your research on your site after being inspired by your talk "Searching for Justice in Programming Language Design", when I noticed some "pdf" links on your Publications page were scrambled. When I saw that your site is made with Svelte and its source is on GitHub, I decided to try fixing the problem myself:

It seems both title and "pdf" URLs in Paper.svelte were using a getLocalURL() function that was not reactive to filter changes in the Facets component. The title URLs were correct because they used the url reactive statement, but the "pdf" links below each paper used the function directly, and ended up with the same URLs as the original filter produced. So they were correct at first, but did not change when you selected a topic filter button above the list, so were no longer matching the shown paper.

I think there are a couple other ways this could be fixed including passing a paper object to getLocalURL(), but using a new reactive statement for the local paper URL seemed to work fine and fixed the issue. No worries if you prefer a different way!

I'm very grateful for your work! đŸ˜„

Thanks, —Karlin

amyjko commented 11 months ago

Thanks for catching this! This is a suitable fix. (I'm excited about Svelte 5, which will make these reactivity bugs impossible).