Skip to content

Conversation

@grv-saini-20
Copy link
Collaborator

@grv-saini-20 grv-saini-20 commented Jan 15, 2026

Description of change

-Fixed the like button it was not reflecting state in UI but working perfectly in api call.
image

-Removed the comment button because that commenting task is fulfilled with text input.
-Fixed Comments, comments are also working now.

Issue Number

closes #671
closes #672

Type of change

  • Update (a change which updates existing functionality)
  • Fix (a change which fixes an issue)

How the change has been tested

Manual

Change checklist

  • I have ensured that the CI Checks pass locally
  • I have removed any unnecessary logic
  • My code is well documented
  • I have signed my commits
  • My code follows the pattern of the application
  • I have self reviewed my code

Summary by CodeRabbit

  • New Features

    • Animated like interactions with a subtle scale effect in posts and the post modal.
    • Comments are now loaded and passed into the post modal for integrated viewing.
  • Bug Fixes

    • Safer like toggling with validation and error handling to keep like state consistent.
    • Comment creation and comment-loading wrapped with error handling.
  • Style

    • Minor text and layout formatting adjustments.

✏️ Tip: You can customize this high-level summary in your review settings.

@grv-saini-20 grv-saini-20 self-assigned this Jan 15, 2026
@grv-saini-20 grv-saini-20 requested a review from coodos as a code owner January 15, 2026 09:33
@huly-for-github
Copy link

Connected to Huly®: METAS-541

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 15, 2026

📝 Walkthrough

Walkthrough

Adds spring-based scale animations and an async like interaction to Post and PostModal components; profile page now fetches comments when opening a post and guards/updates like state; two protected-route files received only whitespace/formatting changes.

Changes

Cohort / File(s) Summary
Layout & Group formatting
platforms/pictique/src/routes/(protected)/+layout.svelte, platforms/pictique/src/routes/(protected)/group/[id]/+page.svelte
Whitespace and line-break reflow only; no behavioral changes.
Profile page — comments & like guard
platforms/pictique/src/routes/(protected)/profile/[id]/+page.svelte
Imports comments store, defines local comment type/state, makes handlePostClick async and calls fetchComments(post.id) with error logging; computes isLiked from selectedPost, validates post id before toggling like, and updates selectedPost.value.likedBy after toggle.
Post component — like animation & interaction
platforms/pictique/src/lib/fragments/Post/Post.svelte
Adds Svelte spring (scale) and handleLikeWithInteraction to animate scale, await callback.like(), reset scale; updates Like button markup to apply animated transform and transition styles.
PostModal — like animation & UI tweaks
platforms/pictique/src/lib/fragments/PostModal/PostModal.svelte
Adds Svelte spring (scale) and handleLikeWithInteraction for mobile and desktop like buttons; wraps Like icon with transform driven by spring, adjusts icon fill behavior and adds transition/active classes; passes comments into modal from profile page.

Sequence Diagram(s)

sequenceDiagram
  actor User
  participant UI as Post / PostModal
  participant API as toggleLike / comments API
  participant Store as selectedPost / commentsStore

  User->>UI: click like (handleLikeWithInteraction)
  UI->>UI: set scale.target = 1.4 (animate)
  UI->>API: await callback.like(postId)
  API-->>UI: return updated likedBy
  UI->>Store: update selectedPost.value.likedBy
  UI->>UI: set scale.target = 1 (reset after 150ms)
  UI-->>User: updated visual state

  User->>UI: open post (handlePostClick)
  UI->>API: fetchComments(postId)
  API-->>UI: return comments
  UI->>Store: commentsStore.update / local comments set
  UI-->>User: comments displayed
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • fix: avatars #226 — Modifies the same Post/PostModal fragments and touches comments store; likely closely related.

Suggested reviewers

  • coodos
  • sosweetham
  • ananyayaya129

Poem

