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

feat: simple og image #176

Merged
merged 4 commits into from
Apr 14, 2024
Merged

feat: simple og image #176

merged 4 commits into from
Apr 14, 2024

Conversation

gaboesquivel
Copy link
Member

@gaboesquivel gaboesquivel commented Apr 14, 2024

this is very first of raw version of og generation on the edge

related to #159 #140

Summary by CodeRabbit

  • New Features

    • Introduced image generation for post titles with specific styling in the og route.
    • Enhanced navigation in the footer by replacing an anchor tag with a Link component for 'terms & policies'.
    • Implemented functionality to fetch and redirect to specific threads based on threadId from search parameters on the home page.
  • Refactor

    • Updated metadata generation for threads to include comprehensive details like title, date, summary, and social sharing links.
  • Chores

    • Updated package dependencies to improve functionality and compatibility.

Copy link

vercel bot commented Apr 14, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
masterbots 🔄 Building (Inspect) Visit Preview Apr 14, 2024 4:05am

Copy link
Contributor

coderabbitai bot commented Apr 14, 2024

Walkthrough

The recent updates to the Masterbots.ai application include enhancements in metadata generation, interface improvements, and better navigation within the app. Key changes involve updating environment configurations, refining thread handling and metadata functions, and improving user interface components for better user experience.

Changes

File Path Change Summary
.../.env.local Removed NEXTAUTH_URL and updated AUTH_SECRET.
.../[category]/[threadId]/page.tsx, .../page.tsx Enhanced thread fetching and redirection. Added export alias for metadata generation function.
.../og/route.tsx, .../lib/metadata.ts Added image generation for posts and metadata formatting for threads.
.../footer-ct.tsx Improved navigation by using Link component for internal routing.
.../c/chat-input-new.tsx Simplified ChatInputProps by removing showSubmitButton.
.../lib/threads.ts Modified getThreadLink function to make chat parameter optional.
.../package.json Updated dependency @vercel/og to version 0.6.2.

🐰✨🥕
In the burrow of code, where the digital seeds grow,
A rabbit hops lightly, with updates in tow.
Links like carrots, metadata sprouts,
Each line of code, a route it touts.
Hop, hop, hop, on soft digital paws,
Crafting the web with barely a pause!
🌟🐾


Recent Review Details

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between b8df4fb and b97f129.
Files ignored due to path filters (1)
  • bun.lockb is excluded by !bun.lockb
Files selected for processing (9)
  • apps/masterbots.ai/.env.local (1 hunks)
  • apps/masterbots.ai/app/(browse)/[category]/[threadId]/page.tsx (1 hunks)
  • apps/masterbots.ai/app/(browse)/page.tsx (2 hunks)
  • apps/masterbots.ai/app/og/route.tsx (1 hunks)
  • apps/masterbots.ai/components/layout/footer-ct.tsx (2 hunks)
  • apps/masterbots.ai/components/routes/c/chat-input-new.tsx (1 hunks)
  • apps/masterbots.ai/lib/metadata.ts (1 hunks)
  • apps/masterbots.ai/lib/threads.ts (1 hunks)
  • apps/masterbots.ai/package.json (1 hunks)
Files skipped from review due to trivial changes (3)
  • apps/masterbots.ai/app/(browse)/[category]/[threadId]/page.tsx
  • apps/masterbots.ai/components/routes/c/chat-input-new.tsx
  • apps/masterbots.ai/package.json
Additional comments not posted (7)
apps/masterbots.ai/.env.local (2)

8-13: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [1-10]

Ensure that the removal of NEXTAUTH_URL is handled appropriately in all deployment environments to avoid authentication issues.


8-13: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [1-10]

Update AUTH_SECRET securely across all environments to maintain consistent authentication security.

apps/masterbots.ai/components/layout/footer-ct.tsx (1)

25-37: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [1-34]

Replaced anchor tag with Link component for internal navigation. Ensure that the shallow prop is used appropriately as it affects the behavior of the router.

apps/masterbots.ai/lib/metadata.ts (1)

