Skip to content

feat: add trending forum discussions to home and refine mobile blog card - #322

Merged
trtajim merged 2 commits into
mainfrom
feat/home-trending-forum-and-blog-card
Sep 5, 2026
Merged

feat: add trending forum discussions to home and refine mobile blog card#322
trtajim merged 2 commits into
mainfrom
feat/home-trending-forum-and-blog-card

Conversation

@trtajim

@trtajim trtajim commented Sep 5, 2026

Copy link
Copy Markdown
Member

Summary

  • Mobile Blog Card: Refactored BlogCard.vue to use a compact side-by-side row on mobile and responsive vertical card on desktop, displaying view counts, upvotes, comments, author, and relative timestamp.
  • Trending Forum Section on Home: Added 4 trending approved discussions unified across curricula to Home.vue in a 2-column grid.
  • Reusable Forum Post Card: Extracted ForumPostCard.vue from Forum/Index.vue for reuse across the platform.
  • Backend & Caching: Added home_page_trending_posts cached query (2h TTL) in SubjectController.php and cache clearing in CacheHelper.php.

Verification

  • Automated linting and formatting passed (npm run format && composer lint && npm run lint).

Summary by CodeRabbit

  • New Features

    • Added a “Trending Discussions” section to the home page, showing up to four popular forum questions with links to visit the forum.
    • Introduced richer forum question cards with voting controls, topic badges, previews, answer counts, author details, timestamps, and image indicators.
    • Added trending forum discussions to the home page based on popularity and recency.
  • Enhancements

    • Improved blog cards with excerpts, relative publication times, view counts, refined styling, and responsive layouts.
    • Standardized forum post presentation across the forum page and home page.

@coderabbitai

coderabbitai Bot commented Sep 5, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 095f8a96-2870-44f3-bc44-62bc77e41f26

📥 Commits

Reviewing files that changed from the base of the PR and between af5af62 and 5c43475.

📒 Files selected for processing (6)
  • app/Helpers/CacheHelper.php
  • app/Http/Controllers/SubjectController.php
  • resources/js/components/BlogCard.vue
  • resources/js/components/forum/ForumPostCard.vue
  • resources/js/pages/Forum/Index.vue
  • resources/js/pages/Home.vue

📝 Walkthrough

Walkthrough

The change adds cached trending forum posts to the home page, introduces a reusable forum post card, replaces inline forum rendering, and updates blog card typing, metadata, fallbacks, and styling.

Changes

Forum Trending Discussions

Layer / File(s) Summary
Trending post query and cache invalidation
app/Http/Controllers/SubjectController.php, app/Helpers/CacheHelper.php
The home page loads up to four approved forum posts from a two-hour cache. Cache clearing now also removes the trending-post cache key.
Shared forum post card
resources/js/components/forum/ForumPostCard.vue
The new component renders voting, post badges, question content, author metadata, relative time, and answer counts.
Forum page card integration
resources/js/pages/Forum/Index.vue
The forum page replaces inline post markup with ForumPostCard instances and removes obsolete helpers and imports.
Home trending discussions section
resources/js/pages/Home.vue
The Home page renders trending posts through ForumPostCard and adds desktop and mobile links to /forum.

Blog Card Presentation

Layer / File(s) Summary
Typed blog card presentation
resources/js/components/BlogCard.vue
BlogCard uses typed props, conditional excerpts and views, relative author time, a BookOpen image fallback, and revised card styling.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant SubjectController
  participant Cache
  participant ForumPost
  participant Home
  participant ForumPostCard
  SubjectController->>Cache: Read home_page_trending_posts
  Cache->>ForumPost: Query approved posts
  ForumPost-->>Cache: Return up to 4 ordered posts
  Cache-->>SubjectController: Return trending_posts
  SubjectController->>Home: Render trending_posts
  Home->>ForumPostCard: Render each trending post
Loading
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/home-trending-forum-and-blog-card

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@trtajim
trtajim merged commit cd4dd94 into main Sep 5, 2026
5 of 6 checks passed
@trtajim
trtajim deleted the feat/home-trending-forum-and-blog-card branch September 5, 2026 17: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