From ba98f01530e5d3782cc975f3f42f73ba3c5b6b3c Mon Sep 17 00:00:00 2001 From: Paulo Castellano Date: Tue, 2 Jun 2026 09:12:14 -0300 Subject: [PATCH] Fix calendar showing 'no content' for every post MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The calendar read each post's caption from post_platforms[0].content, but post_platforms has no content column — the caption lives on posts.content. As a result every cell fell back to the 'no content' placeholder. Read post.content instead (matching the list view) and drop the phantom content field from the PostPlatform interface. Also surface the caption in the month view (it previously showed only the time and platform icons), add horizontal padding to the month post list so the card border is not clipped inside the overflow-y scroll container, and standardise the hover effect across day/week/month views to a shadow-only highlight (no lift). Closes #70 --- resources/js/pages/posts/Calendar.vue | 19 ++++++++++++------- tests/Feature/PostControllerTest.php | 21 +++++++++++++++++++++ 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/resources/js/pages/posts/Calendar.vue b/resources/js/pages/posts/Calendar.vue index 1d93b385..e68e8f6b 100644 --- a/resources/js/pages/posts/Calendar.vue +++ b/resources/js/pages/posts/Calendar.vue @@ -18,7 +18,6 @@ import { PostStatus } from '@/types/post'; interface PostPlatform { id: string; platform: string; - content: string; status: string; social_account: { id: string; @@ -31,6 +30,7 @@ interface PostPlatform { interface Post { id: string; status: string; + content: string | null; scheduled_at: string; post_platforms: PostPlatform[]; } @@ -297,7 +297,7 @@ const formatTime = (scheduledAt: string): string => {
@@ -334,7 +334,7 @@ const formatTime = (scheduledAt: string): string => {

- {{ post.post_platforms[0]?.content || $t('calendar.no_content') }} + {{ post.content?.trim() || $t('calendar.no_content') }}

@@ -383,7 +383,7 @@ const formatTime = (scheduledAt: string): string => {
@@ -418,7 +418,7 @@ const formatTime = (scheduledAt: string): string => {

- {{ post.post_platforms[0]?.content || $t('calendar.no_content') }} + {{ post.content?.trim() || $t('calendar.no_content') }}

@@ -479,12 +479,13 @@ const formatTime = (scheduledAt: string): string => {
-
+
+
{{ formatTime(post.scheduled_at) }}
{ +{{ post.post_platforms.length - 3 }}
+
+

+ {{ post.content?.trim() || $t('calendar.no_content') }} +

startOfWeek()->addDays(2)->setTime(12, 0); + + Post::factory()->create([ + 'workspace_id' => $this->workspace->id, + 'user_id' => $this->user->id, + 'content' => 'Caption visible in the calendar', + 'status' => PostStatus::Scheduled, + 'scheduled_at' => $scheduledAt, + ]); + + $dateKey = $scheduledAt->format('Y-m-d'); + + $response = $this->actingAs($this->user)->get(route('app.calendar')); + + $response->assertOk(); + $response->assertInertia(fn ($page) => $page + ->where("posts.{$dateKey}.0.content", 'Caption visible in the calendar') + ); +}); + // Create tests test('create requires authentication', function () { $response = $this->get(route('app.posts.create'));