Skip to content

Conversation

@AllanKoder
Copy link
Owner

No description provided.

AllanKoder and others added 2 commits December 30, 2025 16:00
* changes

* Apply automatic changes

* Update app/Http/Controllers/ResourceEditsController.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings December 30, 2025 23:01
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request refactors the news section to display trending resources instead of news posts. The changes repurpose existing UI components to show hot/trending resources based on vote scores rather than displaying news items.

Key Changes:

  • Replaced news_posts data with hot_resources throughout the frontend and backend
  • Updated UI text and icons from "Latest News" to "Trending Resources"
  • Modified the backend service to fetch trending resources using the 'hot' sorting algorithm instead of NewsPost records

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
resources/js/Pages/Resources/Index.vue Updated prop from news_posts to hot_resources and passed it to NewsSection component
resources/js/Components/NewsItem.vue Converted component to display resource data (name, image, description, upvotes) instead of news data
resources/js/Components/News/NewsSection.vue Updated props and labels to handle hotResources and display "Trending Resources" instead of "Latest News"
resources/js/Components/News/NewsDialog.vue Updated prop from newsItems to resourceItems for consistency
app/Services/ComputerScienceResourceService.php Replaced NewsPost query with hot resources query using ResourceSortingManager, updated return data structure

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 1 to 41
<script setup>
import { Link } from '@inertiajs/vue3';

defineProps({
news: {
resource: {
type: Object,
required: true,
},
});
</script>

<template>
<div class="my-4">
<h3 class="font-bold mb-2 text-lg">
{{ news.title }}
</h3>
<Link :href="route('resources.show', { slug: resource.slug }) || '#'" target="_blank" rel="noopener noreferrer">
<div class="my-4 border hover:bg-gray-50 dark:hover:bg-gray-700 p-2 rounded-sm transition-colors cursor-pointer">
<div class="flex items-center gap-2 text-xs text-gray-500 dark:text-gray-400 mb-1">
<span v-if="resource.upvotes_count || resource.vote_score" class="flex items-center gap-1">
<svg class="w-4 h-4 text-orange-500" fill="currentColor" viewBox="0 0 20 20">
<path d="M2 10.5a1.5 1.5 0 113 0v6a1.5 1.5 0 01-3 0v-6zM6 10.333v5.43a2 2 0 001.106 1.79l.05.025A4 4 0 008.943 18h5.416a2 2 0 001.962-1.608l1.2-6A2 2 0 0015.56 8H12V4a2 2 0 00-2-2 1 1 0 00-1 1v.667a4 4 0 01-.8 2.4L6.8 7.933a4 4 0 00-.8 2.4z" />
</svg>
{{ resource.upvotes_count || resource.vote_score }}
</span>
</div>

<h3 class="font-bold mb-2 text-md dark:text-white line-clamp-2">
{{ resource.name }}
</h3>

<img
v-if="resource.image_url "
:src="resource.image_url"
:alt="resource.name"
class="w-full h-32 object-cover rounded mb-2"
/>

<img
v-if="news.thumbnail_url"
:src="news.thumbnail_url"
:alt="news.title"
class="w-full h-48 object-cover rounded mb-2"
/>
<p class="text-sm text-gray-600 dark:text-gray-300 line-clamp-3 mb-2">
{{ resource.excerpt || resource.description }}
</p>

<p class="text-sm text-gray-600">
{{ news.excerpt }}
</p>
</div>
</div>
</Link>
</template>
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

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

The component file is still named 'NewsItem.vue' but it now displays resource items instead of news items. Consider renaming this component to 'ResourceItem.vue' or 'TrendingResourceItem.vue' to better reflect its current purpose and improve code maintainability.

Copilot uses AI. Check for mistakes.
Copy link
Owner Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

AllanKoder and others added 2 commits December 30, 2025 16:18
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI commented Dec 30, 2025

@AllanKoder I've opened a new pull request, #61, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Contributor

Copilot AI commented Dec 30, 2025

@AllanKoder I've opened a new pull request, #62, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Contributor

Copilot AI commented Dec 30, 2025

@AllanKoder I've opened a new pull request, #63, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 4 commits December 30, 2025 16:48
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
* Initial plan

* Rename NewsItem.vue to TrendingResourceItem.vue and update all references

Co-authored-by: AllanKoder <74692833+AllanKoder@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: AllanKoder <74692833+AllanKoder@users.noreply.github.com>
@AllanKoder AllanKoder merged commit d2a0719 into master Dec 30, 2025
3 checks passed
@AllanKoder AllanKoder deleted the news-temp-trending branch December 30, 2025 23:57
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.

2 participants