Test and Bug Fix

Oak logo

πŸ§ͺ Live Comments System Test

COβ‚‚ Emissions

Gigatonnes of carbon dioxide per year
CO2 slope: 0.384 per decade (GtCO2/year)
17.45
19.67
21.31
22.95
25.40
27.84
30.01
32.15
33.45
34.75

πŸ’¬ Comments with User Info (15 items)

  • Guest ID: 15
    Can't wait for more
    πŸ•’ 8/16/2025, 9:21:01 AM
    πŸ‘€ User ID: 2
  • Dev team ID: 14
    This was an AI driven project πŸ˜€
    πŸ•’ 8/12/2025, 2:22:17 PM
    πŸ‘€ User ID: 1
  • Dev team ID: 13
    This was an AI driven project πŸ˜€
    πŸ•’ 8/12/2025, 2:22:16 PM
    πŸ‘€ User ID: 1
  • Dev team ID: 12
    Confusing this when we have a static image of the dialog above and I tried to enter into it. Bah
    πŸ•’ 8/11/2025, 7:45:34 PM
    πŸ‘€ User ID: 1
  • Dev Team_1 ID: 11
    So working out here how to add long comments and also from a user who has posted before
    πŸ•’ 8/11/2025, 7:10:30 PM
    πŸ‘€ User ID: 5

πŸš€ Production Example: Filtered Comments

This shows how to use the LiveComments component in a real blog post:

For blog post: "amoc-the-nexus"

πŸ’¬ Comments (1)

Top Post, keep up the good work

For blog post: "ice-cores"

πŸ’¬ Comments (2)

πŸ”§ Debug Information
πŸ” Loading comments for: ice-cores
βœ… Loaded 2 comments for ice-cores
πŸ“ Sample: "Sample comment..."

Sample comment

πŸ“ Post: ice-cores | 🏷️ Type: blog | πŸ†” ID: 2

Sample after trigger

πŸ“ Post: ice-cores | 🏷️ Type: blog | πŸ†” ID: 3

πŸ“ Usage in your blog post pages:

---
// In your blog post page (e.g., src/pages/blog/[...slug].astro)
import LiveComments from "@components/LiveComments.astro";

const { slug } = Astro.params;
---

<article>
  <!-- Your blog content here -->
  <h1>My Blog Post</h1>
  <p>Content...</p>
  
  <!-- Comments section -->
  <LiveComments 
    postSlug={slug} 
    postType="blog" 
    maxComments={10}
    showDebug={false}
  />
</article>

πŸš€ Production Component Demo

This shows how the PostComments component works in a real blog post scenario:

πŸ“„ Blog Post: "AMOC The Nexus"

πŸ’¬ Comments

0 comments

πŸ’­ No comments yet. Be the first to share your thoughts!

πŸ“„ Blog Post: "Ice Cores"

πŸ’¬ Comments

0 comments

πŸ’­ No comments yet. Be the first to share your thoughts!

πŸ—οΈ Architecture Note:

Both components above use the same live collection containing ALL comments, but each filters and displays only the comments for its specific post. This ensures:

  • The live collection grows as new comments are added anywhere
  • Navigation between posts is instant (no new database queries)
  • Real-time updates work across all posts
  • Efficient use of memory and database connections

My posts

Wolf
Wolf
Hot air balloon
Breakfast food
Chair with coffee table and plant
Coffee equipment on a table