Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ import 'vue-sonner/style.css'
<NuxtPage />
</NuxtLayout>
<ConfirmDialogProvider />
<Toaster position="bottom-right" :duration="3000" rich-colors close-button />
<Toaster position="top-center" :duration="3000" rich-colors close-button />
</template>
9 changes: 9 additions & 0 deletions app/components/changelog/ChangelogReactions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ const picked = reactive<Record<string, boolean>>({})
const pickerOpen = ref(false)
const rootRef = ref<HTMLElement | null>(null)

const { data: session } = useAuthSession()
const isLoggedIn = computed(() => !!session.value?.user)
const loginModal = useLoginModal()

// Initialize picked state from userReactions
for (const emoji of props.userReactions) {
picked[emoji] = true
Expand All @@ -29,6 +33,11 @@ const displayedReactions = computed(() =>
)

async function toggle(emoji: string) {
if (!isLoggedIn.value) {
pickerOpen.value = false
return loginModal.open()
}

const wasActive = picked[emoji]

// Optimistic update
Expand Down
16 changes: 15 additions & 1 deletion app/components/post/PostDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { MdEditor } from 'md-editor-v3'
import 'md-editor-v3/lib/style.css'
import '~/assets/css/md-editor-preview.css'
import { toast } from 'vue-sonner'
import { sanitizeAttachmentHtml } from '~/utils/attachment';


Expand Down Expand Up @@ -280,6 +281,17 @@ async function handleDeleteComment(commentId: string) {
watch(commentSort, () => {
store.fetchComments(props.slug, commentSort.value)
})

async function handleShare() {
// Canonical post URL — independent of current location (post may be opened in a modal)
const url = `${window.location.origin}/p/${props.slug}`
try {
await navigator.clipboard.writeText(url)
toast.success('Link copied to clipboard')
} catch {
toast.error('Failed to copy link')
}
}
</script>

<template>
Expand Down Expand Up @@ -474,8 +486,10 @@ watch(commentSort, () => {
</div>
</div>
<div class="pt-2 flex flex-col gap-2">
<!-- Subscribe to Updates — hidden until the notification backend lands; unhide when ready
<Button variant="secondary" :disabled="isMerged" :class="isMerged ? 'opacity-50 cursor-not-allowed' : ''"><Icon name="lucide:bell" size="18" /> Subscribe to Updates</Button>
<Button variant="outline" class="text-primary" :disabled="isMerged" :class="isMerged ? 'opacity-50 cursor-not-allowed' : ''"><Icon name="lucide:share-2" size="18" /> Share Request</Button>
-->
<Button variant="outline" class="text-primary" :disabled="isMerged" :class="isMerged ? 'opacity-50 cursor-not-allowed' : ''" @click="handleShare"><Icon name="lucide:share-2" size="18" /> Share Request</Button>
</div>
</div>
<SimilarPostsPanel v-if="post.id && !isMerged" :post-id="post.id" :is-admin="isOrgManager" @merge="handleSimilarMerge" />
Expand Down
Loading