6-47: Function generateMbMetadata correctly fetches and formats thread data into metadata. Review the use of hardcoded URLs and ensure sensitive data is not exposed.

Verification successful

The verification process confirms the presence of hardcoded URLs in the generateMbMetadata function within the metadata.ts file. These URLs are used to construct the image and url properties of the metadata object. While hardcoded URLs can sometimes limit flexibility and adaptability, there is no direct evidence of sensitive data exposure or significant security concerns from the URLs themselves. It is recommended to review these hardcoded URLs to assess if they should be parameterized or configured externally for better flexibility and maintainability.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Check for hardcoded URLs that might need to be parameterized or secured
rg "https://alpha.masterbots.ai"

Length of output: 249

apps/masterbots.ai/app/og/route.tsx (1)

7-57: Function GET correctly sets up an OG image based on the post title. Verify the font loading mechanism to ensure GeistMono is used correctly in the image.

apps/masterbots.ai/app/(browse)/page.tsx (1)

11-14: Updated HomePage to handle redirection based on threadId. Add validation for threadId to ensure safety and correctness of redirection.

apps/masterbots.ai/lib/threads.ts (1)

85-85: Updated getThreadLink to make chat parameter optional, enhancing flexibility. Verify the usage of this updated function signature across the application.

Verification successful

The review of the getThreadLink function's usage across the application confirms that the optional chat parameter is correctly implemented and utilized. The function is used with both explicit and default values for the chat parameter in various parts of the application, adhering to the updated function signature. This ensures flexibility and correct functionality in linking threads.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify the usage of the updated `getThreadLink` function signature
rg "getThreadLink"

Length of output: 707


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@gaboesquivel gaboesquivel merged commit 9a6c866 into alpha Apr 14, 2024
3 of 4 checks passed
@gaboesquivel gaboesquivel deleted the feat-og-image branch April 14, 2024 04:05
Copy link

⚡️ Lighthouse report

Page: https://masterbots-odj3qz847-bitcash.vercel.app/
Report https://storage.googleapis.com/lighthouse-infrastructure.appspot.com/reports/1713068011466-54416.report.html

Category Score
🔴 Performance 39
🟢 Accessibility 96
🟠 Best practices 78
🟠 SEO 85
🔴 PWA 38

Page: https://masterbots-odj3qz847-bitcash.vercel.app/b/moneybot
Report https://storage.googleapis.com/lighthouse-infrastructure.appspot.com/reports/1713068011686-69974.report.html

Category Score
🟠 Performance 55
🟢 Accessibility 96
🟠 Best practices 78
🟠 SEO 85
🔴 PWA 38

Page: https://masterbots-odj3qz847-bitcash.vercel.app/u/slug-1
Report https://storage.googleapis.com/lighthouse-infrastructure.appspot.com/reports/1713068011880-86464.report.html

Category Score
🟠 Performance 59
🟢 Accessibility 94
🟠 Best practices 78
🟠 SEO 83
🔴 PWA 38

Page: https://masterbots-odj3qz847-bitcash.vercel.app/p
Report https://storage.googleapis.com/lighthouse-infrastructure.appspot.com/reports/1713068012088-19182.report.html

Category Score
🟠 Performance 59
🟢 Accessibility 92
🟠 Best practices 78
🟠 SEO 76
🔴 PWA 38

Page: https://masterbots-odj3qz847-bitcash.vercel.app/health
Report https://storage.googleapis.com/lighthouse-infrastructure.appspot.com/reports/1713068012476-21110.report.html

Category Score
🟠 Performance 58
🟠 Accessibility 59
🟠 Best practices 74
🔴 SEO 42
🔴 PWA 13

Page: https://masterbots-odj3qz847-bitcash.vercel.app/health/a8103808-14a3-48ed-aa5a-9e490cfdcf0e
Report https://storage.googleapis.com/lighthouse-infrastructure.appspot.com/reports/1713068012665-51951.report.html

Category Score
🟠 Performance 56
🟠 Accessibility 59
🟠 Best practices 74
🔴 SEO 42
🔴 PWA 13

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.

1 participant