🐰
I hop and press the heart that springs,
a tiny bounce the UI sings.
I wait the call and softly land,
the like returns to gentle hand.
Carrots clapped — a joyous band! 🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Out of Scope Changes check ❓ Inconclusive All changes are within scope of the linked issues; however, formatting adjustments in layout files and the profile picture aspect ratio concern from #671 appear unaddressed. Verify whether the profile picture aspect ratio issue from #671 requires a separate fix or if it's pending in another PR.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix:like-not-working' directly addresses the primary issue in this PR—fixing the non-functional like button—but lacks clarity in formatting and is somewhat vague without context.
Description check ✅ Passed The PR description covers all required template sections: issue numbers (#671, #672), type of change (Update/Fix), testing method (Manual), and a completed checklist, though some descriptions could be more detailed.
Linked Issues check ✅ Passed The PR successfully addresses both linked issues: like button state now reflects in UI through spring animation, and comments functionality is restored with proper error handling and store integration.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


🧹 Recent nitpick comments
platforms/pictique/src/routes/(protected)/profile/[id]/+page.svelte (2)

13-24: Consider removing unused interface.

The Comment interface is defined but never referenced in this file. The comments are typed through $commentsStore from the store. If this interface was intended to document the comment shape, consider moving it to a shared types file or the comments store itself.

Proposed fix
-	interface Comment {
-		id: string;
-		text: string;
-		createdAt: string;
-		author: {
-			id: string;
-			handle: string;
-			name: string;
-			avatarUrl: string;
-		};
-	}
-

148-152: Consider improving type safety for likedBy.

The as any cast here and at line 159 suggests the PostData type or selectedPost doesn't include likedBy. Rather than bypassing type checking, consider extending the type definition to include this property.

// In your types file, ensure PostData includes:
interface PostData {
  // ... existing properties
  likedBy?: Array<{ id: string }>;
}

This would allow removing the as any casts and catch type errors at compile time.


📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 20267c3 and 042e9d8.

📒 Files selected for processing (1)
  • platforms/pictique/src/routes/(protected)/profile/[id]/+page.svelte
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2026-01-05T11:46:43.214Z
Learnt from: Bekiboo
Repo: MetaState-Prototype-Project/prototype PR: 653
File: platforms/pictique/src/routes/(auth)/auth/+page.svelte:173-173
Timestamp: 2026-01-05T11:46:43.214Z
Learning: In Tailwind CSS v4, gradient utilities were renamed from bg-gradient-to-{direction} to bg-linear-to-{direction}. For all Svelte components (e.g., any .svelte files in the project), replace usages like bg-gradient-to-r, bg-gradient-to-l, etc. with bg-linear-to-r, bg-linear-to-l, etc. Ensure consistency across the codebase, update any documentation or design tokens, and run visual/test checks to confirm gradients render as intended.

Applied to files:

  • platforms/pictique/src/routes/(protected)/profile/[id]/+page.svelte
🔇 Additional comments (3)
platforms/pictique/src/routes/(protected)/profile/[id]/+page.svelte (3)

6-6: LGTM!

Import correctly brings in the comments store and related functions, all of which are used in this file.


73-81: LGTM!

Good implementation: the post is set immediately for responsive UI, and comment fetching is wrapped in try/catch with appropriate error logging.


174-174: LGTM!

Correctly passes the comments store to PostModal, completing the comment display functionality.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


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 and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@platforms/pictique/src/routes/`(protected)/profile/[id]/+page.svelte:
- Around line 139-144: The like handler calls toggleLike with a potential
empty-string ID and has no error handling; guard by early-returning if
selectedPost.value?.id is missing (check selectedPost.value and its id) instead
of passing '' and wrap the await toggleLike(...) call in try/catch; on success
set (selectedPost.value as any).likedBy = result.likedBy, and on error log or
surface the error (e.g., use console.error or the existing logger) and
optionally show user feedback.
🧹 Nitpick comments (1)
platforms/pictique/src/routes/(protected)/profile/[id]/+page.svelte (1)

133-137: Consider adding proper types instead of as any casts.

The as any casts on lines 134 and 135 bypass TypeScript's type checking. If likedBy is a valid property on posts, consider extending the PostData type to include it, which would provide better type safety and IDE support.

-isLiked={ownerProfile
-	? ((selectedPost.value as any)?.likedBy?.some(
-			(user: any) => user.id === ownerProfile.id
-		) ?? false)
-	: false}
+isLiked={ownerProfile
+	? (selectedPost.value?.likedBy?.some(
+			(user) => user.id === ownerProfile.id
+		) ?? false)
+	: false}

This requires updating PostData to include likedBy: { id: string }[].

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 10d346c and 7e5fcc0.

📒 Files selected for processing (3)
  • platforms/pictique/src/routes/(protected)/+layout.svelte
  • platforms/pictique/src/routes/(protected)/group/[id]/+page.svelte
  • platforms/pictique/src/routes/(protected)/profile/[id]/+page.svelte
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2026-01-05T11:46:43.214Z
Learnt from: Bekiboo
Repo: MetaState-Prototype-Project/prototype PR: 653
File: platforms/pictique/src/routes/(auth)/auth/+page.svelte:173-173
Timestamp: 2026-01-05T11:46:43.214Z
Learning: In Tailwind CSS v4, gradient utilities were renamed from bg-gradient-to-{direction} to bg-linear-to-{direction}. For all Svelte components (e.g., any .svelte files in the project), replace usages like bg-gradient-to-r, bg-gradient-to-l, etc. with bg-linear-to-r, bg-linear-to-l, etc. Ensure consistency across the codebase, update any documentation or design tokens, and run visual/test checks to confirm gradients render as intended.

Applied to files:

  • platforms/pictique/src/routes/(protected)/profile/[id]/+page.svelte
  • platforms/pictique/src/routes/(protected)/+layout.svelte
  • platforms/pictique/src/routes/(protected)/group/[id]/+page.svelte
🔇 Additional comments (2)
platforms/pictique/src/routes/(protected)/group/[id]/+page.svelte (1)

157-166: LGTM!

Formatting-only changes with no behavioral impact. The boolean logic for isHeadNeeded and isTimestampNeeded remains functionally identical.

platforms/pictique/src/routes/(protected)/+layout.svelte (1)

200-201: LGTM!

Minor formatting adjustment with no change to the disclaimer content or behavior.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
platforms/pictique/src/lib/fragments/PostModal/PostModal.svelte (1)

209-218: Mobile like button missing animation and has a syntax error.

Two issues here:

  1. Syntax error (line 215): Missing closing parenthesis in the CSS variable: "var(--color-red-500" should be "var(--color-red-500)".

  2. Inconsistent behavior: The mobile like button uses callback.like directly instead of handleLikeWithInteraction, so it won't have the scale animation that the desktop version has. Additionally, the fill value when not liked is 'white' here but 'transparent' on desktop (line 313).

🔧 Proposed fix to add animation and fix syntax
 <button
   class="group cursor-pointer rounded-2xl bg-gray-100 px-4 py-3 transition-colors hover:bg-gray-200 active:bg-gray-300"
-  onclick={callback.like}
+  onclick={handleLikeWithInteraction}
 >
-  <Like
-    size="24px"
-    color="var(--color-red-500"
-    fill={isLiked ? 'var(--color-red-500)' : 'white'}
-  />
+  <div
+    style="transform: scale({scale.current}); display: flex; align-items: center; justify-content: center;"
+  >
+    <Like
+      size="24px"
+      color={'var(--color-red-500)'}
+      fill={isLiked ? 'var(--color-red-500)' : 'transparent'}
+      class="transition-all duration-300"
+    />
+  </div>
 </button>
🤖 Fix all issues with AI agents
In `@platforms/pictique/src/lib/fragments/PostModal/PostModal.svelte`:
- Around line 125-129: In handleLikeWithInteraction, callback.like() returns a
Promise but is not awaited; change the function to await callback.like() and
wrap it in try/catch so any rejection is handled, and move the scale.target = 1
reset into a finally block (or after the await) so the animation resets only
after the like operation completes (use handleLikeWithInteraction and
callback.like and scale.target to locate changes).
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8071f71 and 3ab6d87.

📒 Files selected for processing (2)
  • platforms/pictique/src/lib/fragments/Post/Post.svelte
  • platforms/pictique/src/lib/fragments/PostModal/PostModal.svelte
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2026-01-05T11:46:43.214Z
Learnt from: Bekiboo
Repo: MetaState-Prototype-Project/prototype PR: 653
File: platforms/pictique/src/routes/(auth)/auth/+page.svelte:173-173
Timestamp: 2026-01-05T11:46:43.214Z
Learning: In Tailwind CSS v4, gradient utilities were renamed from bg-gradient-to-{direction} to bg-linear-to-{direction}. For all Svelte components (e.g., any .svelte files in the project), replace usages like bg-gradient-to-r, bg-gradient-to-l, etc. with bg-linear-to-r, bg-linear-to-l, etc. Ensure consistency across the codebase, update any documentation or design tokens, and run visual/test checks to confirm gradients render as intended.

Applied to files:

  • platforms/pictique/src/lib/fragments/PostModal/PostModal.svelte
  • platforms/pictique/src/lib/fragments/Post/Post.svelte
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: lint
  • GitHub Check: build
🔇 Additional comments (3)
platforms/pictique/src/lib/fragments/Post/Post.svelte (2)

97-106: LGTM! Clean animation implementation.

The Spring-based scale animation provides nice visual feedback for the like interaction. The implementation is straightforward and effective.

One minor observation: the async keyword on handleLikeWithInteraction (line 102) isn't necessary since callback.like() returns void (not a Promise) and you're not using await. This is purely cosmetic and doesn't affect functionality.


186-195: Good implementation of the animated like button.

The scale transform and conditional fill provide clear visual feedback for the like state. The use of CSS custom properties for colors maintains consistency with the design system.

platforms/pictique/src/lib/fragments/PostModal/PostModal.svelte (1)

303-317: Desktop like button implementation looks good.

The scale animation and conditional fill are correctly implemented here, matching the pattern in Post.svelte. This is the expected behavior for the like interaction.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

…and commenting is done with below text input
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
platforms/pictique/src/lib/fragments/PostModal/PostModal.svelte (1)

209-218: Fix CSS syntax error and inconsistent behavior with desktop.

Three issues in the mobile like button:

  1. Syntax error on line 215: Missing closing parenthesis in var(--color-red-500" — should be var(--color-red-500).
  2. Inconsistent handler: Mobile uses callback.like directly while desktop uses handleLikeWithInteraction with scale animation.
  3. Inconsistent fill: Mobile uses 'white' when not liked, desktop uses 'transparent'.
🔧 Proposed fix
 <button
   class="group cursor-pointer rounded-2xl bg-gray-100 px-4 py-3 transition-colors hover:bg-gray-200 active:bg-gray-300"
-  onclick={callback.like}
+  onclick={handleLikeWithInteraction}
 >
-  <Like
-    size="24px"
-    color="var(--color-red-500"
-    fill={isLiked ? 'var(--color-red-500)' : 'white'}
-  />
+  <div
+    style="transform: scale({scale.current}); display: flex; align-items: center; justify-content: center;"
+  >
+    <Like
+      size="24px"
+      color="var(--color-red-500)"
+      fill={isLiked ? 'var(--color-red-500)' : 'transparent'}
+      class="transition-all duration-300"
+    />
+  </div>
 </button>
🤖 Fix all issues with AI agents
In `@platforms/pictique/src/lib/fragments/PostModal/PostModal.svelte`:
- Around line 125-129: Wrap the await call in handleLikeWithInteraction in a
try/finally so scale.target is always reset: move scale.target = 1.4 before the
try, await callback.like() inside try, and set scale.target = 1 in the finally
block (replace the setTimeout so the reset happens even on rejection; if the
delayed reset is required, perform the setTimeout inside finally). Ensure you
reference the existing function handleLikeWithInteraction, the scale.target
assignments, the await callback.like(), and the setTimeout behavior when
implementing the change.
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3ab6d87 and 3e91348.

📒 Files selected for processing (2)
  • platforms/pictique/src/lib/fragments/Post/Post.svelte
  • platforms/pictique/src/lib/fragments/PostModal/PostModal.svelte
🚧 Files skipped from review as they are similar to previous changes (1)
  • platforms/pictique/src/lib/fragments/Post/Post.svelte
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2026-01-05T11:46:43.214Z
Learnt from: Bekiboo
Repo: MetaState-Prototype-Project/prototype PR: 653
File: platforms/pictique/src/routes/(auth)/auth/+page.svelte:173-173
Timestamp: 2026-01-05T11:46:43.214Z
Learning: In Tailwind CSS v4, gradient utilities were renamed from bg-gradient-to-{direction} to bg-linear-to-{direction}. For all Svelte components (e.g., any .svelte files in the project), replace usages like bg-gradient-to-r, bg-gradient-to-l, etc. with bg-linear-to-r, bg-linear-to-l, etc. Ensure consistency across the codebase, update any documentation or design tokens, and run visual/test checks to confirm gradients render as intended.

Applied to files:

  • platforms/pictique/src/lib/fragments/PostModal/PostModal.svelte
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (1)
platforms/pictique/src/lib/fragments/PostModal/PostModal.svelte (1)

303-321: Desktop like button implementation looks good.

The scale animation is properly wired with handleLikeWithInteraction, and the visual feedback with transition-colors and active:bg-gray-300 improves UX. The commented-out CommentIcon aligns with the commit message about removing it due to lacking a handler.

Consider removing the commented code entirely if the comment functionality via text input is the intended final design.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
platforms/pictique/src/lib/fragments/PostModal/PostModal.svelte (1)

212-221: Mobile layout missing animation and has syntax error.

Two issues in the mobile Like button:

  1. Inconsistent behavior: Line 214 calls callback.like directly instead of handleLikeWithInteraction, so mobile users won't see the scale animation that desktop users get.

  2. Missing closing parenthesis: Line 218 has color="var(--color-red-500" — missing the closing ).

  3. Fill inconsistency: Mobile uses fill='white' when not liked, but desktop (line 316) uses 'transparent'. This may cause visual differences.

🔧 Proposed fix
 <button
-  class="group cursor-pointer rounded-2xl bg-gray-100 px-4 py-3 transition-colors hover:bg-gray-200 active:bg-gray-300"
-  onclick={callback.like}
+  class="group cursor-pointer rounded-2xl bg-gray-100 px-4 py-3 transition-colors hover:bg-gray-200 active:bg-gray-300"
+  onclick={handleLikeWithInteraction}
 >
-  <Like
-    size="24px"
-    color="var(--color-red-500"
-    fill={isLiked ? 'var(--color-red-500)' : 'white'}
-  />
+  <div
+    style="transform: scale({scale.current}); display: flex; align-items: center; justify-content: center;"
+  >
+    <Like
+      size="24px"
+      color={'var(--color-red-500)'}
+      fill={isLiked ? 'var(--color-red-500)' : 'transparent'}
+      class="transition-all duration-300"
+    />
+  </div>
 </button>
♻️ Duplicate comments (1)
platforms/pictique/src/lib/fragments/PostModal/PostModal.svelte (1)

119-132: LGTM!

The Spring animation and error handling with try/finally is correctly implemented, matching the pattern in Post.svelte.

🧹 Nitpick comments (1)
platforms/pictique/src/lib/fragments/PostModal/PostModal.svelte (1)

321-323: Verify commented-out code should be removed.

Per the PR description, the comment button was removed because commenting is handled via the text input. Consider removing this commented-out code entirely rather than leaving it in place.

♻️ Proposed cleanup
-				<!-- <button class="cursor-pointer rounded-2xl bg-gray-100 px-4 py-3 hover:bg-gray-200">
-					<CommentIcon size="24px" color="black" fill="transparent" />
-				</button> -->
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3e91348 and f27086f.

📒 Files selected for processing (2)
  • platforms/pictique/src/lib/fragments/Post/Post.svelte
  • platforms/pictique/src/lib/fragments/PostModal/PostModal.svelte
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2026-01-05T11:46:43.214Z
Learnt from: Bekiboo
Repo: MetaState-Prototype-Project/prototype PR: 653
File: platforms/pictique/src/routes/(auth)/auth/+page.svelte:173-173
Timestamp: 2026-01-05T11:46:43.214Z
Learning: In Tailwind CSS v4, gradient utilities were renamed from bg-gradient-to-{direction} to bg-linear-to-{direction}. For all Svelte components (e.g., any .svelte files in the project), replace usages like bg-gradient-to-r, bg-gradient-to-l, etc. with bg-linear-to-r, bg-linear-to-l, etc. Ensure consistency across the codebase, update any documentation or design tokens, and run visual/test checks to confirm gradients render as intended.

Applied to files:

  • platforms/pictique/src/lib/fragments/PostModal/PostModal.svelte
  • platforms/pictique/src/lib/fragments/Post/Post.svelte
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (6)
platforms/pictique/src/lib/fragments/Post/Post.svelte (4)

10-10: LGTM!

The Spring import from svelte/motion is correct for Svelte 5.


25-25: LGTM!

Updating the callback.like signature to Promise<void> correctly reflects the async nature of the like operation.


96-109: LGTM!

The Spring animation and handleLikeWithInteraction implementation is well-structured:

  • Spring parameters (stiffness 0.15, damping 0.25) provide smooth animation
  • try/finally ensures the scale resets even if the like callback fails
  • The 150ms delay before reset allows the animation peak to be visible

186-198: LGTM!

The scale transform is correctly applied via inline style, and the Like icon properly uses transparent fill when not liked (consistent with the desktop layout in PostModal.svelte).

platforms/pictique/src/lib/fragments/PostModal/PostModal.svelte (2)

12-12: LGTM!

The Spring import is correctly added for the animation functionality.


307-320: LGTM!

The desktop Like button correctly uses handleLikeWithInteraction and applies the scale transform animation. The implementation is consistent with Post.svelte.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@platforms/pictique/src/routes/`(protected)/profile/[id]/+page.svelte:
- Around line 167-170: The comment callback for the post lacks error handling:
in the comment handler (comment: async (comment) => { ... }) wrap the await
createComment(selectedPost.value?.id, comment) call in try/catch (similar to the
like handler), check selectedPost.value before calling, and on failure call the
existing error handling path (e.g., show the toast/error UI or call the same
error handler used by the like callback) and optionally rethrow or return a
failure result so the UI can reflect the error.
🧹 Nitpick comments (3)
platforms/pictique/src/routes/(protected)/profile/[id]/+page.svelte (3)

13-23: Unused Comment interface and comments array.

The local Comment interface and comments array (line 37) are declared but never used. The component passes $commentsStore to PostModal instead of this local array.

Consider removing the dead code:

Proposed fix
-	interface Comment {
-		id: string;
-		text: string;
-		createdAt: string;
-		author: {
-			id: string;
-			handle: string;
-			name: string;
-			avatarUrl: string;
-		};
-	}
-
-	let comments: Array<Comment> = [];

Also applies to: 37-37


75-83: Consider clearing comments before fetch to avoid stale data on error.

If fetchComments fails, the modal opens with potentially stale comments from a previously viewed post. Consider clearing the comments store before fetching or handling the error state in the UI.

Suggested approach
 async function handlePostClick(post: PostData) {
 	selectedPost.value = post;
 	try {
+		// Clear previous comments before fetching new ones
+		// (if your store supports this, e.g., commentsStore.set([]))
 		await fetchComments(post.id);
 	} catch (err) {
 		console.error('Error loading comments:', err);
+		// Optionally: show error state to user
 	}
 }

150-154: Type safety concern with as any casts.

The isLiked computation and the likedBy assignment (line 161) use as any casts, suggesting a type mismatch between selectedPost.value and the expected structure with likedBy. Consider extending the PostData type or using a more specific type to avoid losing type safety.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 85df461 and 20267c3.

📒 Files selected for processing (1)
  • platforms/pictique/src/routes/(protected)/profile/[id]/+page.svelte
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2026-01-05T11:46:43.214Z
Learnt from: Bekiboo
Repo: MetaState-Prototype-Project/prototype PR: 653
File: platforms/pictique/src/routes/(auth)/auth/+page.svelte:173-173
Timestamp: 2026-01-05T11:46:43.214Z
Learning: In Tailwind CSS v4, gradient utilities were renamed from bg-gradient-to-{direction} to bg-linear-to-{direction}. For all Svelte components (e.g., any .svelte files in the project), replace usages like bg-gradient-to-r, bg-gradient-to-l, etc. with bg-linear-to-r, bg-linear-to-l, etc. Ensure consistency across the codebase, update any documentation or design tokens, and run visual/test checks to confirm gradients render as intended.

Applied to files:

  • platforms/pictique/src/routes/(protected)/profile/[id]/+page.svelte
🔇 Additional comments (1)
platforms/pictique/src/routes/(protected)/profile/[id]/+page.svelte (1)

156-166: LGTM!

The like callback now properly guards against missing post ID, wraps the async call in try/catch, and validates the result before updating state. Previous review concerns have been addressed.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

@coodos coodos merged commit d6dc3c7 into main Jan 15, 2026
4 checks passed
@coodos coodos deleted the fix/like-not-working branch January 15, 2026 15:22
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.

[Bug] Commenting not working on post. [Bug] Like button not working.

4 participants