-
Notifications
You must be signed in to change notification settings - Fork 347
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
Add to SGF Library Directly From Game #2364
Add to SGF Library Directly From Game #2364
Conversation
@JoshuaNascimento Can you PM me on OGS (site or forum) and we'll set about helping. |
Uffizzi Ephemeral Environment
|
@GreenAsJade did so via site PM! |
…15 error previously occuring
…re-existing SGF Library
…ithin their sgf library
I think with my latest commit I have a majority of the feature complete. Ill implement some sort of feedback mechanic so users know if their submission to add to library and/or create a library was successful. But asides from that and final styling it should be good enough to play around with and get feedback from yall. |
0491f2d
to
5b426dc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice start! It seems functional, we need to work on the aesthetics a bit though. Here's what I'm seeing:
When there are no collections:
When there are a few collections:
I think we need to make this experience more consistent and scalable, as some folks have a lot of collections, and except for the case when you have no collections, there's no way to create a new collection here. There's also no indication whether a collection is private or not.
Two possibilities come to my mind, one would be to have a drop down to select your collection along with a way to add a new collection/sub-collection. The other would be to mirror what we have in the SGF library so it's a more consistent experience, something like:
For that I suspect you could rip out a lot of the code in the SGF library and make it a component that you then load in this modal kind of thing, and have a callback to save the SGF.
@@ -311,6 +312,18 @@ export function GameDock({ | |||
? engine.playerToMove() | |||
: engine.playerNotToMove(); | |||
|
|||
const showLibraryModal = () => { | |||
// Pull user data prior to opening modal preventing component from rendering prior to obtaining needed data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to open the modal and show a Loading indicator, you can probably just drop in <Loading />
while you wait for the data, that way people know their action has been registered and they just need to be patient while we wait for the internet.
This pull request has been marked stale and will be closed soon without further activity. Please update the PR or respond to this comment if you're still interested in working on this. |
This pull request has been automatically closed due to inactivity. Please feel free to re-open it if you still want to work on it. |
@anoek @JoshuaNascimento you guys mind if I picked this up where it's currently left off? |
Sure |
Summery of Issue and Implementation
There is a feature request to add an in game option to save the given game to a user's SGF Library #2210.
I wish to attempt this issue and have begun implementing a very rough Modal and Tooltip component to allow for this request.
However, it seems I've run into 2 issues while working with this.
Firstly, It seems from looking through other post requests made in the code. The only way to add a file to library is to make a post to
me/games/sgf/%%
. With the additional parameters ofcollection_id
and aSGF file
. But the only way to obtain the SGF file without the user having to manually download then upload it themselves is to access theapi1('games/${game_id}/sgf')
endpoint directly. This doesn't seem like a major issue, we would simply use api1 to receive the file at the endpoint and use that to then make the post call to have the same file added to the user's library.Unfortunately I run into my second issue being that the api1 endpoint does not work in the development environment (or at least not for me). So I'm unsure if simply calling a fetch (or get?) on it would actually result in obtaining the file, and without being able to test that myself I can't move forward with seeing if I can post the fetched file into the user's library.
I'm hoping for a bit of guidance from those more comfortable with this codebase to either confirm my current thinking and setup "should" work or if there is a simpler/better way to access the SGF file using some request I'm unaware of. From there I would make a more official PR to test the functionality and move on with my implementation from there.