Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modnotes support #566

Merged
merged 35 commits into from
Aug 18, 2022
Merged

Modnotes support #566

merged 35 commits into from
Aug 18, 2022

Conversation

eritbh
Copy link
Member

@eritbh eritbh commented Apr 11, 2022

Fixes #565

@eritbh eritbh added the enhancement New feature or request label Apr 11, 2022
@creesch
Copy link
Member

creesch commented May 22, 2022

Had some quick looks arround and the basis looks good. A few things I noticed (you probably also know or saw):

  • I can't create notes yet for users that have none, clicking the NN button (Typo btw?) yields an error in the background.
  • The notes endpoint returns a bunch more information for each "note" and mod action. It appears that for removals and such on a user it includes the thing ID. It might be a nice idea to link to those items.
  • Lot's of API requests. I assume caching is a TODO? I did have a brief look at the finalized API and the batch option might be useful.

@eritbh
Copy link
Member Author

eritbh commented May 22, 2022

"NN" has just been there since before we talked about what to make it, can change later. Yeah, handling notes for users that don't already have any (and also proper handling and display of errors) is TODO.

The only bit of info I don't integrate yet is the thing IDs, everything else should be accounted for. I've put off dealing with thing IDs because I want to be able to link to them, but we can get comment IDs without any information about their post ID which makes it impossible to link to the comment without first making an API requests to find out its post ID, then building the /comments/postid/-/commentid URI. If you have a better strategy for that, or if I've missed any other data we could be displaying, let me know.

Caching is a giant TODO at the moment, yes. I put a comment in there somewhere about using the batch API but haven't had a chance to look at it just yet. That will probably be the next thing I work on after implementing note label selection when creating new notes.

@creesch
Copy link
Member

creesch commented May 22, 2022

without first making an API requests to find out its post ID, then building the /comments/postid/-/commentid URI. If you have a better strategy for that

Nah that works for me, it is just when opening the popup. To not delay building of the popup we could explore doing this as an async call where we first build the popup and leave out links where we don't have enough information. Then fire of the api calls to fetch that information and update those entries in the popup once the call is finished.

We could possibly keep a cache of that as well if we want to.

@creesch creesch marked this pull request as ready for review August 18, 2022 20:45
@eritbh eritbh added this to the v6.0 milestone Aug 18, 2022
@creesch creesch merged commit 3a624ea into master Aug 18, 2022
@creesch creesch deleted the feat/modnotes branch August 18, 2022 20:46
eritbh added a commit that referenced this pull request Sep 5, 2024
* Add TBApi function for fetching mod notes

* Add subreddit IDs to oldreddit jsAPI shim events

* Add TBApi helper for fetching subreddit info

* Basic new modnotes module

* that's not how you jQuery...

* properly provide user/author IDs to shim events

* Rework for new fullname-less notes API

* Remove ID handling from old reddit jsAPI shim

* Display latest mod note in badge

* Fetch more notes at once

* Allow fetching more notes for pagination later

* Add doc comment to TBApi.getModNotes

* Add coloring, note count indicator

* Pass less to badge functions; cleanup

* Doc comment updates

* Basic popup code

* fix rebase issue

* more rebase fixing

* fix dumb logging errors

erin you literally wrote this API why are you still using `self`

* basics of notes table

* comment/doc updates

* big scary HTML strings to make it look nice

* make more text human-friendly

* Add some basic styles

* remove unneeded debug output

* restructure note table stuff into its own function

* hey look now we can create notes

* wow look at that now you can delete things too

* get my todos in order

* thank you eslint i am dumb

* Add TBApi method for bulk fetching recent notes

* Add + use helper for getting latest notes in bulk

* Remove note counts from updateModNotesBadge

We can't get them from the bulk API so we're just not gonna show them

* Remove resolved TODO

* set beta flag because we're merging this soon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Reddit-native mod notes
2 participants