New day, new thread. On todays todo-list:
- get fragment links to work
- truncate post and thread ids
- clear post text area on submit
- create a seed.sql to improve local dev
Thread/post IDs are now truncated, and the post elements have gotten id attributes that make scrolling kind of work. The issue is that the div with the fragment id is not present on page load, but is loaded in afterwards. Will have to think a bit more on how to solve it, leaving it for now.
Text area should now be cleared on submit. I've also added a check to the database disallowing empty posts, as well as aborting post submission in the frontend if textarea is empty.
Only thing remaining is to create a little seed data (hello chatGPT)
After a chat with GPT-4 I now have a bunch of data available for seeding my local database. Doing so also revealed an issue with my RLS, where a user can add posts to a thread started by a different author. I also had an incorrect check in the frontend, where the textarea input was shown as long as you had a session. It's now only displayed if the logged in user is the same as the author of the thread.
RLS issue should be resolved now
made a couple more improvements:
- return a helpful message instead of exploding if you look up a thread that doesn't exist
- improve username constraints + set reasonable, semi-random username on creation
- user deletion qol improvements
I believe the solution to the scrolling-to-fragment issue is to ssr the single-thread pages. Will try it out when I get the time.
Also on the todo-list: decrease horizontal padding on small screens in order to avoid 'zooming in' when text area is selected