Skip to content

feat: add latest posts section and update navigation order for improv… - #3

Merged
roble merged 1 commit into
mainfrom
dev
Apr 20, 2026
Merged

feat: add latest posts section and update navigation order for improv…#3
roble merged 1 commit into
mainfrom
dev

Conversation

@roble

@roble roble commented Apr 20, 2026

Copy link
Copy Markdown
Contributor

This pull request introduces the display of the latest blog posts on the demo page and makes several related improvements. The main changes involve fetching and passing recent blog posts from the backend to the frontend, updating the demo page to render these posts, and adjusting navigation ordering.

Demo Page Enhancements:

  • The backend (DemoController.php) now fetches the three most recent published blog posts (with category and author) and passes them to the frontend as latestPosts when the Blog module is enabled. [1] [2]
  • The frontend (Index.vue) receives and renders the latestPosts prop via the new LatestPostsSection component, which is displayed if there are any posts. [1] [2]

Workflow and Navigation Updates:

  • The test workflow (.github/workflows/test.yml) now explicitly lists additional dependencies for the Demo module, including Blog, Billing, and others.
  • The navigation ordering for 'documentation' and 'github' links has been updated to higher values, which may affect their display order in the UI. [1] [2]

Copilot AI review requested due to automatic review settings April 20, 2026 20:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR enhances the Demo module landing page by surfacing the latest Blog posts (when the Blog module is enabled) and aligns supporting infrastructure (navigation ordering and CI dependencies) to accommodate the new cross-module integration.

Changes:

  • Fetch the 3 most recent published Blog posts (with category + author) in DemoController and pass them to the Inertia page as latestPosts.
  • Render a new LatestPostsSection on the Demo index page when latestPosts is present.
  • Update landing navigation item ordering and expand CI workflow dependencies for the Demo module.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
app/Http/Controllers/DemoController.php Adds backend query + DTO mapping for latest blog posts and exposes them to the Demo Inertia page.
resources/js/pages/Index.vue Accepts latestPosts prop and conditionally renders LatestPostsSection.
routes/navigation.php Adjusts ordering of Docs/GitHub navigation entries.
.github/workflows/test.yml Adds explicit module dependencies for the Demo module CI run.

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

Comment on lines 13 to +18
import HeroSection from './sections/HeroSection.vue';
import Testimonial from './sections/Testimonial.vue';

defineProps<{
products?: Product[];
latestPosts?: Modules.Blog.Data.PostData[];

Copilot AI Apr 20, 2026

Copy link

Choose a reason for hiding this comment

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

The latestPosts prop is typed as Modules.Blog.Data.PostData[], but this module doesn’t define that ambient Modules.* TypeScript namespace anywhere (and the existing products prop uses an explicit import). This is likely to break TS type-checking unless a global declaration is guaranteed. Prefer importing a PostData (or Post) type from the Blog module’s TS types (or add an explicit declare namespace Modules type definition that’s reliably present when Demo is built).

Suggested change
import HeroSection from './sections/HeroSection.vue';
import Testimonial from './sections/Testimonial.vue';
defineProps<{
products?: Product[];
latestPosts?: Modules.Blog.Data.PostData[];
import type { PostData } from '@modules/Blog/resources/js/types';
import HeroSection from './sections/HeroSection.vue';
import Testimonial from './sections/Testimonial.vue';
defineProps<{
products?: Product[];
latestPosts?: PostData[];

Copilot uses AI. Check for mistakes.
Comment on lines +23 to +31
if (app('modules')->isEnabled('Blog')) {
$posts = Post::published()
->with(['category', 'author'])
->orderByDesc('published_at')
->limit(3)
->get();

$data['latestPosts'] = $posts->map(fn (Post $post) => PostData::fromPost($post));
}

Copilot AI Apr 20, 2026

Copy link

Choose a reason for hiding this comment

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

New behavior fetches and renders latest posts, but there are no assertions covering this path. Consider extending the existing Playwright test (or adding a new one) to verify that when the Blog module is enabled and posts exist, the latest posts section is rendered (and that it stays hidden when there are no posts / Blog is disabled).

Copilot uses AI. Check for mistakes.
@roble
roble merged commit 1c1cf95 into main Apr 20, 2026
6 of 8 checks passed
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