Skip to content

fixed Project og title added in ssr #3177

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

Merged
merged 8 commits into from
Jul 9, 2024

Conversation

Rishab87
Copy link
Contributor

@Rishab87 Rishab87 commented Jun 30, 2024

Fixes #2177

Changes:
modified ssr to display og title

I have verified that this pull request:

  • has no linting errors (npm run lint)
  • has no test errors (npm run test)
  • is from a uniquely-named feature branch and is up to date with the develop branch.
  • is descriptively named and links to an issue number, i.e. Fixes #123

Copy link

welcome bot commented Jun 30, 2024

🎉 Thanks for opening this pull request! Please check out our contributing guidelines if you haven't already.

@Rishab87
Copy link
Contributor Author

Rishab87 commented Jul 4, 2024

Hi @raclim ,

I wanted to follow up on my previous comment regarding the issue #2177. It’s been a few days, and I wanted to check if there are any updates or if additional information is needed from my side.

Thanks for your time and help!

Best,
Rishab

@raclim
Copy link
Collaborator

raclim commented Jul 5, 2024

Hi @Rishab87, thanks for your work on this!

I think although the changes here do work, I would double check that the changes to the renderIndex() function are compatible with where it's called in other parts of the codebase, especially since it seems to be called several times.

I think a previously closed PR for this issue (https://github.com/processing/p5.js-web-editor/pull/2181/files#diff-b4206729ee1785504afa67759156d1d5dcaaa104c981f072f6e2538f0f2ff1d5), does create a solution for this by creating a separate function to render the index specifically for a project. One approach you could take is to reference this PR without including the portions that reformatted the files.

@Rishab87
Copy link
Contributor Author

Rishab87 commented Jul 5, 2024

Thanks for your time and help @raclim.

I have added a separate renderProjectIndex(username, projectName) function. Please do tell if I need to do anything else.

@Rishab87
Copy link
Contributor Author

Rishab87 commented Jul 8, 2024

Hi @raclim ,

I wanted to follow up on my previous commit regarding the issue #2177. It’s been a few days again , do tell if you need any additional info from my side!

Copy link
Collaborator

@raclim raclim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for much for your patience on this—sometimes it might take a moment to review PRs depending on what's happening with the project!

I went ahead with pushing some changes to this PR after noticing that some of the non-user project pages would crash on loading. It seems like this might be happening because the sendHtml() function in server/views/index.js was changed to expect an object rather than a boolean (which is how it's set up in other places where sendHtml() is called).

To keep this consistent, I changed back the function to accept a boolean and added a new getProjectForUser() method in the controller to retrieve the project's name in the /:username/sketches/:project_id route. I did this to try to ensure that these changes don't affect the rest of the app while also trying to maintain your original work as much as possible.

I think another potential change that could be added in finding a way to consolidate the renderIndex() and renderProjectIndex() functions in server/views/index.js since they're mostly doing the same thing, but I feel like it's okay to keep it for now and to refactor it later down the line!

I'm sorry that I ended up changing things around a bit—please feel free to create a new PR with any additional changes that you'd like to make here! Otherwise, thanks again for your work on this and I'm going to merge this in!

@raclim
Copy link
Collaborator

raclim commented Jul 9, 2024

Here are also some screenshots I have after testing it on Tumblr for both the user's sketch and non-sketch pages:

User's Sketch:
Screenshot 2024-07-09 at 2 31 07 PM

User's Collections List Page:
Screenshot 2024-07-09 at 2 31 27 PM

@raclim raclim merged commit cb8ac32 into processing:develop Jul 9, 2024
3 checks passed
@Rishab87
Copy link
Contributor Author

Thanks for your feedback , I'm really sorry to hear that you had to make a few changes as my code was breaking few parts of the application , I will be more careful next time while testing the application, thank you for your time and help. I'll surely try to improve this further and merge both the functions into one.

@raclim
Copy link
Collaborator

raclim commented Jul 10, 2024

No worries @Rishab87! I went ahead with implementing some of these changes to get this out since this issue's been around for a while 😅 I really appreciate you staying on top of this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve OG title for linked p5.js sketches
2 participants