fix(chat-ui): move source settings to thread header
This commit is contained in:
@@ -4784,10 +4784,6 @@ async function decideFeedCard(card: FeedCard, decision: "accepted" | "rejected")
|
||||
:contact-initials="contactInitials"
|
||||
:format-thread-time="formatThreadTime"
|
||||
:thread-channel-label="threadChannelLabel"
|
||||
:thread-inboxes="threadInboxes"
|
||||
:set-inbox-hidden="setInboxHidden"
|
||||
:format-inbox-label="formatInboxLabel"
|
||||
:is-inbox-toggle-loading="isInboxToggleLoading"
|
||||
:people-deal-list="peopleDealList"
|
||||
:selected-deal-id="selectedDealId"
|
||||
:is-review-highlighted-deal="isReviewHighlightedDeal"
|
||||
@@ -4809,6 +4805,40 @@ async function decideFeedCard(card: FeedCard, decision: "accepted" | "rejected")
|
||||
<div v-else-if="selectedCommThread">
|
||||
<p class="font-medium">{{ selectedCommThread.contact }}</p>
|
||||
</div>
|
||||
<div v-if="selectedCommThread" class="dropdown dropdown-end" @click.stop>
|
||||
<button
|
||||
tabindex="0"
|
||||
class="btn btn-ghost btn-sm btn-square"
|
||||
title="Source visibility settings"
|
||||
>
|
||||
<svg viewBox="0 0 24 24" class="h-4 w-4 fill-current">
|
||||
<path d="M19.14 12.94a7.43 7.43 0 0 0 .05-.94 7.43 7.43 0 0 0-.05-.94l2.03-1.58a.5.5 0 0 0 .12-.63l-1.92-3.32a.5.5 0 0 0-.6-.22l-2.39.96a7.2 7.2 0 0 0-1.62-.94l-.36-2.54A.5.5 0 0 0 13.9 2h-3.8a.5.5 0 0 0-.49.41L9.25 4.95a7.2 7.2 0 0 0-1.62.94l-2.39-.96a.5.5 0 0 0-.6.22L2.72 8.47a.5.5 0 0 0 .12.63l2.03 1.58a7.43 7.43 0 0 0-.05.94c0 .31.02.63.05.94l-2.03 1.58a.5.5 0 0 0-.12.63l1.92 3.32c.13.23.39.32.6.22l2.39-.96c.5.39 1.05.71 1.62.94l.36 2.54c.04.24.25.41.49.41h3.8c.24 0 .45-.17.49-.41l.36-2.54c.57-.23 1.12-.55 1.62-.94l2.39.96c.22.09.47 0 .6-.22l1.92-3.32a.5.5 0 0 0-.12-.63zM12 15.5A3.5 3.5 0 1 1 12 8a3.5 3.5 0 0 1 0 7.5Z" />
|
||||
</svg>
|
||||
</button>
|
||||
<div tabindex="0" class="dropdown-content z-20 mt-1 w-60 rounded-xl border border-base-300 bg-base-100 p-2 shadow-lg">
|
||||
<p class="px-1 pb-1 text-[10px] font-semibold uppercase tracking-wide text-base-content/55">Sources</p>
|
||||
<div v-if="threadInboxes(selectedCommThread).length" class="space-y-1">
|
||||
<button
|
||||
v-for="inbox in threadInboxes(selectedCommThread)"
|
||||
:key="`thread-header-inbox-setting-${inbox.id}`"
|
||||
class="btn btn-ghost btn-xs h-auto min-h-0 w-full justify-between px-2 py-1 text-left normal-case"
|
||||
@click.stop="setInboxHidden(inbox.id, !inbox.isHidden)"
|
||||
>
|
||||
<span class="min-w-0 truncate">{{ formatInboxLabel(inbox) }}</span>
|
||||
<span class="shrink-0 text-[10px] text-base-content/70">
|
||||
{{
|
||||
isInboxToggleLoading(inbox.id)
|
||||
? "..."
|
||||
: inbox.isHidden
|
||||
? "Hidden"
|
||||
: "Visible"
|
||||
}}
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
<p v-else class="px-1 py-1 text-[11px] text-base-content/60">No sources.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<article class="h-full min-h-0 border-r border-base-300 flex flex-col">
|
||||
|
||||
@@ -16,10 +16,7 @@ defineProps<{
|
||||
markAvatarBroken: (threadId: string) => void;
|
||||
contactInitials: (contactName: string) => string;
|
||||
formatThreadTime: (iso: string) => string;
|
||||
threadInboxes: (thread: any) => any[];
|
||||
setInboxHidden: (inboxId: string, hidden: boolean) => void;
|
||||
formatInboxLabel: (inbox: any) => string;
|
||||
isInboxToggleLoading: (inboxId: string) => boolean;
|
||||
threadChannelLabel: (thread: any) => string;
|
||||
peopleDealList: any[];
|
||||
selectedDealId: string;
|
||||
isReviewHighlightedDeal: (dealId: string) => boolean;
|
||||
@@ -69,7 +66,7 @@ function onSearchInput(event: Event) {
|
||||
class="input input-bordered input-sm w-full"
|
||||
:placeholder="peopleListMode === 'contacts' ? 'Search contacts' : 'Search deals'"
|
||||
@input="onSearchInput"
|
||||
>
|
||||
/>
|
||||
|
||||
<div class="dropdown dropdown-end">
|
||||
<button
|
||||
@@ -136,7 +133,7 @@ function onSearchInput(event: Event) {
|
||||
:src="avatarSrcForThread(thread)"
|
||||
:alt="thread.contact"
|
||||
@error="markAvatarBroken(thread.id)"
|
||||
>
|
||||
/>
|
||||
<span v-else class="flex h-full w-full items-center justify-center text-[10px] font-semibold text-base-content/65">
|
||||
{{ contactInitials(thread.contact) }}
|
||||
</span>
|
||||
@@ -144,44 +141,13 @@ function onSearchInput(event: Event) {
|
||||
</div>
|
||||
|
||||
<div class="min-w-0 flex-1">
|
||||
<div class="flex items-center gap-1.5">
|
||||
<div class="flex items-start justify-between gap-2">
|
||||
<p class="min-w-0 flex-1 truncate text-xs font-semibold">{{ thread.contact }}</p>
|
||||
<span class="shrink-0 text-[10px] text-base-content/55">{{ formatThreadTime(thread.lastAt) }}</span>
|
||||
<div class="dropdown dropdown-end shrink-0" @click.stop>
|
||||
<button
|
||||
tabindex="0"
|
||||
class="btn btn-ghost btn-xs btn-square h-5 min-h-5"
|
||||
title="Source visibility settings"
|
||||
>
|
||||
<svg viewBox="0 0 24 24" class="h-3.5 w-3.5 fill-current">
|
||||
<path d="M19.14 12.94a7.43 7.43 0 0 0 .05-.94 7.43 7.43 0 0 0-.05-.94l2.03-1.58a.5.5 0 0 0 .12-.63l-1.92-3.32a.5.5 0 0 0-.6-.22l-2.39.96a7.2 7.2 0 0 0-1.62-.94l-.36-2.54A.5.5 0 0 0 13.9 2h-3.8a.5.5 0 0 0-.49.41L9.25 4.95a7.2 7.2 0 0 0-1.62.94l-2.39-.96a.5.5 0 0 0-.6.22L2.72 8.47a.5.5 0 0 0 .12.63l2.03 1.58a7.43 7.43 0 0 0-.05.94c0 .31.02.63.05.94l-2.03 1.58a.5.5 0 0 0-.12.63l1.92 3.32c.13.23.39.32.6.22l2.39-.96c.5.39 1.05.71 1.62.94l.36 2.54c.04.24.25.41.49.41h3.8c.24 0 .45-.17.49-.41l.36-2.54c.57-.23 1.12-.55 1.62-.94l2.39.96c.22.09.47 0 .6-.22l1.92-3.32a.5.5 0 0 0-.12-.63zM12 15.5A3.5 3.5 0 1 1 12 8a3.5 3.5 0 0 1 0 7.5Z" />
|
||||
</svg>
|
||||
</button>
|
||||
<div tabindex="0" class="dropdown-content z-20 mt-1 w-60 rounded-xl border border-base-300 bg-base-100 p-2 shadow-lg">
|
||||
<p class="px-1 pb-1 text-[10px] font-semibold uppercase tracking-wide text-base-content/55">Sources</p>
|
||||
<div v-if="threadInboxes(thread).length" class="space-y-1">
|
||||
<button
|
||||
v-for="inbox in threadInboxes(thread)"
|
||||
:key="`thread-inbox-setting-${inbox.id}`"
|
||||
class="btn btn-ghost btn-xs h-auto min-h-0 w-full justify-between px-2 py-1 text-left normal-case"
|
||||
@click.stop="setInboxHidden(inbox.id, !inbox.isHidden)"
|
||||
>
|
||||
<span class="min-w-0 truncate">{{ formatInboxLabel(inbox) }}</span>
|
||||
<span class="shrink-0 text-[10px] text-base-content/70">
|
||||
{{
|
||||
isInboxToggleLoading(inbox.id)
|
||||
? "..."
|
||||
: inbox.isHidden
|
||||
? "Hidden"
|
||||
: "Visible"
|
||||
}}
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
<p v-else class="px-1 py-1 text-[11px] text-base-content/60">No sources.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p class="mt-0.5 min-w-0 truncate text-[11px] text-base-content/75">
|
||||
{{ threadChannelLabel(thread) }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user