Skip to content

[feature] Add support of Preview Cards #3969

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

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

kaimanhub
Copy link

Description

Purpose of the code change is to add support of Preview Cards for status with links.

closes #1345

Checklist

  • I/we have read the GoToSocial contribution guidelines.
  • I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
  • I/we have not leveraged AI to create the proposed changes.
  • I/we have performed a self-review of added code.
  • I/we have written code that is legible and maintainable by others.
  • I/we have commented the added code, particularly in hard-to-understand areas.
  • I/we have made any necessary changes to documentation.
  • I/we have added tests that cover new code.
  • I/we have run tests and they pass locally with the changes.
  • I/we have run go fmt ./... and golangci-lint run.

@kaimanhub kaimanhub changed the title Add support of Preview Cards [feature] Add support of Preview Cards Apr 5, 2025
@kaimanhub kaimanhub force-pushed the add-preview-cards branch from 882c5ef to f58b8b2 Compare April 5, 2025 12:59
@tsmethurst
Copy link
Contributor

Hiya, thanks for opening! Will get to reviewing this properly when time permits, but one thing I immediately see when taking a quick look through the code is that you're using go's http standard library to do HTTP calls. Instead of doing this, you should use our transportcontroller to fetch an http client that you can then use to make the call. That client uses our custom http client logic, including range limiting and some other tweaks (proper user-agent, etc).

@kaimanhub kaimanhub force-pushed the add-preview-cards branch 2 times, most recently from cb3cd44 to f8e461a Compare April 8, 2025 16:58
@kaimanhub kaimanhub force-pushed the add-preview-cards branch from f8e461a to c42c391 Compare April 8, 2025 17:03
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.

[feature] OpenGraph for URLs in Posts (show preview of links)
2 participants