30 Commits

Author SHA1 Message Date
Alessio
5d0fd63591 When returning HTTP errors, send toasts if request is HTMX 2024-08-19 14:43:28 -07:00
Alessio
24129c4852 REFACTOR: reduce technical debt, particularly that caused by singleton pattern in pkg/scraper
- ensure all scraper functions have a `api.XYZ` version and a package-level convenience function
	- isolate `the_api` to top-level convenience functions, in preparation for removal
- move a bunch of scraper functions around to be nearby their related functions
- new ErrLoginRequired
- remove obsolete APIv1 stuff (Feed, TweetDetail)
- rename scraper function GetUserFeedGraphqlFor => GetUserFeed
- fix go.mod Go version incorrectly claiming it's compatible with Go 1.16 (should be Go 1.17)
2024-08-09 19:48:50 -07:00
Alessio
c1c781af61 Implement replying in DMs 2024-07-28 17:18:30 -07:00
Alessio
b4384f9cc4 Enable sending emoji reactions in DMs 2024-07-28 14:09:41 -07:00
Alessio
98015ddf0c REFACTOR: remove DMTrove type, merge it into TweetTrove 2024-07-28 08:01:58 -07:00
Alessio
61404cf5b0 Enable manual re-scraping of chat rooms 2024-05-12 17:37:08 -07:00
Alessio
827c15431c Make messages list update every 3s 2024-05-12 17:01:14 -07:00
Alessio
f927507089 Enable marking DMs as read 2024-05-10 22:09:48 -07:00
Alessio
e12f347650 Fix lint error 2024-05-09 13:13:37 -07:00
Alessio
2a7a4e700e Remove 'dm-composer' OOB template and replace it with a simple 'hx-on:htmx:after-request' attribute 2024-05-09 13:11:05 -07:00
Alessio
73c89f70fb REFACTOR: move /messages/<id>/send handler into its own function 2024-05-08 21:59:27 -07:00
Alessio
a0a32d0fb8 Fix another lint error 2024-05-05 11:25:00 -07:00
Alessio
5d727487ba Fix lint error 2024-05-05 11:23:06 -07:00
Alessio
71230e3886 Fix 3 bugs in DMs
- escape HTML entities in messages so "<" doesn't scrape as "&lt;"
- escape quotes in sent messages, so they no longer fail to send
- fix the web UI receiving the last 50 messages after every sent message instead of just the new ones
2024-05-05 10:58:39 -07:00
Alessio
af3e496468 Add pagination to DM conversation and scrolling back using 'show more' button 2024-05-04 15:44:17 -07:00
Alessio
4d6407492a REFACTOR: split Messages handler into functions; add 'is_htmx' helper function 2024-05-04 15:14:51 -07:00
Alessio
0196cb681b Improve DM chat list previews
- add "unread" indicators
- message preview should now always say something, e.g., "So-and-so sent a Tweet" instead of being empty
2024-04-27 23:10:07 -07:00
b146cd9bb5 Make scrolling a lot better in DMs 2024-02-23 18:08:55 -08:00
1317d44b52 BUGFIX: fix focused tweets being clickable 2024-02-18 15:23:16 -08:00
84ff6c12b7 Change all timestamps to use milliseconds instead of seconds 2024-01-07 15:15:43 -06:00
24364a26b0 REFACTOR: rework the rendering helpers
- rendering helpers moved to their own file (separate from response helpers)
- create a unified render helper instead of "buffered_render_basic_X" and "buffered_render_tweet_X"
	- this helper takes 2 data objects: one with global data (tweet trove, logged in user, etc) and one page-specific
	- this lets us remove the disgusting interface type
- modify the User List template to use UserIDs indexing into a global data object instead of a list of Users
2023-12-31 15:56:12 -06:00
482238abe0 Poll for DM updates every 3s instead of 7s; fix scrolling on new DMs sent and received; clear composer box after sending message 2023-12-24 21:53:03 -06:00
db692e747a Fix lint error, add test for empty polling result 2023-12-24 19:43:00 -06:00
bd90b1c528 Add polling for new messages in a chat room while on the page 2023-12-24 19:28:15 -06:00
e1bc6bba98 Enable sending DM messages 2023-12-24 14:21:57 -06:00
3ba8e3ef70 Restrict access to routes when not logged in (i.e., no active session) 2023-12-24 14:09:46 -06:00
c471ae3c65 Fix lint error 2023-11-19 20:52:54 -08:00
b73ee1f5d2 Add support for group DMs; also make UI highlight which chat is currently active 2023-11-19 20:37:22 -08:00
6e9a370073 Various improvements to Messages UI
- Chat list previews look a bit nicer, and display the time of last message
- Chat messages show sent_at time
- Messages with line breaks will actually display as paragraphs now
- Misc spacing improvements
- BUGFIX: fix preview DB query crashing if there's no messages in a chat
2023-11-19 15:31:59 -08:00
f67fc443f6 Add Messages page 2023-11-14 11:12:23 -08:00