From 7e5fcc07482351b9499d95ccded6f911cca2cae6 Mon Sep 17 00:00:00 2001
From: gourav
Date: Thu, 15 Jan 2026 15:02:19 +0530
Subject: [PATCH 1/9] fix:like-not-working
---
.../pictique/src/routes/(protected)/+layout.svelte | 4 ++--
.../src/routes/(protected)/group/[id]/+page.svelte | 8 ++++----
.../src/routes/(protected)/profile/[id]/+page.svelte | 10 +++++++++-
3 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/platforms/pictique/src/routes/(protected)/+layout.svelte b/platforms/pictique/src/routes/(protected)/+layout.svelte
index 63dd40ce0..2de8e230f 100644
--- a/platforms/pictique/src/routes/(protected)/+layout.svelte
+++ b/platforms/pictique/src/routes/(protected)/+layout.svelte
@@ -197,8 +197,8 @@
core concepts of the W3DS ecosystem.
- It is not a production-grade platform and may lack full reliability, performance,
- and security guarantees.
+ It is not a production-grade platform and may lack full reliability, performance, and
+ security guarantees.
We strongly recommend that you avoid sharing sensitive or private content ,
diff --git a/platforms/pictique/src/routes/(protected)/group/[id]/+page.svelte b/platforms/pictique/src/routes/(protected)/group/[id]/+page.svelte
index 3db8438df..76048abff 100644
--- a/platforms/pictique/src/routes/(protected)/group/[id]/+page.svelte
+++ b/platforms/pictique/src/routes/(protected)/group/[id]/+page.svelte
@@ -156,13 +156,13 @@
{@const nextMessage = index < messages.length - 1 ? messages[index + 1] : null}
{@const isHeadNeeded = Boolean(
!prevMessage ||
- prevMessage.isOwn !== msg.isOwn ||
- (prevMessage.senderId && msg.senderId && prevMessage.senderId !== msg.senderId)
+ prevMessage.isOwn !== msg.isOwn ||
+ (prevMessage.senderId && msg.senderId && prevMessage.senderId !== msg.senderId)
)}
{@const isTimestampNeeded = Boolean(
!nextMessage ||
- nextMessage.isOwn !== msg.isOwn ||
- (nextMessage.senderId && msg.senderId && nextMessage.senderId !== msg.senderId)
+ nextMessage.isOwn !== msg.isOwn ||
+ (nextMessage.senderId && msg.senderId && nextMessage.senderId !== msg.senderId)
)}
user.id === ownerProfile.id
+ ) ?? false)
+ : false}
callback={{
like: async () => {
- await toggleLike(selectedPost.value?.id ?? '');
+ let result = await toggleLike(selectedPost.value?.id ?? '');
+ if (selectedPost.value) {
+ (selectedPost.value as any).likedBy = result.likedBy;
+ }
},
comment: async (comment) => {
if (!selectedPost.value) return;
From 8071f71f3d794e20feca8d70430c4ab1520a5a6c Mon Sep 17 00:00:00 2001
From: gourav
Date: Thu, 15 Jan 2026 15:07:41 +0530
Subject: [PATCH 2/9] fix:code rabbit suggestion
---
.../src/routes/(protected)/profile/[id]/+page.svelte | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/platforms/pictique/src/routes/(protected)/profile/[id]/+page.svelte b/platforms/pictique/src/routes/(protected)/profile/[id]/+page.svelte
index 88b28d405..3b137162e 100644
--- a/platforms/pictique/src/routes/(protected)/profile/[id]/+page.svelte
+++ b/platforms/pictique/src/routes/(protected)/profile/[id]/+page.svelte
@@ -137,9 +137,14 @@
: false}
callback={{
like: async () => {
- let result = await toggleLike(selectedPost.value?.id ?? '');
- if (selectedPost.value) {
- (selectedPost.value as any).likedBy = result.likedBy;
+ if (!selectedPost.value?.id) return;
+ try {
+ const result = await toggleLike(selectedPost.value.id);
+ if (selectedPost.value && result?.likedBy) {
+ (selectedPost.value as any).likedBy = result.likedBy;
+ }
+ } catch (err) {
+ console.error('Failed to toggle like:', err);
}
},
comment: async (comment) => {
From 3ab6d87cffd1cdae3fa2375a1bc42e1f1bf3aa43 Mon Sep 17 00:00:00 2001
From: gourav
Date: Thu, 15 Jan 2026 16:15:08 +0530
Subject: [PATCH 3/9] fix: added small button interaction for like button
---
.../src/lib/fragments/Post/Post.svelte | 31 +++++++++++++----
.../lib/fragments/PostModal/PostModal.svelte | 33 ++++++++++++++-----
2 files changed, 49 insertions(+), 15 deletions(-)
diff --git a/platforms/pictique/src/lib/fragments/Post/Post.svelte b/platforms/pictique/src/lib/fragments/Post/Post.svelte
index 977d5a773..f71880e81 100644
--- a/platforms/pictique/src/lib/fragments/Post/Post.svelte
+++ b/platforms/pictique/src/lib/fragments/Post/Post.svelte
@@ -7,6 +7,7 @@
import { ArrowLeftIcon, ArrowRightIcon, RecordIcon } from '@hugeicons/core-free-icons';
import { HugeiconsIcon } from '@hugeicons/svelte';
import type { HTMLAttributes } from 'svelte/elements';
+ import { Spring } from 'svelte/motion';
interface IPostProps extends HTMLAttributes {
avatar: string;
@@ -92,6 +93,17 @@
const img = event.target as HTMLImageElement;
img.src = 'https://picsum.photos/200';
}
+
+ const scale = new Spring(1, {
+ stiffness: 0.15,
+ damping: 0.25
+ });
+
+ async function handleLikeWithInteraction() {
+ scale.target = 1.4;
+ callback.like();
+ setTimeout(() => (scale.target = 1), 150);
+ }
@@ -168,14 +180,19 @@
{#if count}
-
+
+
+
{
avatar: string;
@@ -115,6 +116,17 @@
await callback.comment(commentValue);
commentValue = '';
};
+
+ const scale = new Spring(1, {
+ stiffness: 0.15,
+ damping: 0.25
+ });
+
+ async function handleLikeWithInteraction() {
+ scale.target = 1.4;
+ callback.like();
+ setTimeout(() => (scale.target = 1), 150);
+ }
@@ -195,7 +207,7 @@
-
+
+
+
From 3e91348770a6a1f69cf5fcc9cce4e6e8d75ec3a4 Mon Sep 17 00:00:00 2001
From: gourav
Date: Thu, 15 Jan 2026 16:44:15 +0530
Subject: [PATCH 4/9] fix: removed comment icon because there is not handler
attched to it and commenting is done with below text input
---
platforms/pictique/src/lib/fragments/Post/Post.svelte | 2 +-
.../pictique/src/lib/fragments/PostModal/PostModal.svelte | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/platforms/pictique/src/lib/fragments/Post/Post.svelte b/platforms/pictique/src/lib/fragments/Post/Post.svelte
index f71880e81..46615d72f 100644
--- a/platforms/pictique/src/lib/fragments/Post/Post.svelte
+++ b/platforms/pictique/src/lib/fragments/Post/Post.svelte
@@ -101,7 +101,7 @@
async function handleLikeWithInteraction() {
scale.target = 1.4;
- callback.like();
+ await callback.like();
setTimeout(() => (scale.target = 1), 150);
}
diff --git a/platforms/pictique/src/lib/fragments/PostModal/PostModal.svelte b/platforms/pictique/src/lib/fragments/PostModal/PostModal.svelte
index 4362f59fb..dda032680 100644
--- a/platforms/pictique/src/lib/fragments/PostModal/PostModal.svelte
+++ b/platforms/pictique/src/lib/fragments/PostModal/PostModal.svelte
@@ -124,7 +124,7 @@
async function handleLikeWithInteraction() {
scale.target = 1.4;
- callback.like();
+ await callback.like();
setTimeout(() => (scale.target = 1), 150);
}
@@ -315,9 +315,9 @@
/>
-
+
{new Date(time).toLocaleDateString()}
From f27086f8ed8181dc3de18d13301ba79ff2b38905 Mon Sep 17 00:00:00 2001
From: gourav
Date: Thu, 15 Jan 2026 16:54:37 +0530
Subject: [PATCH 5/9] fix: code rabbit suggestion
---
platforms/pictique/src/lib/fragments/Post/Post.svelte | 9 ++++++---
.../src/lib/fragments/PostModal/PostModal.svelte | 7 +++++--
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/platforms/pictique/src/lib/fragments/Post/Post.svelte b/platforms/pictique/src/lib/fragments/Post/Post.svelte
index 46615d72f..bb73eea16 100644
--- a/platforms/pictique/src/lib/fragments/Post/Post.svelte
+++ b/platforms/pictique/src/lib/fragments/Post/Post.svelte
@@ -22,7 +22,7 @@
};
callback: {
menu: () => void;
- like: () => void;
+ like: () => Promise;
comment: () => void;
};
time: string;
@@ -101,8 +101,11 @@
async function handleLikeWithInteraction() {
scale.target = 1.4;
- await callback.like();
- setTimeout(() => (scale.target = 1), 150);
+ try {
+ await callback.like();
+ } finally {
+ setTimeout(() => (scale.target = 1), 150);
+ }
}
diff --git a/platforms/pictique/src/lib/fragments/PostModal/PostModal.svelte b/platforms/pictique/src/lib/fragments/PostModal/PostModal.svelte
index dda032680..d61c91fcb 100644
--- a/platforms/pictique/src/lib/fragments/PostModal/PostModal.svelte
+++ b/platforms/pictique/src/lib/fragments/PostModal/PostModal.svelte
@@ -124,8 +124,11 @@
async function handleLikeWithInteraction() {
scale.target = 1.4;
- await callback.like();
- setTimeout(() => (scale.target = 1), 150);
+ try {
+ await callback.like();
+ } finally {
+ setTimeout(() => (scale.target = 1), 150);
+ }
}
From 85df4615f1bdfbdb7dd4225757cd6394bfb71da7 Mon Sep 17 00:00:00 2001
From: gourav
Date: Thu, 15 Jan 2026 16:59:58 +0530
Subject: [PATCH 6/9] fix: code rabbit suggestion
---
platforms/pictique/src/lib/fragments/Post/Post.svelte | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/platforms/pictique/src/lib/fragments/Post/Post.svelte b/platforms/pictique/src/lib/fragments/Post/Post.svelte
index bb73eea16..3d7f6618a 100644
--- a/platforms/pictique/src/lib/fragments/Post/Post.svelte
+++ b/platforms/pictique/src/lib/fragments/Post/Post.svelte
@@ -22,7 +22,7 @@
};
callback: {
menu: () => void;
- like: () => Promise;
+ like: () => void;
comment: () => void;
};
time: string;
From 20267c31209d0154c787168b04dfa856eeb3d303 Mon Sep 17 00:00:00 2001
From: gourav
Date: Thu, 15 Jan 2026 19:59:37 +0530
Subject: [PATCH 7/9] fix: show comments and send comment
---
.../(protected)/profile/[id]/+page.svelte | 26 ++++++++++++++++---
1 file changed, 22 insertions(+), 4 deletions(-)
diff --git a/platforms/pictique/src/routes/(protected)/profile/[id]/+page.svelte b/platforms/pictique/src/routes/(protected)/profile/[id]/+page.svelte
index 3b137162e..79346ae20 100644
--- a/platforms/pictique/src/routes/(protected)/profile/[id]/+page.svelte
+++ b/platforms/pictique/src/routes/(protected)/profile/[id]/+page.svelte
@@ -3,13 +3,25 @@
import { page } from '$app/state';
import { PostModal, Profile } from '$lib/fragments';
import { selectedPost } from '$lib/store/store.svelte';
- import { createComment } from '$lib/stores/comments';
+ import { comments as commentsStore, createComment, fetchComments } from '$lib/stores/comments';
import { toggleLike } from '$lib/stores/posts';
import type { PostData, userProfile } from '$lib/types';
import { Modal } from '$lib/ui';
import { apiClient, getAuthId } from '$lib/utils/axios';
import { onMount } from 'svelte';
+ interface Comment {
+ id: string;
+ text: string;
+ createdAt: string;
+ author: {
+ id: string;
+ handle: string;
+ name: string;
+ avatarUrl: string;
+ };
+ }
+
let profileId = $derived(page.params.id);
let profile = $state(null);
let error = $state(null);
@@ -22,6 +34,7 @@
return response.data;
}
});
+ let comments: Array = [];
async function fetchProfile() {
try {
@@ -59,10 +72,14 @@
}
}
- function handlePostClick(post: PostData) {
- console.log(post);
+ async function handlePostClick(post: PostData) {
selectedPost.value = post;
- // goto("/profile/post");
+ try {
+ // Trigger the store to fetch comments for this specific post
+ await fetchComments(post.id);
+ } catch (err) {
+ console.error('Error loading comments:', err);
+ }
}
onMount(fetchProfile);
@@ -152,6 +169,7 @@
await createComment(selectedPost.value?.id, comment);
}
}}
+ comments={$commentsStore}
time={selectedPost.value?.time ?? ''}
/>
From fefebb91bd4644ca6ad09560bd571311b2661880 Mon Sep 17 00:00:00 2001
From: gourav
Date: Thu, 15 Jan 2026 20:04:46 +0530
Subject: [PATCH 8/9] fix: added a try catch block for create comments
---
.../src/routes/(protected)/profile/[id]/+page.svelte | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/platforms/pictique/src/routes/(protected)/profile/[id]/+page.svelte b/platforms/pictique/src/routes/(protected)/profile/[id]/+page.svelte
index 79346ae20..c53d66497 100644
--- a/platforms/pictique/src/routes/(protected)/profile/[id]/+page.svelte
+++ b/platforms/pictique/src/routes/(protected)/profile/[id]/+page.svelte
@@ -166,7 +166,11 @@
},
comment: async (comment) => {
if (!selectedPost.value) return;
- await createComment(selectedPost.value?.id, comment);
+ try {
+ await createComment(selectedPost.value.id, comment);
+ } catch (err) {
+ console.error('Failed to create comment:', err);
+ }
}
}}
comments={$commentsStore}
From 042e9d8416385d3f45f02d14674e9410e4e64d49 Mon Sep 17 00:00:00 2001
From: gourav
Date: Thu, 15 Jan 2026 20:07:47 +0530
Subject: [PATCH 9/9] fix: removed deprecated code
---
.../pictique/src/routes/(protected)/profile/[id]/+page.svelte | 2 --
1 file changed, 2 deletions(-)
diff --git a/platforms/pictique/src/routes/(protected)/profile/[id]/+page.svelte b/platforms/pictique/src/routes/(protected)/profile/[id]/+page.svelte
index c53d66497..791c4348e 100644
--- a/platforms/pictique/src/routes/(protected)/profile/[id]/+page.svelte
+++ b/platforms/pictique/src/routes/(protected)/profile/[id]/+page.svelte
@@ -34,8 +34,6 @@
return response.data;
}
});
- let comments: Array = [];
-
async function fetchProfile() {
try {
loading = true;