feat(web): add guided page tours and tighten shell chrome.

Ship first-visit Ant tours for core menus with replay help, role-list search for large orgs, and fixed 32px workspace tabs.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-12-01 13:04:57 +03:30
co-authored by Cursor
parent 892edacd3c
commit 37b732bae3
30 changed files with 1415 additions and 565 deletions
+73 -7
View File
@@ -12,6 +12,7 @@ import OrgSwitcher from '@/components/OrgSwitcher.vue';
import NavHubPanel from '@/components/nav/NavHubPanel.vue';
import GamificationToaster from '@/components/gamification/GamificationToaster.vue';
import SmsHeaderWallet from '@/components/SmsHeaderWallet.vue';
import { PageTourHost } from '@/tours';
import { NAV_HUBS, type NavHubDef, type NavHubKey } from '@/lib/nav-hubs';
import {
brand,
@@ -308,7 +309,6 @@ const openHub = computed<NavHubDef | null>(() => {
to: '/leads',
hub: 'leads',
title: 'لیدها',
desc: 'مخاطبین بالقوه قبل از تبدیل به مشتری',
icon: 'user-plus',
tint: 'sky',
module: 'leads',
@@ -361,6 +361,7 @@ const profileSecondary = computed(() => {
const roleUsers = ref<OrgUserDto[]>([]);
const roleBusy = ref(false);
const roleError = ref('');
const roleUsersQuery = ref('');
/** سوئیچ نقش فقط برای مدیر/مالک همین محیط (یا وقتی مالک در حال مشاهده است) */
const canSwitchRoles = computed(
@@ -388,6 +389,18 @@ const sortedRoleUsers = computed(() => {
});
});
const roleSearchVisible = computed(() => sortedRoleUsers.value.length > 5);
const filteredRoleUsers = computed(() => {
const q = roleUsersQuery.value.trim().toLowerCase();
if (!q) return sortedRoleUsers.value;
return sortedRoleUsers.value.filter((user) => {
const label = roleUserLabel(user).toLowerCase();
const name = user.fullName.toLowerCase();
return label.includes(q) || name.includes(q);
});
});
async function loadRoleUsers() {
if (!canSwitchRoles.value) {
roleUsers.value = [];
@@ -423,6 +436,7 @@ async function switchRoleUser(user: OrgUserDto) {
function closeUserMenu() {
userMenuOpen.value = false;
roleError.value = '';
roleUsersQuery.value = '';
}
function closeOrgSwitcher() {
@@ -597,7 +611,7 @@ async function loadActivityBadge() {
const { data } = await api.get<ActivitySummaryDto>('/activities/summary', {
params: { desk: 'mine' },
});
activityBadge.value = data.todayCount;
activityBadge.value = (data.todayCount ?? 0) + (data.overdueCount ?? 0);
} catch {
activityBadge.value = 0;
}
@@ -703,6 +717,7 @@ onMounted(() => {
void loadChatBadge();
pollTimer = setInterval(() => {
void refreshNotifs();
void loadActivityBadge();
void loadRoutineBadge();
void refreshUnreadTotal().catch(() => undefined);
}, 45000);
@@ -1036,9 +1051,19 @@ onUnmounted(() => {
aria-label="نقش‌ها"
>
<p class="user-role-hint">نقش‌ها</p>
<input
v-if="roleSearchVisible"
v-model="roleUsersQuery"
type="search"
class="user-role-search"
placeholder="جستجوی نقش یا نام…"
aria-label="جستجوی نقش"
@click.stop
@keydown.stop
/>
<div class="user-role-scroll">
<button
v-for="user in sortedRoleUsers"
v-for="user in filteredRoleUsers"
:key="user.id"
type="button"
class="user-role-item"
@@ -1066,6 +1091,9 @@ onUnmounted(() => {
:size="15"
/>
</button>
<p v-if="roleSearchVisible && !filteredRoleUsers.length" class="user-role-empty">
موردی پیدا نشد
</p>
</div>
</div>
<p v-if="roleError" class="user-role-err">{{ roleError }}</p>
@@ -1270,6 +1298,7 @@ onUnmounted(() => {
<main class="content">
<RouterView />
<GamificationToaster v-if="moduleAllowed('gamification')" />
<PageTourHost />
</main>
</div>
@@ -2034,13 +2063,13 @@ onUnmounted(() => {
--ws-tab-bar: #fff;
--ws-tab-active: var(--accent-soft, #d0ebe8);
--ws-tab-active-ink: var(--accent, #10897d);
--ws-tab-radius: 10px;
--ws-tab-radius: 8px;
display: block;
box-sizing: border-box;
flex: 0 0 auto;
min-width: 0;
width: 100%;
padding: 6px 16px 0;
padding: 4px 16px 0;
/* same chrome as .desktop-topbar */
overflow: visible;
background: #fff;
@@ -2070,7 +2099,10 @@ onUnmounted(() => {
.workspace-tabs :deep(.ant-tabs-tab) {
position: relative;
margin: 0 2px !important;
padding: 8px 12px !important;
padding: 0 10px !important;
height: 32px !important;
min-height: 32px !important;
line-height: 32px !important;
background: transparent !important;
border: 1px solid transparent !important;
border-radius: var(--ws-tab-radius) var(--ws-tab-radius) 0 0 !important;
@@ -2110,8 +2142,9 @@ onUnmounted(() => {
}
.workspace-tabs :deep(.ant-tabs-tab .ant-tabs-tab-remove) {
margin-inline-start: 6px;
margin-inline-start: 4px;
margin-inline-end: 0;
padding: 0 !important;
color: inherit;
opacity: 0.55;
}
@@ -3191,6 +3224,39 @@ onUnmounted(() => {
color: #94a3b8;
}
.user-role-search {
width: 100%;
box-sizing: border-box;
margin: 0 0 0.2rem;
padding: 0.4rem 0.55rem;
border: 1px solid #e2e8f0;
border-radius: 10px;
background: #f8fafc;
color: #0f172a;
font: inherit;
font-size: 0.78rem;
outline: none;
}
.user-role-search:focus {
border-color: #14b8a6;
background: #fff;
box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.12);
}
.user-role-search::-webkit-search-cancel-button {
cursor: pointer;
}
.user-role-empty {
margin: 0;
padding: 0.55rem 0.5rem;
font-size: 0.75rem;
font-weight: 600;
color: #94a3b8;
text-align: center;
}
.user-role-scroll {
display: grid;
gap: 0.15rem;