Open-source social media scheduler built for AI agents and the teams behind them. Create, schedule and publish posts to every network through MCP or the REST API, or write them yourself in a composer your team will love.
PHP ai-agentsblueskyfacebookinstagramlaravellinkedinmastodonmcpmcp-serveropen-sourcerest-apiself-hostedsocial-mediasocial-media-managementsocial-media-schedulerthreadstiktokvuejsxyoutube
Refresh the Insights design (#457)
Paulo Castellanof14d37382495
diff --git a/app/Actions/Analytics/BuildWorkspaceAnalyticsReport.php b/app/Actions/Analytics/BuildWorkspaceAnalyticsReport.phpindex de5825c14..98d563a65 100644--- a/app/Actions/Analytics/BuildWorkspaceAnalyticsReport.php+++ b/app/Actions/Analytics/BuildWorkspaceAnalyticsReport.php@@ -138,13 +138,13 @@ class BuildWorkspaceAnalyticsReport}/**- * The live connection status and current avatar of each key that is still a- * social account of the workspace. A key whose account is gone is absent, so- * its row keeps no status, and a row without a live avatar keeps the one its- * analytics rows stored.+ * The live connection status, current avatar and verified badge of each key+ * that is still a social account of the workspace. A key whose account is+ * gone is absent, so its row keeps no status and no badge, and a row without+ * a live avatar keeps the one its analytics rows stored.** @param list<string> $keys- * @return array<string, array{status: string, avatar_url: string|null}>+ * @return array<string, array{status: string, avatar_url: string|null, verified_badge: string|null}>*/private function liveAccountsByKey(Workspace $workspace, array $keys): array{@@ -153,17 +153,18 @@ class BuildWorkspaceAnalyticsReportreturn SocialAccount::query()->whereBelongsTo($workspace)->whereIn('id', $ids)- ->get(['id', 'status', 'avatar_url'])+ ->get(['id', 'platform', 'status', 'avatar_url', 'meta'])->mapWithKeys(fn (SocialAccount $account): array => [$account->id => ['status' => $account->status->value,'avatar_url' => $account->avatar_url,+ 'verified_badge' => $account->verified_badge,]])->all();}/*** @param list<array<string, mixed>> $rows- * @param array<string, array{status: string, avatar_url: string|null}> $liveAccounts+ * @param array<string, array{status: string, avatar_url: string|null, verified_badge: string|null}> $liveAccounts* @return list<array<string, mixed>>*/private function withLiveAccount(array $rows, array $liveAccounts): array@@ -175,6 +176,7 @@ class BuildWorkspaceAnalyticsReport...$row,'avatar_url' => data_get($live, 'avatar_url') ?? data_get($row, 'avatar_url'),'status' => data_get($live, 'status'),+ 'verified_badge' => data_get($live, 'verified_badge'),];}, $rows);}diff --git a/lang/ar/analytics.php b/lang/ar/analytics.phpindex c33338c30..cbcedc87b 100644--- a/lang/ar/analytics.php+++ b/lang/ar/analytics.php@@ -85,8 +85,7 @@ return ['followers_at_start' => 'في البداية','followers_gained_in_range' => 'المكتسبون','no_excerpt' => 'لا تتوفر معاينة للنص.',- 'published_via_trypost' => 'نُشر عبر TryPost',- 'published_on_network' => 'نُشر على الشبكة الاجتماعية',+ 'published_via' => 'نُشر عبر','top_posts_sort' => 'ترتيب المنشورات حسب','carried_forward' => 'آخر قيمة معروفة','carried_forward_hint' => 'تعذّر الوصول إلى الخدمة؛ هذا هو آخر عدد معروف للمتابعين.',diff --git a/lang/ar/mcp.php b/lang/ar/mcp.phpindex d987a91fb..338ff3bd7 100644--- a/lang/ar/mcp.php+++ b/lang/ar/mcp.php@@ -65,8 +65,7 @@ return ['login' => 'سجّل الدخول إلى TryPost واختر مساحة العمل',],'chatgpt' => [- 'developer' => 'فعّل وضع المطوّر في إعدادات ChatGPT',- 'create' => 'أنشئ تطبيقًا باسم TryPost والصق الرابط',+ 'open' => 'افتح TryPost في ChatGPT واضغط «اتصال»','login' => 'سجّل الدخول إلى TryPost واختر مساحة العمل',],'other' => [diff --git a/lang/de/analytics.php b/lang/de/analytics.phpindex 8ff238bca..032a95f9b 100644--- a/lang/de/analytics.php+++ b/lang/de/analytics.php@@ -85,8 +85,7 @@ return ['followers_at_start' => 'Zu Beginn','followers_gained_in_range' => 'Hinzugewonnen','no_excerpt' => 'Keine Textvorschau verfügbar.',- 'published_via_trypost' => 'Über TryPost veröffentlicht',- 'published_on_network' => 'Im sozialen Netzwerk veröffentlicht',+ 'published_via' => 'Veröffentlicht über','top_posts_sort' => 'Beiträge sortieren nach','carried_forward' => 'Letzter bekannter Wert','carried_forward_hint' => 'Der Anbieter war nicht verfügbar; dies ist die letzte bekannte Follower-Zahl.',diff --git a/lang/de/mcp.php b/lang/de/mcp.phpindex b8f8a7b11..f410c2bf6 100644--- a/lang/de/mcp.php+++ b/lang/de/mcp.php@@ -65,8 +65,7 @@ return ['login' => 'Melde dich bei TryPost an und wähle den Workspace',],'chatgpt' => [- 'developer' => 'Aktiviere den Entwicklermodus in den ChatGPT-Einstellungen',- 'create' => 'Erstelle eine App namens TryPost und füge die URL ein',+ 'open' => 'Öffne TryPost in ChatGPT und klicke auf „Verbinden“','login' => 'Melde dich bei TryPost an und wähle den Workspace',],'other' => [diff --git a/lang/el/analytics.php b/lang/el/analytics.phpindex 88628209c..62b5ac9f6 100644--- a/lang/el/analytics.php+++ b/lang/el/analytics.php@@ -85,8 +85,7 @@ return ['followers_at_start' => 'Στην αρχή','followers_gained_in_range' => 'Νέοι','no_excerpt' => 'Δεν υπάρχει διαθέσιμη προεπισκόπηση κειμένου.',- 'published_via_trypost' => 'Δημοσιεύτηκε μέσω TryPost',- 'published_on_network' => 'Δημοσιεύτηκε στο κοινωνικό δίκτυο',+ 'published_via' => 'Δημοσιεύτηκε μέσω','top_posts_sort' => 'Ταξινόμηση δημοσιεύσεων κατά','carried_forward' => 'Τελευταία γνωστή τιμή','carried_forward_hint' => 'Η υπηρεσία δεν ήταν διαθέσιμη· αυτός είναι ο τελευταίος γνωστός αριθμός ακολούθων.',diff --git a/lang/el/mcp.php b/lang/el/mcp.phpindex 56ee37479..80efbe14e 100644--- a/lang/el/mcp.php+++ b/lang/el/mcp.php@@ -65,8 +65,7 @@ return ['login' => 'Συνδεθείτε στο TryPost και επιλέξτε workspace',],'chatgpt' => [- 'developer' => 'Ενεργοποιήστε τη λειτουργία προγραμματιστή στις ρυθμίσεις του ChatGPT',- 'create' => 'Δημιουργήστε μια εφαρμογή με όνομα TryPost και επικολλήστε το URL',+ 'open' => 'Ανοίξτε το TryPost στο ChatGPT και πατήστε «Σύνδεση»','login' => 'Συνδεθείτε στο TryPost και επιλέξτε workspace',],'other' => [diff --git a/lang/en/analytics.php b/lang/en/analytics.phpindex 25e85541e..22337cd0d 100644--- a/lang/en/analytics.php+++ b/lang/en/analytics.php@@ -85,8 +85,7 @@ return ['followers_at_start' => 'At range start','followers_gained_in_range' => 'Gained in range','no_excerpt' => 'No text preview available.',- 'published_via_trypost' => 'Published via TryPost',- 'published_on_network' => 'Published on the social network',+ 'published_via' => 'Published via','top_posts_sort' => 'Rank posts by','carried_forward' => 'Last known','carried_forward_hint' => 'The provider was unavailable; this is the last known follower count.',diff --git a/lang/en/mcp.php b/lang/en/mcp.phpindex 41a303ac8..ea0e9af3c 100644--- a/lang/en/mcp.php+++ b/lang/en/mcp.php@@ -65,8 +65,7 @@ return ['login' => 'Log in to TryPost and pick your workspace',],'chatgpt' => [- 'developer' => 'Turn on Developer mode in ChatGPT\'s settings',- 'create' => 'Create an app named TryPost and paste the URL',+ 'open' => 'Open TryPost in ChatGPT and click Connect','login' => 'Log in to TryPost and pick your workspace',],'other' => [diff --git a/lang/es/analytics.php b/lang/es/analytics.phpindex 0cebff7e6..83c778fb7 100644--- a/lang/es/analytics.php+++ b/lang/es/analytics.php@@ -85,8 +85,7 @@ return ['followers_at_start' => 'Al inicio','followers_gained_in_range' => 'Ganados en el periodo','no_excerpt' => 'No hay vista previa de texto disponible.',- 'published_via_trypost' => 'Publicado mediante TryPost',- 'published_on_network' => 'Publicado en la red social',+ 'published_via' => 'Publicado vía','top_posts_sort' => 'Ordenar publicaciones por','carried_forward' => 'Último valor conocido','carried_forward_hint' => 'El proveedor no estaba disponible; este es el último número conocido de seguidores.',diff --git a/lang/es/mcp.php b/lang/es/mcp.phpindex 6fccee5d6..e3123cf29 100644--- a/lang/es/mcp.php+++ b/lang/es/mcp.php@@ -65,8 +65,7 @@ return ['login' => 'Inicia sesión en TryPost y elige el workspace',],'chatgpt' => [- 'developer' => 'Activa el modo desarrollador en la configuración de ChatGPT',- 'create' => 'Crea una app llamada TryPost y pega la URL',+ 'open' => 'Abre TryPost en ChatGPT y haz clic en Conectar','login' => 'Inicia sesión en TryPost y elige el workspace',],'other' => [diff --git a/lang/fr/analytics.php b/lang/fr/analytics.phpindex 888dcf261..e32b11d35 100644--- a/lang/fr/analytics.php+++ b/lang/fr/analytics.php@@ -85,8 +85,7 @@ return ['followers_at_start' => 'Au début','followers_gained_in_range' => 'Gagnés','no_excerpt' => 'Aucun aperçu textuel disponible.',- 'published_via_trypost' => 'Publié via TryPost',- 'published_on_network' => 'Publié sur le réseau social',+ 'published_via' => 'Publié via','top_posts_sort' => 'Classer les publications par','carried_forward' => 'Dernière valeur connue','carried_forward_hint' => 'Le service était indisponible ; voici le dernier nombre connu d’abonnés.',diff --git a/lang/fr/mcp.php b/lang/fr/mcp.phpindex 84320af67..415577c8f 100644--- a/lang/fr/mcp.php+++ b/lang/fr/mcp.php@@ -65,8 +65,7 @@ return ['login' => 'Connectez-vous à TryPost et choisissez le workspace',],'chatgpt' => [- 'developer' => 'Activez le mode développeur dans les réglages de ChatGPT',- 'create' => 'Créez une app nommée TryPost et collez l’URL',+ 'open' => 'Ouvrez TryPost dans ChatGPT et cliquez sur Connecter','login' => 'Connectez-vous à TryPost et choisissez le workspace',],'other' => [diff --git a/lang/it/analytics.php b/lang/it/analytics.phpindex c5a0a5a40..ebdfe0988 100644--- a/lang/it/analytics.php+++ b/lang/it/analytics.php@@ -85,8 +85,7 @@ return ['followers_at_start' => 'All’inizio','followers_gained_in_range' => 'Guadagnati','no_excerpt' => 'Anteprima del testo non disponibile.',- 'published_via_trypost' => 'Pubblicato tramite TryPost',- 'published_on_network' => 'Pubblicato sul social network',+ 'published_via' => 'Pubblicato tramite','top_posts_sort' => 'Ordina i post per','carried_forward' => 'Ultimo valore noto','carried_forward_hint' => 'Il servizio non era disponibile; questo è l’ultimo numero noto di follower.',diff --git a/lang/it/mcp.php b/lang/it/mcp.phpindex 4ee81a4cd..4bf068a85 100644--- a/lang/it/mcp.php+++ b/lang/it/mcp.php@@ -65,8 +65,7 @@ return ['login' => 'Accedi a TryPost e scegli il workspace',],'chatgpt' => [- 'developer' => 'Attiva la modalità sviluppatore nelle impostazioni di ChatGPT',- 'create' => 'Crea un’app chiamata TryPost e incolla l’URL',+ 'open' => 'Apri TryPost in ChatGPT e fai clic su Connetti','login' => 'Accedi a TryPost e scegli il workspace',],'other' => [diff --git a/lang/ja/analytics.php b/lang/ja/analytics.phpindex 68a0beec8..6c515a306 100644--- a/lang/ja/analytics.php+++ b/lang/ja/analytics.php@@ -85,8 +85,7 @@ return ['followers_at_start' => '期間開始時','followers_gained_in_range' => '期間中の増加','no_excerpt' => 'テキストのプレビューはありません。',- 'published_via_trypost' => 'TryPostから公開',- 'published_on_network' => 'SNS上で公開',+ 'published_via' => '公開元:','top_posts_sort' => '投稿の並べ替え基準','carried_forward' => '最後に確認された値','carried_forward_hint' => 'サービスに接続できなかったため、最後に確認されたフォロワー数を表示しています。',diff --git a/lang/ja/mcp.php b/lang/ja/mcp.phpindex 7de350271..ece21a9d1 100644--- a/lang/ja/mcp.php+++ b/lang/ja/mcp.php@@ -65,8 +65,7 @@ return ['login' => 'TryPostにログインしてワークスペースを選択',],'chatgpt' => [- 'developer' => 'ChatGPTの設定で開発者モードをオン',- 'create' => '「TryPost」という名前でアプリを作成し、URLを貼り付け',+ 'open' => 'ChatGPTでTryPostを開き、「接続する」をクリック','login' => 'TryPostにログインしてワークスペースを選択',],'other' => [diff --git a/lang/ko/analytics.php b/lang/ko/analytics.phpindex db0109889..e7dd10381 100644--- a/lang/ko/analytics.php+++ b/lang/ko/analytics.php@@ -85,8 +85,7 @@ return ['followers_at_start' => '기간 시작','followers_gained_in_range' => '기간 중 증가','no_excerpt' => '텍스트 미리보기가 없습니다.',- 'published_via_trypost' => 'TryPost를 통해 게시',- 'published_on_network' => '소셜 네트워크에 게시',+ 'published_via' => '게시 경로:','top_posts_sort' => '게시물 정렬 기준','carried_forward' => '마지막으로 확인된 값','carried_forward_hint' => '서비스를 사용할 수 없어 마지막으로 확인된 팔로워 수를 표시합니다.',diff --git a/lang/ko/mcp.php b/lang/ko/mcp.phpindex 58ea81ff4..d1e71a9f4 100644--- a/lang/ko/mcp.php+++ b/lang/ko/mcp.php@@ -65,8 +65,7 @@ return ['login' => 'TryPost에 로그인하고 워크스페이스 선택',],'chatgpt' => [- 'developer' => 'ChatGPT 설정에서 개발자 모드 켜기',- 'create' => 'TryPost라는 앱을 만들고 URL 붙여넣기',+ 'open' => 'ChatGPT에서 TryPost를 열고 연결 클릭','login' => 'TryPost에 로그인하고 워크스페이스 선택',],'other' => [diff --git a/lang/nl/analytics.php b/lang/nl/analytics.phpindex acdada9d0..b0a7810a2 100644--- a/lang/nl/analytics.php+++ b/lang/nl/analytics.php@@ -85,8 +85,7 @@ return ['followers_at_start' => 'Bij de start','followers_gained_in_range' => 'Erbij gekomen','no_excerpt' => 'Geen tekstvoorbeeld beschikbaar.',- 'published_via_trypost' => 'Gepubliceerd via TryPost',- 'published_on_network' => 'Gepubliceerd op het sociale netwerk',+ 'published_via' => 'Gepubliceerd via','top_posts_sort' => 'Berichten rangschikken op','carried_forward' => 'Laatst bekende waarde','carried_forward_hint' => 'De aanbieder was niet beschikbaar; dit is het laatst bekende aantal volgers.',diff --git a/lang/nl/mcp.php b/lang/nl/mcp.phpindex 574018a12..1cfdb64e3 100644--- a/lang/nl/mcp.php+++ b/lang/nl/mcp.php@@ -65,8 +65,7 @@ return ['login' => 'Log in bij TryPost en kies de workspace',],'chatgpt' => [- 'developer' => 'Zet de ontwikkelaarsmodus aan in de instellingen van ChatGPT',- 'create' => 'Maak een app met de naam TryPost en plak de URL',+ 'open' => 'Open TryPost in ChatGPT en klik op Verbinden','login' => 'Log in bij TryPost en kies de workspace',],'other' => [diff --git a/lang/pl/analytics.php b/lang/pl/analytics.phpindex 02549ecd4..a9737e118 100644--- a/lang/pl/analytics.php+++ b/lang/pl/analytics.php@@ -85,8 +85,7 @@ return ['followers_at_start' => 'Na starcie','followers_gained_in_range' => 'Zyskani','no_excerpt' => 'Podgląd tekstu jest niedostępny.',- 'published_via_trypost' => 'Opublikowano przez TryPost',- 'published_on_network' => 'Opublikowano w sieci społecznościowej',+ 'published_via' => 'Opublikowano przez','top_posts_sort' => 'Sortuj posty według','carried_forward' => 'Ostatnia znana wartość','carried_forward_hint' => 'Dostawca był niedostępny; to ostatnia znana liczba obserwujących.',diff --git a/lang/pl/mcp.php b/lang/pl/mcp.phpindex f785f0858..f9b6bcdb6 100644--- a/lang/pl/mcp.php+++ b/lang/pl/mcp.php@@ -65,8 +65,7 @@ return ['login' => 'Zaloguj się do TryPost i wybierz workspace',],'chatgpt' => [- 'developer' => 'Włącz tryb programisty w ustawieniach ChatGPT',- 'create' => 'Utwórz aplikację o nazwie TryPost i wklej adres URL',+ 'open' => 'Otwórz TryPost w ChatGPT i kliknij Połącz','login' => 'Zaloguj się do TryPost i wybierz workspace',],'other' => [diff --git a/lang/pt-BR/analytics.php b/lang/pt-BR/analytics.phpindex 1966d6bd8..6641f3679 100644--- a/lang/pt-BR/analytics.php+++ b/lang/pt-BR/analytics.php@@ -85,8 +85,7 @@ return ['followers_at_start' => 'No início','followers_gained_in_range' => 'Ganhos no período','no_excerpt' => 'Prévia de texto indisponível.',- 'published_via_trypost' => 'Publicado pelo TryPost',- 'published_on_network' => 'Publicado na rede social',+ 'published_via' => 'Publicado via','top_posts_sort' => 'Ordenar posts por','carried_forward' => 'Último valor','carried_forward_hint' => 'A rede ficou indisponível; este é o último número conhecido de seguidores.',diff --git a/lang/pt-BR/mcp.php b/lang/pt-BR/mcp.phpindex 63b1ac227..2f295da0a 100644--- a/lang/pt-BR/mcp.php+++ b/lang/pt-BR/mcp.php@@ -65,8 +65,7 @@ return ['login' => 'Faça login no TryPost e escolha o workspace',],'chatgpt' => [- 'developer' => 'Ative o Modo desenvolvedor nas configurações do ChatGPT',- 'create' => 'Crie um app com o nome TryPost e cole a URL',+ 'open' => 'Abra o TryPost no ChatGPT e clique em Conectar','login' => 'Faça login no TryPost e escolha o workspace',],'other' => [diff --git a/lang/ru/analytics.php b/lang/ru/analytics.phpindex 3f74660b8..004dc373a 100644--- a/lang/ru/analytics.php+++ b/lang/ru/analytics.php@@ -85,8 +85,7 @@ return ['followers_at_start' => 'На старте','followers_gained_in_range' => 'Прирост','no_excerpt' => 'Текстовое превью недоступно.',- 'published_via_trypost' => 'Опубликовано через TryPost',- 'published_on_network' => 'Опубликовано в социальной сети',+ 'published_via' => 'Опубликовано через','top_posts_sort' => 'Сортировать публикации по','carried_forward' => 'Последнее известное значение','carried_forward_hint' => 'Сервис был недоступен; показано последнее известное число подписчиков.',diff --git a/lang/ru/mcp.php b/lang/ru/mcp.phpindex dd5246f22..fbc1dc3c8 100644--- a/lang/ru/mcp.php+++ b/lang/ru/mcp.php@@ -65,8 +65,7 @@ return ['login' => 'Войдите в TryPost и выберите workspace',],'chatgpt' => [- 'developer' => 'Включите режим разработчика в настройках ChatGPT',- 'create' => 'Создайте приложение TryPost и вставьте URL',+ 'open' => 'Откройте TryPost в ChatGPT и нажмите «Подключить»','login' => 'Войдите в TryPost и выберите workspace',],'other' => [diff --git a/lang/tr/analytics.php b/lang/tr/analytics.phpindex c39179bfd..9c575ce3d 100644--- a/lang/tr/analytics.php+++ b/lang/tr/analytics.php@@ -85,8 +85,7 @@ return ['followers_at_start' => 'Başlangıçta','followers_gained_in_range' => 'Kazanılan','no_excerpt' => 'Metin önizlemesi mevcut değil.',- 'published_via_trypost' => 'TryPost aracılığıyla yayınlandı',- 'published_on_network' => 'Sosyal ağda yayınlandı',+ 'published_via' => 'Yayın kaynağı:','top_posts_sort' => 'Gönderileri şuna göre sırala','carried_forward' => 'Bilinen son değer','carried_forward_hint' => 'Sağlayıcı kullanılamıyordu; bu, bilinen son takipçi sayısıdır.',diff --git a/lang/tr/mcp.php b/lang/tr/mcp.phpindex 95eb07bdf..45da1d392 100644--- a/lang/tr/mcp.php+++ b/lang/tr/mcp.php@@ -65,8 +65,7 @@ return ['login' => 'TryPost’a giriş yap ve workspace’i seç',],'chatgpt' => [- 'developer' => 'ChatGPT ayarlarında Geliştirici modunu aç',- 'create' => 'TryPost adlı bir uygulama oluştur ve URL’yi yapıştır',+ 'open' => 'ChatGPT’de TryPost’u aç ve Bağlan’a tıkla','login' => 'TryPost’a giriş yap ve workspace’i seç',],'other' => [diff --git a/lang/uk/analytics.php b/lang/uk/analytics.phpindex f04032541..69d7c1850 100644--- a/lang/uk/analytics.php+++ b/lang/uk/analytics.php@@ -85,8 +85,7 @@ return ['followers_at_start' => 'На старті','followers_gained_in_range' => 'Приріст','no_excerpt' => 'Попередній перегляд тексту недоступний.',- 'published_via_trypost' => 'Опубліковано через TryPost',- 'published_on_network' => 'Опубліковано в соціальній мережі',+ 'published_via' => 'Опубліковано через','top_posts_sort' => 'Сортувати дописи за','carried_forward' => 'Останнє відоме значення','carried_forward_hint' => 'Сервіс був недоступний; показано останню відому кількість підписників.',diff --git a/lang/uk/mcp.php b/lang/uk/mcp.phpindex 79303c9ca..4d8770af6 100644--- a/lang/uk/mcp.php+++ b/lang/uk/mcp.php@@ -65,8 +65,7 @@ return ['login' => 'Увійдіть у TryPost і виберіть workspace',],'chatgpt' => [- 'developer' => 'Увімкніть режим розробника в налаштуваннях ChatGPT',- 'create' => 'Створіть застосунок TryPost і вставте URL',+ 'open' => 'Відкрийте TryPost у ChatGPT і натисніть «Підключити»','login' => 'Увійдіть у TryPost і виберіть workspace',],'other' => [diff --git a/lang/zh/analytics.php b/lang/zh/analytics.phpindex c07181955..cccbcf1f3 100644--- a/lang/zh/analytics.php+++ b/lang/zh/analytics.php@@ -85,8 +85,7 @@ return ['followers_at_start' => '期初','followers_gained_in_range' => '期内新增','no_excerpt' => '没有可用的文字预览。',- 'published_via_trypost' => '通过TryPost发布',- 'published_on_network' => '在社交平台发布',+ 'published_via' => '发布来源:','top_posts_sort' => '帖子排序依据','carried_forward' => '最近已知值','carried_forward_hint' => '服务暂时不可用;这里显示最近已知的粉丝数。',diff --git a/lang/zh/mcp.php b/lang/zh/mcp.phpindex 22718b28b..368658e71 100644--- a/lang/zh/mcp.php+++ b/lang/zh/mcp.php@@ -65,8 +65,7 @@ return ['login' => '登录 TryPost 并选择工作区',],'chatgpt' => [- 'developer' => '在 ChatGPT 设置中开启开发者模式',- 'create' => '创建名为 TryPost 的应用并粘贴 URL',+ 'open' => '在 ChatGPT 中打开 TryPost 并点击“连接”','login' => '登录 TryPost 并选择工作区',],'other' => [diff --git a/resources/css/app.css b/resources/css/app.cssindex 8401f87f8..e60e2125e 100644--- a/resources/css/app.css+++ b/resources/css/app.css@@ -57,6 +57,16 @@--chart-3: #7c3aed;--chart-4: #a78bfa;--chart-5: #ddd6fe;+ --series-1: #7c3aed;+ --series-2: #eb6834;+ --series-3: #1baf7a;+ --series-4: #eda100;+ --series-5: #e87ba4;+ --series-6: #008300;+ --series-7: #2a78d6;+ --series-8: #e34948;+ --series-9: #0891b2;+ --series-10: #a16207;--sidebar: #f7f6f3;--sidebar-foreground: #292928;--sidebar-primary: #ddd6fe;@@ -151,6 +161,16 @@--chart-3: #a78bfa;--chart-4: #7c3aed;--chart-5: #5b21b6;+ --series-1: #9d7af5;+ --series-2: #d95926;+ --series-3: #199e70;+ --series-4: #c98500;+ --series-5: #d55181;+ --series-6: #008300;+ --series-7: #3987e5;+ --series-8: #e66767;+ --series-9: #1f9bb8;+ --series-10: #b07a1a;--sidebar: #111111;--sidebar-foreground: #f7f6f3;--sidebar-primary: #c4b5fd;diff --git a/resources/js/components/AppSidebar.vue b/resources/js/components/AppSidebar.vueindex 8c0d6437d..26b3b7f84 100644--- a/resources/js/components/AppSidebar.vue+++ b/resources/js/components/AppSidebar.vue@@ -134,7 +134,7 @@ const mainNavItems = computed<NavItem[]>(() => [<DropdownMenu><DropdownMenuTrigger as-child><Button- class="h-9 w-full justify-center gap-1.5 rounded-full bg-primary-strong font-medium text-primary-strong-foreground hover:bg-primary-text-hover data-[state=open]:bg-primary-text-hover dark:hover:bg-primary dark:data-[state=open]:bg-primary group-data-[collapsible=icon]:size-8 group-data-[collapsible=icon]:rounded-lg group-data-[collapsible=icon]:px-0"+ class="h-9 w-full justify-center gap-1.5 rounded-lg bg-primary-strong font-medium text-primary-strong-foreground hover:bg-primary-text-hover data-[state=open]:bg-primary-text-hover dark:hover:bg-primary dark:data-[state=open]:bg-primary group-data-[collapsible=icon]:size-8 group-data-[collapsible=icon]:px-0":aria-label="$t('sidebar.new')"data-testid="sidebar-new">diff --git a/resources/js/components/ChannelAvatar.vue b/resources/js/components/ChannelAvatar.vueindex 0843868a3..30b98a8e2 100644--- a/resources/js/components/ChannelAvatar.vue+++ b/resources/js/components/ChannelAvatar.vue@@ -48,7 +48,7 @@ const SIZES: Record<ChannelAvatarSize, SizeSpec> = {verified: '-top-1 -end-1 size-2.5',},24: {- avatar: 'size-6 rounded-full',+ avatar: 'size-6 rounded-md',fallback: 'text-[9px]',badge: 12,offset: '-end-1 -bottom-0.5',@@ -116,6 +116,8 @@ const props = withDefaults(badge?: boolean;avatarClass?: HTMLAttributes['class'];verified?: VerifiedBadgeType | null;+ /** `square` keeps the system's rounded square; `round` makes a circle. */+ shape?: 'square' | 'round';}>(),{src: null,@@ -127,6 +129,7 @@ const props = withDefaults(badge: true,avatarClass: undefined,verified: null,+ shape: 'square',},);@@ -152,7 +155,7 @@ const disconnected = computed(() => isConnectionLost({ status: props.status }));<Avatar:src="src":name="name"- :class="cn(spec.avatar, avatarClass)"+ :class="cn(spec.avatar, shape === 'round' && 'rounded-full', avatarClass)":fallback-class="['bg-secondary font-bold', spec.fallback]"/><PlatformLogodiff --git a/resources/js/components/analytics/AnalyticsRangePresets.vue b/resources/js/components/analytics/AnalyticsRangePresets.vueindex 4f9679e1a..4e363ab1d 100644--- a/resources/js/components/analytics/AnalyticsRangePresets.vue+++ b/resources/js/components/analytics/AnalyticsRangePresets.vue@@ -108,6 +108,7 @@ const changeRange = (range: { start: Date; end: Date }): void => {:model-value="selectedRange":min-date="bounds.min ? dayjs(bounds.min).toDate() : undefined":max-date="bounds.max ? dayjs(bounds.max).toDate() : undefined"+ sheet-below-sm@update:model-value="changeRange"><template #trigger>@@ -145,6 +146,7 @@ const changeRange = (range: { start: Date; end: Date }): void => {:model-value="selectedRange":min-date="bounds.min ? dayjs(bounds.min).toDate() : undefined":max-date="bounds.max ? dayjs(bounds.max).toDate() : undefined"+ align="start"@update:model-value="changeRange"><template #trigger>diff --git a/resources/js/components/analytics/MetricChange.vue b/resources/js/components/analytics/MetricChange.vuenew file mode 100644index 000000000..0d932b78d--- /dev/null+++ b/resources/js/components/analytics/MetricChange.vue@@ -0,0 +1,55 @@+<script setup lang="ts">+import { IconMinus, IconTrendingDown, IconTrendingUp } from '@tabler/icons-vue';+import { computed } from 'vue';++const props = withDefaults(+ defineProps<{+ change: number;+ label: string;+ compact?: boolean;+ }>(),+ { compact: false },+);++const tone = computed((): string => {+ if (props.change > 0) {+ return 'text-success-text';+ }++ if (props.change < 0) {+ return 'text-destructive-text';+ }++ return 'text-muted-foreground';+});+</script>++<template>+ <span+ class="inline-flex shrink-0 items-center font-semibold whitespace-nowrap tabular-nums"+ :class="[tone, compact ? 'gap-1 text-xs' : 'gap-1 text-sm']"+ >+ <IconTrendingUp+ v-if="change > 0"+ :class="compact ? 'size-3.5' : 'size-4'"+ class="shrink-0"+ :stroke-width="2.5"+ aria-hidden="true"+ />+ <IconTrendingDown+ v-else-if="change < 0"+ :class="compact ? 'size-3.5' : 'size-4'"+ class="shrink-0"+ :stroke-width="2.5"+ aria-hidden="true"+ />+ <IconMinus+ v-else+ :class="compact ? 'size-3.5' : 'size-4'"+ class="shrink-0"+ :stroke-width="2.5"+ aria-hidden="true"+ />+ {{ label }}+ </span>+</template>diff --git a/resources/js/components/analytics/channel/ChannelMetricsCard.vue b/resources/js/components/analytics/channel/ChannelMetricsCard.vueindex aa8de7590..10497e39c 100644--- a/resources/js/components/analytics/channel/ChannelMetricsCard.vue+++ b/resources/js/components/analytics/channel/ChannelMetricsCard.vue@@ -20,6 +20,7 @@ import {import { wTrans } from 'laravel-vue-i18n';import { computed, ref, type Component } from 'vue';+import AnalyticsModeToggle from '@/components/analytics/workspace/AnalyticsModeToggle.vue';import AnalyticsSection from '@/components/analytics/workspace/AnalyticsSection.vue';import { Button } from '@/components/ui/button';import {@@ -81,17 +82,19 @@ const modes = [{mode: 'current',label: 'analytics.channel.this_period',+ test: 'insights-metrics-mode-current',icon: IconSquareFilled,},{mode: 'previous',label: 'analytics.channel.metrics_card.comparison',+ test: 'insights-metrics-mode-previous',icon: IconSquareDashed,},{mode: 'both',label: 'analytics.channel.metrics_card.both',- icon: null,+ test: 'insights-metrics-mode-both',},] as const;const SELECTED = 'border-transparent bg-primary-selected text-primary-text hover:bg-primary-selected hover:text-primary-text';@@ -254,8 +257,8 @@ const choosePreset = (preset: PresetKey): void => {selection.value = { kind: 'preset', preset };};-const changeMode = (value: ChartMode): void => {- mode.value = value;+const changeMode = (value: string): void => {+ mode.value = value as ChartMode;};</script>@@ -292,13 +295,13 @@ const changeMode = (value: ChartMode): void => {data-testid="insights-metrics-skeleton"aria-busy="true">- <div class="flex flex-wrap gap-2 px-2 pb-1">+ <div class="flex flex-wrap gap-2 pb-2"><Skeleton class="h-7 w-24 rounded-md" /><Skeleton class="h-7 w-32 rounded-md" /><Skeleton class="h-7 w-32 rounded-md" /><Skeleton class="h-7 w-24 rounded-md" /></div>- <div class="rounded-lg border border-border bg-card p-4 sm:p-5">+ <div><div class="mb-6 flex gap-6"><Skeleton class="h-12 w-20" /><Skeleton class="h-12 w-20" />@@ -309,7 +312,7 @@ const changeMode = (value: ChartMode): void => {<template v-else><div- class="flex flex-wrap items-center gap-2 px-2 pb-3"+ class="flex flex-wrap items-center gap-2 pb-5"data-testid="insights-metrics-controls"><div@@ -433,12 +436,10 @@ const changeMode = (value: ChartMode): void => {</TooltipProvider></div>- <div- class="min-w-0 overflow-hidden rounded-lg border border-border bg-card"- >+ <div class="min-w-0"><pv-if="insight && enoughHistory"- class="flex items-center gap-2 bg-info-subtle px-4 py-3 text-sm text-info-text sm:px-5"+ class="mb-5 flex items-center gap-2 rounded-lg bg-info-subtle px-4 py-3 text-sm text-info-text"data-testid="insights-metrics-insight":data-insight="`${insight.subject}.${insight.direction}`">@@ -454,9 +455,9 @@ const changeMode = (value: ChartMode): void => {}}</p>- <div class="p-4 sm:p-5">+ <div><div- class="mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between"+ class="mb-5 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between"><divclass="flex flex-wrap gap-x-8 gap-y-3"@@ -469,7 +470,7 @@ const changeMode = (value: ChartMode): void => {:data-testid="`insights-metrics-legend-${spec.metric}`"><span- class="text-xs whitespace-nowrap text-muted-foreground"+ class="text-sm whitespace-nowrap text-muted-foreground">{{$t(`analytics.channel.series.${spec.metric}`,@@ -490,7 +491,7 @@ const changeMode = (value: ChartMode): void => {"/><span- class="font-heading text-2xl leading-tight font-medium text-foreground tabular-nums"+ class="font-heading text-2xl leading-8 font-medium text-foreground tabular-nums":data-testid="`insights-metrics-legend-${spec.metric}-value`">{{formatSeriesValue(@@ -511,7 +512,7 @@ const changeMode = (value: ChartMode): void => {:style="previousSwatch(spec)"/><span- class="font-heading text-2xl leading-tight font-medium text-muted-foreground tabular-nums"+ class="font-heading text-2xl leading-8 font-medium text-muted-foreground tabular-nums":data-testid="`insights-metrics-legend-${spec.metric}-previous`">{{formatSeriesValue(@@ -526,40 +527,15 @@ const changeMode = (value: ChartMode): void => {</span></div></div>- <div+ <AnalyticsModeTogglev-if="!growthRate"- class="inline-flex items-center gap-0.5 self-start rounded-lg border border-border-strong bg-card p-0.5"- role="group"- :aria-label="- $t(- 'analytics.channel.metrics_card.chart_mode',- )- "+ :model-value="mode"+ label="analytics.channel.metrics_card.chart_mode"+ :options="modes"+ class="self-start"data-testid="insights-metrics-modes"- >- <Button- v-for="option in modes"- :key="option.mode"- variant="ghost"- size="sm"- :class="- mode === option.mode- ? SELECTED- : 'text-muted-foreground'- "- :aria-pressed="mode === option.mode"- :data-testid="`insights-metrics-mode-${option.mode}`"- @click="changeMode(option.mode)"- >- <component- :is="option.icon"- v-if="option.icon"- class="size-3"- aria-hidden="true"- />- {{ $t(option.label) }}- </Button>- </div>+ @update:model-value="changeMode"+ /></div><ChannelMetricsChartdiff --git a/resources/js/components/analytics/channel/ChannelMetricsChart.vue b/resources/js/components/analytics/channel/ChannelMetricsChart.vueindex ed5215fcf..f413ec749 100644--- a/resources/js/components/analytics/channel/ChannelMetricsChart.vue+++ b/resources/js/components/analytics/channel/ChannelMetricsChart.vue@@ -186,7 +186,7 @@ const svgDefs = computed(() =>.filter((spec) => spec.type === 'bar').map((spec) =>- `<pattern id="insights-hatch-${spec.metric}" patternUnits="userSpaceOnUse" width="5" height="5" patternTransform="rotate(45)"><rect width="5" height="5" fill="${spec.color}" fill-opacity="0.12"/><rect width="2" height="5" fill="${spec.color}"/></pattern>`,+ `<pattern id="insights-hatch-${spec.metric}" patternUnits="userSpaceOnUse" width="5" height="5" patternTransform="rotate(45)"><rect width="5" height="5" style="fill: ${spec.color}" fill-opacity="0.12"/><rect width="2" height="5" style="fill: ${spec.color}"/></pattern>`,).join(''),);@@ -294,7 +294,7 @@ const numTicks = computed(() =>:bar-padding="0.1":group-max-width="28":bar-min-height="0"- :rounded-corners="2"+ :rounded-corners="4":attributes="groupedBarAttributes"/><VisStackedBar@@ -308,8 +308,8 @@ const numTicks = computed(() =>":data-step="1":bar-padding="0.35"- :bar-max-width="18"- :rounded-corners="2"+ :bar-max-width="16"+ :rounded-corners="4":attributes="barAttributes"/><VisLine@@ -344,7 +344,9 @@ const numTicks = computed(() =><ChartCrosshair:template="tooltipTemplate"color="var(--foreground)"- :circle-radius="3"+ :circleRadius="5"+ strokeColor="var(--card)"+ :strokeWidth="2"/><ChartTooltip /></VisXYContainer>diff --git a/resources/js/components/analytics/channel/ChannelMetricsTooltip.vue b/resources/js/components/analytics/channel/ChannelMetricsTooltip.vueindex 3c59bf557..6f3f6959e 100644--- a/resources/js/components/analytics/channel/ChannelMetricsTooltip.vue+++ b/resources/js/components/analytics/channel/ChannelMetricsTooltip.vue@@ -55,35 +55,44 @@ const display = (<template><div- class="min-w-44 rounded-lg border border-border-strong bg-popover px-4 py-3 text-xs text-muted-foreground shadow-md"+ class="min-w-52 overflow-hidden rounded-xl bg-popover text-xs text-popover-foreground shadow-md ring-1 ring-foreground/5 dark:ring-border"data-testid="insights-metrics-tooltip"><divv-for="period in periods":key="period.key"- class="grid gap-1 not-first:mt-3"+ class="not-first:border-t not-first:border-border":data-testid="`insights-metrics-tooltip-${period.key}`">- <p>{{ dateLabel(period.point) }}</p>- <div- v-for="spec in specs"- :key="spec.metric"- class="flex items-center justify-between gap-4"+ <p+ class="px-3 pt-2.5 font-medium"+ :class="period.dashed ? 'text-muted-foreground' : 'text-foreground'">- <span class="inline-flex min-w-0 items-center gap-1.5">+ {{ dateLabel(period.point) }}+ </p>+ <div class="grid gap-1.5 px-3 pt-2 pb-2.5">+ <div+ v-for="spec in specs"+ :key="spec.metric"+ class="flex items-center justify-between gap-6"+ ><span- class="size-2.5 shrink-0 rounded-[3px]"- :style="- period.dashed- ? { border: `1.5px dashed ${spec.color}` }- : { backgroundColor: spec.color }- "- />- <span class="truncate">{{ labels[spec.metric] }}</span>- </span>- <span class="font-semibold text-foreground tabular-nums">{{- display(period.point?.values[spec.metric], spec.metric)- }}</span>+ class="inline-flex min-w-0 items-center gap-2 text-muted-foreground"+ >+ <span+ class="size-2.5 shrink-0 rounded-[3px]"+ :style="+ period.dashed+ ? { border: `1.5px dashed ${spec.color}` }+ : { backgroundColor: spec.color }+ "+ />+ <span class="truncate">{{ labels[spec.metric] }}</span>+ </span>+ <span class="font-medium text-foreground tabular-nums">{{+ display(period.point?.values[spec.metric], spec.metric)+ }}</span>+ </div></div></div></div>diff --git a/resources/js/components/analytics/channel/ChannelPublicationTable.vue b/resources/js/components/analytics/channel/ChannelPublicationTable.vueindex 654a64b72..d2693849b 100644--- a/resources/js/components/analytics/channel/ChannelPublicationTable.vue+++ b/resources/js/components/analytics/channel/ChannelPublicationTable.vue@@ -322,6 +322,7 @@ const display = (row: ChannelPublicationRow, key: SummaryMetric): string => {:info="$t('analytics.insights.about.channel_posts')"info-testid="insights-posts-about":range="periodRange"+ flush><template #actions><AnalyticsModeToggle@@ -333,7 +334,7 @@ const display = (row: ChannelPublicationRow, key: SummaryMetric): string => {</template><div- class="min-w-0 overflow-hidden rounded-lg border border-border bg-card transition-opacity"+ class="min-w-0 border-t border-border transition-opacity":class="{ 'opacity-60': isReloading }":aria-busy="isReloading">@@ -349,10 +350,10 @@ const display = (row: ChannelPublicationRow, key: SummaryMetric): string => {<Table class="min-w-[720px]" data-testid="insights-posts"><TableHeader><TableRow- class="border-border-strong hover:bg-transparent"+ class="border-border bg-muted/60 hover:bg-muted/60"><TableHead- class="h-12 border-r-0 px-4 py-3 leading-[17.5px]"+ class="h-10 border-r-0 px-4 py-2 text-xs font-medium text-muted-foreground sm:ps-5">{{$t('analytics.channel.posts_count', {@@ -363,7 +364,7 @@ const display = (row: ChannelPublicationRow, key: SummaryMetric): string => {<TableHeadv-for="column in columns":key="column"- class="h-12 border-r-0 px-4 py-3 leading-[17.5px]"+ class="h-10 border-r-0 px-4 py-2 text-xs font-medium text-muted-foreground":aria-sort="filters.sort === column? 'descending'@@ -404,7 +405,7 @@ const display = (row: ChannelPublicationRow, key: SummaryMetric): string => {</button></TableHead><TableHead- class="sticky right-0 h-12 w-12 border-r-0 bg-card px-2 py-3 text-right"+ class="sticky right-0 h-10 w-12 border-r-0 bg-muted px-2 py-1 text-right sm:pe-3"><DropdownMenu><DropdownMenuTrigger as-child>@@ -464,10 +465,10 @@ const display = (row: ChannelPublicationRow, key: SummaryMetric): string => {<TableRowv-for="row in rows":key="row.id"- class="border-border-strong last:border-b-0"+ class="border-border last:border-b-0":data-testid="`insights-posts-row-${row.id}`">- <TableCell class="border-r-0 px-4 py-3">+ <TableCell class="border-r-0 px-4 py-3 sm:ps-5"><buttontype="button"class="flex max-w-md min-w-0 items-center gap-3 rounded-md text-left focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring"@@ -475,7 +476,7 @@ const display = (row: ChannelPublicationRow, key: SummaryMetric): string => {@click="openRow(row)"><span- class="w-7 shrink-0 text-sm text-muted-foreground tabular-nums"+ class="inline-flex h-6 min-w-7 shrink-0 items-center justify-center rounded-md bg-accent px-1.5 text-xs font-medium text-foreground tabular-nums":data-testid="`insights-posts-rank-${row.id}`">#{{ row.rank }}</span>@@ -546,12 +547,12 @@ const display = (row: ChannelPublicationRow, key: SummaryMetric): string => {<TableCellv-for="column in columns":key="column"- class="border-r-0 px-4 py-3 tabular-nums"+ class="border-r-0 px-4 py-3 text-foreground tabular-nums">{{ display(row, column) }}</TableCell><TableCell- class="border-r-0 px-2 py-3 text-right"+ class="border-r-0 px-2 py-3 text-right sm:pe-3"><DropdownMenu><DropdownMenuTrigger as-child>@@ -631,7 +632,7 @@ const display = (row: ChannelPublicationRow, key: SummaryMetric): string => {</div><navv-if="lastPage > 1"- class="flex items-center justify-center gap-1 pt-3 pb-1"+ class="flex items-center justify-center gap-1 border-t border-border px-4 py-3":aria-label="$t('analytics.channel.pagination.label')"data-testid="insights-posts-pagination">diff --git a/resources/js/components/analytics/workspace/AccountIdentity.vue b/resources/js/components/analytics/workspace/AccountIdentity.vueindex 0c049c10e..fedc56f77 100644--- a/resources/js/components/analytics/workspace/AccountIdentity.vue+++ b/resources/js/components/analytics/workspace/AccountIdentity.vue@@ -13,18 +13,30 @@ const props = defineProps<{withAvatar?: boolean;avatarSize?: 24 | 32;color?: string;+ /** The name on top and the @handle below it. */+ withName?: boolean;}>();const label = computed(() =>props.account.username? `@${props.account.username}`: props.account.name || getPlatformLabel(props.account.platform),);+const name = computed(+ () =>+ props.account.name ||+ label.value,+);+const handle = computed(() =>+ props.account.name && props.account.username+ ? `@${props.account.username}`+ : null,+);</script><template><spanclass="inline-flex min-w-0 items-center"- :class="withAvatar ? 'gap-3' : 'gap-2'"+ :class="withAvatar && !withName ? 'gap-3' : 'gap-2'"><spanv-if="color"@@ -36,11 +48,12 @@ const label = computed(() =>v-if="withAvatar":platform="account.platform":src="account.avatar_url"- :name="label"+ :name="withName ? name : label"ring="card":size="avatarSize ?? 32":status="account.status":account-id="account.social_account_key"+ :verified="account.verified_badge"/><imgv-else@@ -48,7 +61,18 @@ const label = computed(() =>:alt="getPlatformLabel(account.platform)"class="size-4 shrink-0 rounded-sm object-contain"/>+ <span v-if="withName" class="flex min-w-0 flex-col">+ <span class="truncate text-xs font-emphasis text-foreground">{{+ name+ }}</span>+ <span+ v-if="handle"+ class="truncate text-xs text-muted-foreground"+ >{{ handle }}</span+ >+ </span><span+ v-elseclass="truncate text-sm text-foreground":title="`${label} · ${getPlatformLabel(account.platform)}`">{{ label }}</spandiff --git a/resources/js/components/analytics/workspace/AnalyticsModeToggle.vue b/resources/js/components/analytics/workspace/AnalyticsModeToggle.vueindex 902e44ffb..3f9642996 100644--- a/resources/js/components/analytics/workspace/AnalyticsModeToggle.vue+++ b/resources/js/components/analytics/workspace/AnalyticsModeToggle.vue@@ -1,10 +1,16 @@<script setup lang="ts">import { trans } from 'laravel-vue-i18n';+import type { Component } from 'vue';defineProps<{modelValue: string;label: string;- options: readonly { mode: string; label: string; test: string }[];+ options: readonly {+ mode: string;+ label: string;+ test: string;+ icon?: Component;+ }[];}>();const emit = defineEmits<{ 'update:modelValue': [value: string] }>();@@ -12,7 +18,7 @@ const emit = defineEmits<{ 'update:modelValue': [value: string] }>();<template><div- class="inline-flex h-8 items-center gap-1 rounded-lg border border-border-strong bg-card p-[3px]"+ class="inline-flex items-center gap-1 rounded-lg border border-border-strong p-1"role="group":aria-label="trans(label)">@@ -21,7 +27,7 @@ const emit = defineEmits<{ 'update:modelValue': [value: string] }>();:key="option.mode"type="button":data-testid="option.test"- class="inline-flex h-6 items-center rounded-md px-2 text-sm font-medium whitespace-nowrap transition-control focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-ring"+ class="inline-flex h-6 shrink-0 items-center gap-1 rounded-md px-2 text-sm font-medium whitespace-nowrap transition-control focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-ring":class="modelValue === option.mode? 'bg-primary-selected text-primary-text'@@ -30,6 +36,12 @@ const emit = defineEmits<{ 'update:modelValue': [value: string] }>();:aria-pressed="modelValue === option.mode"@click="emit('update:modelValue', option.mode)">+ <component+ :is="option.icon"+ v-if="option.icon"+ class="size-3.5"+ aria-hidden="true"+ />{{ trans(option.label) }}</button></div>diff --git a/resources/js/components/analytics/workspace/AnalyticsSection.vue b/resources/js/components/analytics/workspace/AnalyticsSection.vueindex fc1e4d2bc..212384456 100644--- a/resources/js/components/analytics/workspace/AnalyticsSection.vue+++ b/resources/js/components/analytics/workspace/AnalyticsSection.vue@@ -11,21 +11,22 @@ defineProps<{subtitle?: string;subtitleTestid?: string;range?: WorkspaceAnalyticsReport['range'];+ flush?: boolean;}>();</script><template><section- class="min-w-0 rounded-xl bg-muted p-2 dark:bg-background"+ class="min-w-0 overflow-hidden rounded-xl border border-border bg-card"data-testid="analytics-section"><div- class="flex flex-wrap items-center justify-between gap-x-2 gap-y-2 px-2 pt-2 pb-3"+ class="flex flex-wrap items-center justify-between gap-x-3 gap-y-2 px-4 pt-4 pb-4 sm:px-5"><div class="flex min-w-0 flex-col gap-1"><div class="-my-0.5 flex min-w-0 items-center gap-1"><h2- class="text-base leading-5 font-emphasis text-foreground"+ class="font-heading text-base leading-6 font-medium text-foreground"data-testid="analytics-section-title">{{ title }}@@ -48,6 +49,8 @@ defineProps<{</div><slot name="actions" /></div>- <slot />+ <div :class="flush ? 'min-w-0' : 'min-w-0 px-4 pb-4 sm:px-5 sm:pb-5'">+ <slot />+ </div></section></template>diff --git a/resources/js/components/analytics/workspace/FollowersChart.vue b/resources/js/components/analytics/workspace/FollowersChart.vueindex af6810e5a..a8ecaf603 100644--- a/resources/js/components/analytics/workspace/FollowersChart.vue+++ b/resources/js/components/analytics/workspace/FollowersChart.vue@@ -121,7 +121,7 @@ const rangeLabel = computed(<divv-if="followers.accounts.length === 0"data-testid="analytics-followers-empty"- class="rounded-lg border border-dashed border-border-strong bg-card px-5 py-12 text-center text-sm text-muted-foreground"+ class="rounded-lg border border-dashed border-border-strong px-5 py-12 text-center text-sm text-muted-foreground">{{$t(@@ -131,13 +131,10 @@ const rangeLabel = computed()}}</div>- <div- v-else- class="min-w-0 rounded-lg border border-border bg-card p-4 sm:p-5"- >- <div class="mb-4 flex flex-wrap items-baseline gap-2">+ <div v-else class="min-w-0">+ <div class="mb-5 flex flex-wrap items-baseline gap-2"><span- class="font-heading text-[28px] leading-[35px] font-medium tabular-nums"+ class="font-heading text-[28px] leading-[35px] font-medium text-foreground tabular-nums">{{followers.total === null? '—'@@ -148,7 +145,7 @@ const rangeLabel = computed($t('analytics.dashboard.total_followers')}}</span></div>- <div class="min-w-0 border-t border-border pt-5">+ <div class="min-w-0"><FollowerHistoryLineChartv-if="mode === 'line'":accounts="followers.accounts"@@ -195,12 +192,12 @@ const rangeLabel = computed(</span></div><div- class="mt-5 grid gap-x-5 gap-y-2.5 border-t border-border pt-4 sm:grid-cols-2 xl:grid-cols-3"+ class="mt-5 grid gap-x-8 gap-y-1 border-t border-border pt-4 sm:grid-cols-2 xl:grid-cols-3"><divv-for="account in followers.accounts":key="account.social_account_key"- class="flex min-w-0 items-center justify-between gap-2"+ class="-mx-2 flex min-h-9 min-w-0 items-center justify-between gap-2 rounded-md px-2 transition-control hover:bg-accent/60"><AccountIdentity:account="account"@@ -209,7 +206,7 @@ const rangeLabel = computed(:avatar-size="24"/><span class="flex shrink-0 items-center gap-2">- <span class="text-sm font-semibold tabular-nums">+ <span class="text-sm font-medium text-foreground tabular-nums">{{mode === 'growth'? account.growth === nulldiff --git a/resources/js/components/analytics/workspace/PerformanceTable.vue b/resources/js/components/analytics/workspace/PerformanceTable.vueindex d0c9cf154..051aecb45 100644--- a/resources/js/components/analytics/workspace/PerformanceTable.vue+++ b/resources/js/components/analytics/workspace/PerformanceTable.vue@@ -3,11 +3,10 @@ import {IconChevronDown,IconChevronUp,IconTable,- IconTrendingDown,- IconTrendingUp,} from '@tabler/icons-vue';import { computed, ref } from 'vue';+import MetricChange from '@/components/analytics/MetricChange.vue';import { Checkbox } from '@/components/ui/checkbox';import {DropdownMenu,@@ -132,6 +131,7 @@ const change = (row: PerformanceRow, key: PerformanceMetric): string => {})"subtitle-testid="analytics-performance-caption"+ flush><template #actions><DropdownMenu>@@ -183,29 +183,27 @@ const change = (row: PerformanceRow, key: PerformanceMetric): string => {</DropdownMenuContent></DropdownMenu></template>- <div- v-if="rows.length === 0"- data-testid="analytics-performance-empty"- class="rounded-lg border border-dashed border-border-strong bg-card px-5 py-10 text-center text-sm text-muted-foreground"- >- {{- $t(- filtered- ? 'analytics.dashboard.filtered_no_posts'- : 'analytics.dashboard.no_performance',- )- }}+ <div v-if="rows.length === 0" class="px-4 pb-4 sm:px-5 sm:pb-5">+ <div+ data-testid="analytics-performance-empty"+ class="rounded-lg border border-dashed border-border-strong px-5 py-10 text-center text-sm text-muted-foreground"+ >+ {{+ $t(+ filtered+ ? 'analytics.dashboard.filtered_no_posts'+ : 'analytics.dashboard.no_performance',+ )+ }}+ </div></div>- <div- v-else- class="min-w-0 rounded-lg border border-border bg-card"- >- <div class="min-w-0 overflow-x-auto rounded-lg">+ <div v-else class="min-w-0 border-t border-border">+ <div class="min-w-0 overflow-x-auto"><Table class="min-w-[720px]"><TableHeader>- <TableRow class="border-border-strong hover:bg-transparent">+ <TableRow class="border-border bg-muted/60 hover:bg-muted/60"><TableHead- class="h-12 border-r-0 px-4 py-3 leading-[17.5px]"+ class="h-10 border-r-0 px-4 py-2 text-xs font-medium text-muted-foreground sm:ps-5":aria-sort="ariaSort('channel')"data-testid="analytics-performance-channel-header">@@ -236,7 +234,7 @@ const change = (row: PerformanceRow, key: PerformanceMetric): string => {<TableHeadv-for="column in columns":key="column"- class="h-12 border-r-0 px-4 py-3 leading-[17.5px] whitespace-nowrap"+ class="h-10 border-r-0 px-4 py-2 text-xs font-medium whitespace-nowrap text-muted-foreground":aria-sort="ariaSort(column)":data-testid="`analytics-performance-column-${column}`">@@ -274,11 +272,11 @@ const change = (row: PerformanceRow, key: PerformanceMetric): string => {<TableRowv-for="row in sorted":key="row.social_account_key"- class="border-border-strong last:border-b-0"+ class="border-border last:border-b-0"><thscope="row"- class="border-r-0 px-4 py-3 text-left font-normal"+ class="border-r-0 px-4 py-3 text-start font-normal sm:ps-5"><AccountIdentity :account="row" with-avatar /></th>@@ -287,26 +285,16 @@ const change = (row: PerformanceRow, key: PerformanceMetric): string => {:key="column"class="border-r-0 px-4 py-3 whitespace-nowrap tabular-nums">- <span class="inline-flex items-center gap-2">- <span class="text-sm text-foreground">{{+ <span class="inline-flex items-center gap-2.5">+ <span class="text-sm font-medium text-foreground">{{display(row, column)}}</span>- <span+ <MetricChangev-if="row[column].change !== null"- class="inline-flex items-center gap-1 text-xs text-foreground"- >- <IconTrendingUp- v-if="row[column].change! >= 0"- class="size-4 shrink-0 text-success-text"- aria-hidden="true"- />- <IconTrendingDown- v-else- class="size-4 shrink-0 text-destructive-text"- aria-hidden="true"- />- {{ change(row, column) }}- </span>+ :change="row[column].change!"+ :label="change(row, column)"+ compact+ /></span></TableCell></TableRow>diff --git a/resources/js/components/analytics/workspace/PostsChart.vue b/resources/js/components/analytics/workspace/PostsChart.vueindex 286f4ef3f..34942821a 100644--- a/resources/js/components/analytics/workspace/PostsChart.vue+++ b/resources/js/components/analytics/workspace/PostsChart.vue@@ -69,7 +69,7 @@ const rangeLabel = computed(<divv-if="posts.accounts.length === 0"data-testid="analytics-posts-empty"- class="rounded-lg border border-dashed border-border-strong bg-card px-5 py-12 text-center text-sm text-muted-foreground"+ class="rounded-lg border border-dashed border-border-strong px-5 py-12 text-center text-sm text-muted-foreground">{{$t(@@ -79,10 +79,7 @@ const rangeLabel = computed()}}</div>- <div- v-else- class="min-w-0 rounded-lg border border-border bg-card p-4 sm:p-5"- >+ <div v-else class="min-w-0"><div class="min-w-0"><SocialAccountMetricBarChartv-if="mode === 'bar'"@@ -105,12 +102,12 @@ const rangeLabel = computed(/></div><div- class="mt-5 grid gap-x-5 gap-y-2.5 border-t border-border pt-4 sm:grid-cols-2 xl:grid-cols-3"+ class="mt-5 grid gap-x-8 gap-y-1 border-t border-border pt-4 sm:grid-cols-2 xl:grid-cols-3"><divv-for="account in posts.accounts":key="account.social_account_key"- class="flex min-w-0 items-center justify-between gap-2"+ class="-mx-2 flex min-h-9 min-w-0 items-center justify-between gap-2 rounded-md px-2 transition-control hover:bg-accent/60"><AccountIdentity:account="account"@@ -118,7 +115,7 @@ const rangeLabel = computed(with-avatar:avatar-size="24"/>- <span class="shrink-0 text-sm font-semibold tabular-nums">+ <span class="shrink-0 text-sm font-medium text-foreground tabular-nums">{{ formatNumberCompact(account.count) }}</span></div>diff --git a/resources/js/components/analytics/workspace/SummaryCards.vue b/resources/js/components/analytics/workspace/SummaryCards.vueindex 9bed481bf..f1d2551b7 100644--- a/resources/js/components/analytics/workspace/SummaryCards.vue+++ b/resources/js/components/analytics/workspace/SummaryCards.vue@@ -1,7 +1,7 @@<script setup lang="ts">-import { IconMinus, IconTrendingDown, IconTrendingUp } from '@tabler/icons-vue';import { computed } from 'vue';+import MetricChange from '@/components/analytics/MetricChange.vue';import {formatNumberCompact,formatPercent,@@ -64,6 +64,20 @@ const cards = computed(() =>: defaultCards.value,);+const desktopColumns = computed((): string => {+ const count = cards.value.length;++ if (count <= 3) {+ return 'lg:grid-cols-3';+ }++ if (count === 4 || (count > 5 && count <= 8)) {+ return 'lg:grid-cols-4';+ }++ return 'lg:grid-cols-5';+});+const aboutKey = (key: string): string =>key === 'reactions' && props.network? 'analytics.channel.metrics.reactions.about_network'@@ -92,19 +106,21 @@ const changeLabel = (key: string, change: number | null): string | null => {:title="$t('analytics.dashboard.summary')":subtitle="subtitle":subtitle-testid="subtitleTestid"+ flush><div- class="grid grid-cols-2 gap-2 sm:grid-cols-[repeat(auto-fit,minmax(200px,1fr))]"+ class="grid grid-cols-2 border-t border-border md:grid-cols-3"+ :class="desktopColumns"data-testid="analytics-summary"><divv-for="card in cards":key="card.key":data-testid="testId(card.key)"- class="flex min-w-0 flex-col gap-2 rounded-lg border border-border bg-card px-4 py-3"+ class="flex min-w-0 flex-col gap-2 px-4 py-4 shadow-[1px_0_0_var(--border),0_1px_0_var(--border)] sm:px-5">- <div class="flex min-h-6 items-center justify-between gap-1">- <p class="truncate text-xs text-muted-foreground">+ <div class="flex min-h-6 items-center gap-0.5">+ <p class="truncate text-sm text-muted-foreground">{{ $t(card.label) }}</p><InfoTip@@ -112,37 +128,23 @@ const changeLabel = (key: string, change: number | null): string | null => {:test-id="`${testId(card.key)}-about`"/></div>- <div class="flex flex-wrap items-center gap-x-2 gap-y-1">+ <div class="flex flex-wrap items-center gap-x-3 gap-y-1"><span- class="font-heading text-xl leading-tight font-medium text-foreground tabular-nums"+ class="font-heading text-2xl leading-8 font-medium text-foreground tabular-nums">{{ display(card.metric.value, card.percent) }}</span>- <span+ <MetricChangev-if="changeLabel(card.key, card.metric.change)":data-testid="`${testId(card.key)}-change`"- class="inline-flex items-center gap-1 text-xs text-foreground tabular-nums"- >- <IconTrendingUp- v-if="card.metric.change! > 0"- class="size-4 shrink-0 text-success-text"- aria-hidden="true"- />- <IconMinus- v-else-if="card.metric.change === 0"- class="size-4 shrink-0 text-muted-foreground"- aria-hidden="true"- />- <IconTrendingDown- v-else- class="size-4 shrink-0 text-destructive-text"- aria-hidden="true"- />- {{ changeLabel(card.key, card.metric.change) }}- </span>+ :change="card.metric.change!"+ :label="changeLabel(card.key, card.metric.change)!"+ /></div></div></div>- <p class="px-2 pt-3 pb-1 text-xs text-muted-foreground">+ <p+ class="border-t border-border px-4 py-3 text-xs text-muted-foreground sm:px-5"+ >{{ $t('analytics.dashboard.latest_snapshot_hint') }}</p></AnalyticsSection>diff --git a/resources/js/components/analytics/workspace/TopPosts.vue b/resources/js/components/analytics/workspace/TopPosts.vueindex f7bf08d5f..12b4c28ca 100644--- a/resources/js/components/analytics/workspace/TopPosts.vue+++ b/resources/js/components/analytics/workspace/TopPosts.vue@@ -1,9 +1,8 @@<script setup lang="ts">-import { IconArrowUpRight } from '@tabler/icons-vue';import { computed, ref } from 'vue';-import PublicationTypeBadge from '@/components/analytics/PublicationTypeBadge.vue';-import ChannelAvatar from '@/components/ChannelAvatar.vue';+import AppLogo from '@/components/AppLogo.vue';+import PlatformBrandIcon from '@/components/PlatformBrandIcon.vue';import PostDetailsDialog from '@/components/publish/PostDetailsDialog.vue';import PublicationDetailsDialog from '@/components/publish/PublicationDetailsDialog.vue';import { getPlatformLabel } from '@/composables/usePlatformLogo';@@ -13,7 +12,9 @@ import { isImage, isVideo } from '@/lib/mediaType';import { formatNumberCompact } from '@/lib/utils';import { videoFrameUrl } from '@/lib/videoFrame';import type { TopPost, WorkspaceAnalyticsReport } from '@/types/analytics';+import { Platform } from '@/types/platform';+import AccountIdentity from './AccountIdentity.vue';import AnalyticsModeToggle from './AnalyticsModeToggle.vue';import AnalyticsSection from './AnalyticsSection.vue';@@ -74,6 +75,7 @@ const thumbnailFor = (post: TopPost): string | null => {:info="$t('analytics.insights.about.top_posts')"info-testid="analytics-top-posts-about":range="range"+ flush><template #actions><AnalyticsModeToggle@@ -83,131 +85,117 @@ const thumbnailFor = (post: TopPost): string | null => {/></template>- <div- v-if="posts.length === 0"- data-testid="analytics-top-posts-empty"- class="rounded-lg border border-dashed border-border-strong bg-card px-5 py-10 text-center text-sm text-muted-foreground"- >- {{- $t(- filtered- ? 'analytics.dashboard.filtered_no_posts'- : 'analytics.dashboard.no_ranked_posts',- )- }}+ <div v-if="posts.length === 0" class="px-4 pb-4 sm:px-5 sm:pb-5">+ <div+ data-testid="analytics-top-posts-empty"+ class="rounded-lg border border-dashed border-border-strong px-5 py-10 text-center text-sm text-muted-foreground"+ >+ {{+ $t(+ filtered+ ? 'analytics.dashboard.filtered_no_posts'+ : 'analytics.dashboard.no_ranked_posts',+ )+ }}+ </div></div><divv-else- class="grid gap-3 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-5"+ class="grid border-t border-border sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-5"><articlev-for="(post, index) in posts":key="post.id"- class="relative flex min-w-0 flex-col overflow-hidden rounded-xl border border-border bg-secondary transition-control has-[a:hover]:border-border-strong dark:bg-muted"+ class="group relative flex min-w-0 flex-col gap-3 p-4 shadow-[1px_0_0_var(--border),0_1px_0_var(--border)] transition-colors duration-150 has-[button:hover]:bg-muted/60 has-[button:focus-visible]:bg-muted/60 sm:px-5"data-testid="analytics-top-post">- <div class="flex h-8 items-center justify-between gap-2 px-3">- <span class="text-xs text-foreground">#{{ index + 1 }}</span>- <span class="text-xs tabular-nums">- <strong class="font-emphasis text-foreground">{{- formatNumberCompact(post[metric] ?? 0)- }}</strong>- {{ ' ' }}- <span class="font-medium text-muted-foreground">{{+ <div class="mb-1 flex items-stretch justify-between gap-2">+ <div class="flex min-w-0 flex-col">+ <span+ class="font-heading text-2xl leading-8 font-medium text-foreground tabular-nums"+ >{{ formatNumberCompact(post[metric] ?? 0) }}</span+ >+ <span class="text-xs leading-4 text-muted-foreground">{{$t(`analytics.dashboard.${metric}`)}}</span>- </span>- </div>- <div- class="flex flex-1 flex-col gap-2 rounded-t-lg border-t border-border bg-card p-3"- >- <div- class="flex min-h-6 min-w-0 items-center justify-between gap-2"- >+ </div>+ <div class="flex shrink-0 flex-col items-end justify-between gap-1"><span- class="inline-flex min-w-0 items-center gap-1 text-xs text-foreground"- :title="- post.username- ? `@${post.username}`- : (post.name ?? undefined)- "+ class="inline-flex h-6 min-w-7 items-center justify-center rounded-md bg-primary-selected px-1.5 text-xs font-semibold text-primary-text tabular-nums"+ :data-testid="`analytics-top-post-rank-${post.id}`"+ >#{{ index + 1 }}</span>- <ChannelAvatar- :platform="post.platform"- :src="post.avatar_url"- :name="- post.username- ? `@${post.username}`- : (post.name ??- getPlatformLabel(post.platform))- "- :size="24"- ring="card"- :status="post.status"- :account-id="post.social_account_key"- data-testid="analytics-top-post-channel"- />- <span class="truncate">{{- date.formatDateShort(post.published_at)- }}</span>- </span>- <PublicationTypeBadge- :platform="post.platform"- :content-type="post.content_type"- :test-id="`analytics-top-post-type-${post.id}`"- />- </div>- <div class="flex min-h-[54px] gap-3">- <p- class="line-clamp-3 min-w-0 flex-1 text-xs text-foreground"+ <span+ class="text-xs leading-4 whitespace-nowrap text-muted-foreground"+ :data-testid="`analytics-top-post-date-${post.id}`"+ >{{ date.formatDayMonthYear(post.published_at) }}</span>- {{- post.excerpt ||- $t('analytics.dashboard.no_excerpt')- }}- </p>- <video- v-if="post.media && isVideo(post.media)"- :src="videoFrameUrl(post.media)"- class="size-11 shrink-0 rounded-md object-cover"- muted- playsinline- preload="metadata"- aria-hidden="true"- :data-testid="`analytics-top-post-video-${post.id}`"- />- <img- v-else-if="thumbnailFor(post)"- :src="thumbnailFor(post)!"- alt=""- loading="lazy"- class="size-11 shrink-0 rounded-md object-cover"- /></div>- <div- class="mt-auto flex min-h-8 items-center justify-between gap-2 pt-2 text-xs text-muted-foreground"+ </div>+ <AccountIdentity+ :account="post"+ with-avatar+ with-name+ data-testid="analytics-top-post-channel"+ />+ <div class="flex min-h-[54px] gap-3">+ <p+ class="line-clamp-3 min-w-0 flex-1 text-sm leading-[18px] text-foreground"+ >+ {{ post.excerpt || $t('analytics.dashboard.no_excerpt') }}+ </p>+ <video+ v-if="post.media && isVideo(post.media)"+ :src="videoFrameUrl(post.media)"+ class="size-12 shrink-0 rounded-lg object-cover"+ muted+ playsinline+ preload="metadata"+ aria-hidden="true"+ :data-testid="`analytics-top-post-video-${post.id}`"+ />+ <img+ v-else-if="thumbnailFor(post)"+ :src="thumbnailFor(post)!"+ alt=""+ loading="lazy"+ class="size-12 shrink-0 rounded-lg object-cover"+ />+ </div>+ <div+ class="-mx-4 mt-auto -mb-4 flex min-h-11 items-center justify-center border-t border-border px-4 text-xs text-muted-foreground sm:-mx-5 sm:px-5"+ >+ <span+ class="inline-flex min-w-0 items-center gap-1"+ :data-testid="`analytics-top-post-published-via-${post.id}`">- <span class="line-clamp-1">{{- post.origin === 'trypost'- ? $t(- 'analytics.dashboard.published_via_trypost',- )- : $t('analytics.dashboard.published_on_network')+ <span class="truncate">{{+ $t('analytics.dashboard.published_via')}}</span>- <button- type="button"- data-testid="analytics-top-post-link"- class="inline-flex h-6 shrink-0 items-center gap-0.5 rounded-md px-1.5 font-medium text-foreground transition-control after:absolute after:inset-0 hover:bg-accent focus-visible:outline-2 focus-visible:outline-ring"- @click="openDetails(post)"- >- {{ $t('analytics.detail.details') }}- <IconArrowUpRight- class="size-3.5"- aria-hidden="true"+ <template v-if="post.origin === 'trypost'">+ <AppLogo variant="mark" class="text-[13px]" />+ <span class="shrink-0">TryPost</span>+ </template>+ <template v-else>+ <PlatformBrandIcon+ :platform="post.platform"+ class="size-3.5 shrink-0"/>- </button>- </div>+ <span+ v-if="post.platform !== Platform.X"+ class="shrink-0"+ >{{ getPlatformLabel(post.platform) }}</span+ >+ </template>+ </span></div>+ <button+ type="button"+ data-testid="analytics-top-post-link"+ class="absolute inset-0 cursor-pointer focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring"+ :aria-label="$t('analytics.detail.details')"+ @click="openDetails(post)"+ /></article></div><PublicationDetailsDialogdiff --git a/resources/js/components/analytics/workspace/charts/FollowerHistoryLineChart.vue b/resources/js/components/analytics/workspace/charts/FollowerHistoryLineChart.vueindex cd98e3a38..c3dde5ce8 100644--- a/resources/js/components/analytics/workspace/charts/FollowerHistoryLineChart.vue+++ b/resources/js/components/analytics/workspace/charts/FollowerHistoryLineChart.vue@@ -72,6 +72,11 @@ const tooltipTemplate = computed(() =>labelFormatter: formatDate,}),);+const lineColor = (index: number): string =>+ props.colors[props.accounts[index]?.social_account_key ?? ''] ??+ accountColor(index);+const crosshairColor = (_point: ChartPoint, index: number): string =>+ lineColor(Math.floor(index / 2));</script><template>@@ -87,7 +92,7 @@ const tooltipTemplate = computed(() =>><VisXYContainer:data="chartData"- :padding="{ top: 16, right: 12, bottom: 0, left: 0 }"+ :padding="{ top: 16, right: 12, bottom: 8, left: 0 }"><templatev-for="(account, index) in accounts"@@ -96,21 +101,15 @@ const tooltipTemplate = computed(() =><VisLine:x="xAccessor":y="valueAccessor(index)"- :color="- colors[account.social_account_key] ??- accountColor(index)- "- :line-width="2.5"+ :color="lineColor(index)"+ :line-width="2"curve-type="monotoneX"/><VisScatter:x="xAccessor":y="valueAccessor(index)"- :color="- colors[account.social_account_key] ??- accountColor(index)- "- :size="6"+ :color="lineColor(index)"+ :size="4"/></template><VisAxis@@ -131,8 +130,10 @@ const tooltipTemplate = computed(() =>/><ChartCrosshair:template="tooltipTemplate"- color="var(--foreground)"- :circle-radius="4"+ :color="crosshairColor"+ :circleRadius="5"+ strokeColor="var(--card)"+ :strokeWidth="2"/><ChartTooltip /></VisXYContainer>diff --git a/resources/js/components/analytics/workspace/charts/PostsOverTimeStackedBarChart.vue b/resources/js/components/analytics/workspace/charts/PostsOverTimeStackedBarChart.vueindex 75dafde14..8711799ff 100644--- a/resources/js/components/analytics/workspace/charts/PostsOverTimeStackedBarChart.vue+++ b/resources/js/components/analytics/workspace/charts/PostsOverTimeStackedBarChart.vue@@ -103,19 +103,20 @@ const barAttributes = {<ChartContainer:config="chartConfig"cursor- class="h-72 w-full sm:h-80"+ class="h-72 w-full sm:h-80 [--vis-stacked-bar-stroke-color:var(--card)] [--vis-stacked-bar-stroke-width:1.5px]"data-testid="posts-unovis-chart"><VisXYContainer:data="chartData"- :padding="{ top: 14, right: 8, bottom: 0, left: 0 }"+ :padding="{ top: 14, right: 8, bottom: 8, left: 0 }"><VisStackedBar:x="xAccessor":y="yAccessors":color="barColors"- :rounded-corners="2"+ :rounded-corners="4":bar-padding="0.35"+ :bar-max-width="28":attributes="barAttributes"/><VisAxis@@ -131,7 +132,7 @@ const barAttributes = {:tick-format="formatCountTick":num-ticks="5":label="valueLabel"- label-font-size="12px"+ label-font-size="11px"label-color="var(--muted-foreground)":grid-line="true":domain-line="false"diff --git a/resources/js/components/analytics/workspace/charts/SocialAccountMetricBarChart.vue b/resources/js/components/analytics/workspace/charts/SocialAccountMetricBarChart.vueindex 047d14054..128c5b56b 100644--- a/resources/js/components/analytics/workspace/charts/SocialAccountMetricBarChart.vue+++ b/resources/js/components/analytics/workspace/charts/SocialAccountMetricBarChart.vue@@ -143,6 +143,7 @@ const buildAxisChannel = (account: AccountIdentityData): SVGElement => {ring: 'card',status: account.status ?? null,accountId: account.social_account_key,+ verified: account.verified_badge ?? null,reserveSpace: false,});avatar.appContext = appContext;@@ -196,9 +197,9 @@ const barAttributes = {:y="split ? splitAccessors : valueAccessor":color="colorAccessor"orientation="horizontal"- :rounded-corners="2"- :bar-padding="0.27"- :bar-max-width="27"+ :rounded-corners="4"+ :bar-padding="0.4"+ :bar-max-width="20":attributes="barAttributes"/><VisAxis@@ -206,7 +207,7 @@ const barAttributes = {:tick-format="formatCountTick":num-ticks="5":label="valueLabel"- label-font-size="12px"+ label-font-size="11px"label-color="var(--muted-foreground)":grid-line="true":domain-line="false"diff --git a/resources/js/components/channels/PostingScheduleGenerateMenu.vue b/resources/js/components/channels/PostingScheduleGenerateMenu.vueindex dca13e820..618a17844 100644--- a/resources/js/components/channels/PostingScheduleGenerateMenu.vue+++ b/resources/js/components/channels/PostingScheduleGenerateMenu.vue@@ -174,6 +174,7 @@ const confirmGenerate = (): void => {other.username":size="24"+ shape="round"ring="popover"/><span class="flex min-w-0 flex-col">diff --git a/resources/js/components/mcp/McpConnectDialog.vue b/resources/js/components/mcp/McpConnectDialog.vueindex 90b0096fb..c0d0749c1 100644--- a/resources/js/components/mcp/McpConnectDialog.vue+++ b/resources/js/components/mcp/McpConnectDialog.vue@@ -23,12 +23,12 @@ const props = defineProps<{const open = defineModel<boolean>('open', { default: false });/**- * What to do in each client once its connector page is open. ChatGPT needs- * developer mode before it accepts a custom MCP app.+ * What to do in each client once its connector page is open. ChatGPT lists+ * TryPost in its app store, so there is nothing to paste there.*/const STEPS: Record<McpClientId, string[]> = {claude: ['paste', 'add', 'login'],- chatgpt: ['developer', 'create', 'login'],+ chatgpt: ['open', 'login'],other: ['add', 'paste', 'login'],};@@ -99,6 +99,7 @@ const focusDialogFrame = (event: Event): void => {</ol><div+ v-if="!client.listed"class="overflow-hidden rounded-xl border border-border-strong bg-card"><divdiff --git a/resources/js/components/posts/composer/ComposerAccountStack.vue b/resources/js/components/posts/composer/ComposerAccountStack.vueindex 20674451c..1ccec9a97 100644--- a/resources/js/components/posts/composer/ComposerAccountStack.vue+++ b/resources/js/components/posts/composer/ComposerAccountStack.vue@@ -18,6 +18,7 @@ defineProps<{:src="account.avatar_url":name="account.display_name || account.username":size="24"+ shape="round":reserve-space="false"avatar-class="border border-background"/>diff --git a/resources/js/components/ui/chart/ChartContainer.vue b/resources/js/components/ui/chart/ChartContainer.vueindex c55ecc0d9..ea45b3631 100644--- a/resources/js/components/ui/chart/ChartContainer.vue+++ b/resources/js/components/ui/chart/ChartContainer.vue@@ -55,13 +55,26 @@ provideChartContext({ id, config });'--vis-tooltip-border-color': 'transparent','--vis-tooltip-text-color': 'transparent','--vis-tooltip-shadow-color': 'transparent',- '--vis-crosshair-circle-stroke-color': 'transparent',+ '--vis-crosshair-circle-stroke-color': 'var(--card)',+ '--vis-crosshair-circle-stroke-width': '2px',+ '--vis-crosshair-circle-stroke-opacity': '1',+ '--vis-crosshair-line-stroke-color': 'var(--border-strong)','--vis-crosshair-line-stroke-width': cursor ? '1px' : '0px',+ '--vis-crosshair-line-stroke-dasharray': '4 4',+ '--vis-crosshair-line-stroke-opacity': '1','--vis-font-family': 'var(--font-sans)',+ '--vis-axis-font-family': 'var(--font-sans)','--vis-axis-tick-label-color': 'var(--muted-foreground)','--vis-axis-tick-label-font-size': '11px',- '--vis-axis-grid-color':- 'color-mix(in srgb, var(--foreground) 12%, transparent)',+ '--vis-axis-label-color': 'var(--muted-foreground)',+ '--vis-axis-label-font-size': '11px',+ '--vis-axis-label-weight': '500',+ '--vis-axis-grid-color': 'var(--border)',+ '--vis-axis-grid-line-dasharray': '3 3',+ '--vis-axis-grid-line-width': '1px',+ '--vis-axis-grid-opacity': '1',+ '--vis-axis-domain-color': 'var(--border-strong)',+ '--vis-stacked-bar-hover-stroke-width': '0px',...colorStyles,}">diff --git a/resources/js/components/ui/chart/ChartTooltipContent.vue b/resources/js/components/ui/chart/ChartTooltipContent.vueindex ab4164ec8..8ed288369 100644--- a/resources/js/components/ui/chart/ChartTooltipContent.vue+++ b/resources/js/components/ui/chart/ChartTooltipContent.vue@@ -37,16 +37,21 @@ const entries = computed(() =><template><div- class="min-w-48 rounded-lg border border-border-strong bg-popover px-4 py-3 text-xs text-muted-foreground shadow-md"+ class="min-w-52 overflow-hidden rounded-xl bg-popover text-xs text-popover-foreground shadow-md ring-1 ring-foreground/5 dark:ring-border"data-testid="analytics-chart-tooltip">- <p v-if="x !== undefined" class="mb-2">+ <p+ v-if="x !== undefined"+ class="border-b border-border px-3 py-2 font-medium text-foreground"+ >{{ labelFormatter ? labelFormatter(x) : x }}</p>- <div class="grid gap-1">- <div v-for="entry in entries" :key="entry.key" class="grid gap-1">- <div class="flex items-center justify-between gap-4">- <span class="inline-flex min-w-0 items-center gap-2">+ <div class="grid gap-2 px-3 py-2.5">+ <div v-for="entry in entries" :key="entry.key" class="grid gap-0.5">+ <div class="flex items-center justify-between gap-6">+ <span+ class="inline-flex min-w-0 items-center gap-2 text-muted-foreground"+ ><spandata-testid="analytics-tooltip-swatch"class="size-2.5 shrink-0 rounded-[3px]"@@ -57,21 +62,21 @@ const entries = computed(() =>:platform="entry.item.avatar.platform":name="entry.item.avatar.name":src="entry.item.avatar.src"- :size="24"+ :size="20"ring="popover"data-testid="analytics-tooltip-avatar"/><span class="truncate">{{ entry.item.label }}</span></span><span- class="font-semibold text-foreground tabular-nums"+ class="font-medium text-foreground tabular-nums"data-testid="analytics-tooltip-value">{{ entry.value.toLocaleString(activeLocale) }}</span></div><pv-if="entry.detail"- class="pl-4"+ class="ps-[18px] text-muted-foreground"data-testid="analytics-tooltip-detail">{{ entry.detail }}diff --git a/resources/js/components/ui/date-range-picker/DateRangePicker.vue b/resources/js/components/ui/date-range-picker/DateRangePicker.vueindex 0d62aa5f2..b9ea25f69 100644--- a/resources/js/components/ui/date-range-picker/DateRangePicker.vue+++ b/resources/js/components/ui/date-range-picker/DateRangePicker.vue@@ -8,7 +8,8 @@ import {import { IconCalendar } from "@tabler/icons-vue"import { trans } from "laravel-vue-i18n"import { computed, nextTick, ref, watch } from "vue"-import { useWindowSize } from "@vueuse/core"+import { createReusableTemplate, useWindowSize } from "@vueuse/core"+import BottomSheet from "@/components/BottomSheet.vue"import { Button } from "@/components/ui/button"import {Popover,@@ -16,18 +17,28 @@ import {PopoverTrigger,} from "@/components/ui/popover"import { RangeCalendar } from "@/components/ui/range-calendar"+import { useBelowBreakpoint } from "@/composables/useBreakpoint"import { useCalendarLocale } from "@/composables/useCalendarLocale"import { cn } from "@/lib/utils"import dayjs from "@/dayjs"import date from "@/date"-const props = defineProps<{+const props = withDefaults(defineProps<{modelValue: { start: Date, end: Date }triggerClass?: stringminDate?: DatemaxDate?: Datedisabled?: boolean-}>()+ align?: "start" | "center" | "end"+ sheetBelowSm?: boolean+}>(), {+ align: "end",+ sheetBelowSm: false,+})++const [DefinePanel, ReusePanel] = createReusableTemplate()+const belowSm = useBelowBreakpoint("sm")+const asSheet = computed(() => props.sheetBelowSm && belowSm.value)const emit = defineEmits<{'update:modelValue': [value: { start: Date, end: Date }]@@ -139,36 +150,7 @@ watch(</script><template>- <Popover v-model:open="isOpen">- <PopoverTrigger as-child>- <slot name="trigger">- <Button- variant="outline"- data-testid="date-range-picker-trigger"- :disabled="disabled"- :class="cn(- 'w-full justify-start text-left font-medium sm:w-auto',- !value && 'text-foreground/60',- props.triggerClass,- )"- >- <template v-if="value.start">- <template v-if="value.end">- {{ date.formatLocalDate(toDate(value.start)) }} -- {{ date.formatLocalDate(toDate(value.end)) }}- </template>- <template v-else>- {{ date.formatLocalDate(toDate(value.start)) }}- </template>- </template>- <template v-else>- {{ $t('common.date_range_picker.placeholder') }}- </template>- <IconCalendar class="ml-auto size-4 text-foreground/60" />- </Button>- </slot>- </PopoverTrigger>- <PopoverContent class="w-auto p-0" align="end">+ <DefinePanel><div class="flex flex-col sm:flex-row"><div class="hidden flex-col border-b border-border py-2 sm:flex sm:w-[170px] sm:shrink-0 sm:border-r sm:border-b-0"><template v-for="(group, groupIndex) in presetGroups" :key="groupIndex">@@ -189,7 +171,7 @@ watch(</template></div>- <div class="shrink-0">+ <div class="flex shrink-0 justify-center"><RangeCalendarv-model="value"initial-focus@@ -200,6 +182,48 @@ watch(/></div></div>+ </DefinePanel>++ <Popover v-model:open="isOpen">+ <PopoverTrigger as-child>+ <slot name="trigger">+ <Button+ variant="outline"+ data-testid="date-range-picker-trigger"+ :disabled="disabled"+ :class="cn(+ 'w-full justify-start text-left font-medium sm:w-auto',+ !value && 'text-foreground/60',+ props.triggerClass,+ )"+ >+ <template v-if="value.start">+ <template v-if="value.end">+ {{ date.formatLocalDate(toDate(value.start)) }} -+ {{ date.formatLocalDate(toDate(value.end)) }}+ </template>+ <template v-else>+ {{ date.formatLocalDate(toDate(value.start)) }}+ </template>+ </template>+ <template v-else>+ {{ $t('common.date_range_picker.placeholder') }}+ </template>+ <IconCalendar class="ml-auto size-4 text-foreground/60" />+ </Button>+ </slot>+ </PopoverTrigger>+ <PopoverContent v-if="!asSheet" class="w-auto p-0" :align="align">+ <ReusePanel /></PopoverContent></Popover>+ <BottomSheet+ v-if="asSheet"+ v-model:open="isOpen"+ :title="$t('common.date_range_picker.placeholder')"+ test-id="date-range-picker-sheet"+ content-class="pb-[max(1rem,env(safe-area-inset-bottom))]"+ >+ <ReusePanel />+ </BottomSheet></template>diff --git a/resources/js/components/welcome/mcp/McpFollowersMockup.vue b/resources/js/components/welcome/mcp/McpFollowersMockup.vueindex c9f5bc61b..12e541a65 100644--- a/resources/js/components/welcome/mcp/McpFollowersMockup.vue+++ b/resources/js/components/welcome/mcp/McpFollowersMockup.vue@@ -157,7 +157,7 @@ const hideMonth = (): void => {><path:d="toArea(accounts[0].values)"- :fill="accounts[0].color"+ :style="{ fill: accounts[0].color }"fill-opacity="0.08"/><line@@ -174,7 +174,7 @@ const hideMonth = (): void => {:key="account.platform":d="toCurve(account.values)"fill="none"- :stroke="account.color"+ :style="{ stroke: account.color }"stroke-width="1.25"stroke-linecap="round"vector-effect="non-scaling-stroke"diff --git a/resources/js/lib/analyticsColors.ts b/resources/js/lib/analyticsColors.tsindex c7d5c71ce..3fddc8ddd 100644--- a/resources/js/lib/analyticsColors.ts+++ b/resources/js/lib/analyticsColors.ts@@ -1,15 +1,4 @@-const accountColors = [- '#6D43CC',- '#159B92',- '#E9833D',- '#347AB7',- '#C64F7B',- '#74894B',- '#A855F7',- '#0F766E',- '#18181B',- '#E11D48',-];+const SERIES_COUNT = 10;export const accountColor = (index: number): string =>- accountColors[index % accountColors.length];+ `var(--series-${(index % SERIES_COUNT) + 1})`;diff --git a/resources/js/lib/mcpClients.ts b/resources/js/lib/mcpClients.tsindex 10cd19b72..bad2f7f12 100644--- a/resources/js/lib/mcpClients.ts+++ b/resources/js/lib/mcpClients.ts@@ -12,8 +12,14 @@ export interface McpClient {monoLogo: string;/** Where the user adds a connector in that client; none for a generic app. */settingsUrl?: string;+ /** Listed in the client's app store: the user connects from its page, nothing to paste. */+ listed?: boolean;}+/** TryPost's page in the ChatGPT app store. */+const CHATGPT_APP_URL =+ 'https://chatgpt.com/plugins/plugin_asdk_app_6ad0fbec07f4819191139b8a00f5f129';+/** Opens Claude straight on the "Add custom connector" dialog. */const CLAUDE_ADD_CONNECTOR_URL ='https://claude.ai/new?modal=add-custom-connector#customize/connectors/yours';@@ -36,7 +42,8 @@ export const mcpClients: McpClient[] = [logo: '/images/ai/openai.svg',logoClass: 'dark:invert',monoLogo: '/images/ai/openai.svg',- settingsUrl: 'https://chatgpt.com/plugins',+ settingsUrl: CHATGPT_APP_URL,+ listed: true,},];diff --git a/resources/js/types/analytics.ts b/resources/js/types/analytics.tsindex 0e332b06e..061a9a60e 100644--- a/resources/js/types/analytics.ts+++ b/resources/js/types/analytics.ts@@ -1,4 +1,5 @@import type { MediaItem } from '@/types/media';+import type { VerifiedBadge } from '@/types/social-account';import type { SocialAccountStatusValue } from '@/types/social-account-status';export interface Comparison {@@ -14,6 +15,7 @@ export interface AccountIdentityData {username: string | null;avatar_url: string | null;status?: SocialAccountStatusValue | null;+ verified_badge?: VerifiedBadge | null;}export interface FollowerAccount extends AccountIdentityData {@@ -45,6 +47,7 @@ export interface TopPost {username: string | null;avatar_url: string | null;status?: SocialAccountStatusValue | null;+ verified_badge?: VerifiedBadge | null;origin: string;content_type: string;availability: string;diff --git a/tests/Browser/ChannelMetricsCardTest.php b/tests/Browser/ChannelMetricsCardTest.phpindex 260148955..d7ef9c222 100644--- a/tests/Browser/ChannelMetricsCardTest.php+++ b/tests/Browser/ChannelMetricsCardTest.php@@ -137,10 +137,18 @@ test('the metrics card loads after the page and opens on content impact', functi$page->assertScript('Boolean(document.querySelector("[data-testid=insights-posts]").compareDocumentPosition(document.querySelector("[data-testid=insights-metrics]")) & Node.DOCUMENT_POSITION_FOLLOWING)', true)->assertScript(<<<'JS'- [...document.querySelectorAll('[data-testid="insights-metrics-controls"] button, [data-testid="insights-metrics-modes"] button')]+ [...document.querySelectorAll('[data-testid="insights-metrics-controls"] button')].map((button) => [button.classList.contains('h-7'), Math.round(button.getBoundingClientRect().height)]).every(([small, height]) => small && height === 28)JS, true)+ ->assertScript(<<<'JS'+ (() => {+ const preset = Math.round(document.querySelector('[data-testid="insights-range-30d"]').getBoundingClientRect().height);++ return [...document.querySelectorAll('[data-testid="insights-metrics-modes"] button')]+ .every((button) => Math.round(button.getBoundingClientRect().height) === preset);+ })()+ JS, true)->assertScript('document.querySelectorAll("[data-testid=insights-metrics-controls] button, [data-testid=insights-metrics-modes] button").length', 9)->assertNoJavaScriptErrors();});diff --git a/tests/Browser/DarkModeSurfacesTest.php b/tests/Browser/DarkModeSurfacesTest.phpindex 209067ad8..08f32c666 100644--- a/tests/Browser/DarkModeSurfacesTest.php+++ b/tests/Browser/DarkModeSurfacesTest.php@@ -162,7 +162,7 @@ test('in dark mode the idea board columns and cards step up from the page', func$page->assertNoJavaScriptErrors();});-test('in dark mode the insights sections sit below the page panel and their cards step up from them', function () {+test('in dark mode each insights section is one card outlined against the page panel', function () {Queue::fake([BootstrapAccountAnalytics::class, CollectAccountDailySnapshot::class]);$user = User::factory()->create(['theme' => Theme::Dark]);$workspace = Workspace::factory()->create(['user_id' => $user->id, 'account_id' => $user->account_id]);@@ -192,17 +192,24 @@ test('in dark mode the insights sections sit below the page panel and their cardconst [r, g, b] = getComputedStyle(element).backgroundColor.match(/\d+/g).map(Number);return 0.2126 * r + 0.7152 * g + 0.0722 * b;};- const card = document.querySelector('[data-testid="analytics-summary-followers"]');+ const borderLuminance = (element) => {+ const [r, g, b] = getComputedStyle(element).borderTopColor.match(/\d+/g).map(Number);+ return 0.2126 * r + 0.7152 * g + 0.0722 * b;+ };+ const cell = document.querySelector('[data-testid="analytics-summary-followers"]');+ const section = cell.closest('[data-testid="analytics-section"]');return {panel: luminance(document.querySelector('[data-slot="sidebar-inset"]')),- section: luminance(card.closest('[data-testid="analytics-section"]')),- card: luminance(card),+ section: luminance(section),+ border: borderLuminance(section),+ cellIsTransparent: getComputedStyle(cell).backgroundColor === 'rgba(0, 0, 0, 0)',};})()JS);- expect(abs($surfaces['section'] - $surfaces['panel']))->toBeGreaterThanOrEqual(4)- ->and($surfaces['card'] - $surfaces['section'])->toBeGreaterThanOrEqual(4);+ expect($surfaces['border'] - $surfaces['panel'])->toBeGreaterThanOrEqual(4)+ ->and($surfaces['border'] - $surfaces['section'])->toBeGreaterThanOrEqual(4)+ ->and($surfaces['cellIsTransparent'])->toBeTrue();$page->assertNoJavaScriptErrors();});diff --git a/tests/Browser/SidebarMenuTest.php b/tests/Browser/SidebarMenuTest.phpindex beacb923c..258f3a055 100644--- a/tests/Browser/SidebarMenuTest.php+++ b/tests/Browser/SidebarMenuTest.php@@ -187,7 +187,7 @@ test('the sidebar new button and its menu use the brand colors', function () {})()JS);- expect($colors)->toBe(['rgb(109, 40, 217)', 'rgb(255, 255, 255)', '3.35544e+07px', 'none']);+ expect($colors)->toBe(['rgb(109, 40, 217)', 'rgb(255, 255, 255)', '8px', 'none']);$page->click('@sidebar-new');waitForSidebarTestId($page, 'sidebar-new-idea');diff --git a/tests/Browser/WelcomeMcpTest.php b/tests/Browser/WelcomeMcpTest.phpindex 2270f0eec..0e70526a5 100644--- a/tests/Browser/WelcomeMcpTest.php+++ b/tests/Browser/WelcomeMcpTest.php@@ -349,13 +349,15 @@ test('the MCP step opens a dialog with the steps and the app link, and can be skwaitForWelcomeMcpTestIdGone($page, 'mcp-dialog');$page->click('@welcome-mcp-connect-chatgpt');- waitForWelcomeMcpTestId($page, 'mcp-dialog-step-developer');+ waitForWelcomeMcpTestId($page, 'mcp-dialog-step-open');$page->assertSeeIn('@mcp-dialog', 'Connect TryPost to ChatGPT')- ->assertSeeIn('@mcp-dialog-step-developer', 'Turn on Developer mode')- ->assertVisible('@mcp-dialog-step-create')+ ->assertSeeIn('@mcp-dialog-step-open', 'Open TryPost in ChatGPT')+ ->assertVisible('@mcp-dialog-step-login')->assertMissing('@mcp-dialog-step-paste')- ->assertAttribute('@mcp-dialog-open', 'href', 'https://chatgpt.com/plugins');+ ->assertMissing('@mcp-dialog-name')+ ->assertMissing('@mcp-dialog-url')+ ->assertAttribute('@mcp-dialog-open', 'href', 'https://chatgpt.com/plugins/plugin_asdk_app_6ad0fbec07f4819191139b8a00f5f129');$page->keys('@mcp-dialog', 'Escape');waitForWelcomeMcpTestIdGone($page, 'mcp-dialog');diff --git a/tests/Browser/WorkspaceInsightsTest.php b/tests/Browser/WorkspaceInsightsTest.phpindex 52898f619..5e4151a17 100644--- a/tests/Browser/WorkspaceInsightsTest.php+++ b/tests/Browser/WorkspaceInsightsTest.php@@ -625,6 +625,62 @@ test('on a phone the workspace insights range presets collapse into a dropdown',->assertNoJavaScriptErrors();});+test('the custom range calendar opens under Custom on desktop and as a bottom sheet on a phone', function () {+ Queue::fake([BootstrapAccountAnalytics::class, CollectAccountDailySnapshot::class]);+ $user = workspaceInsightsBrowserUser();+ $account = SocialAccount::factory()->instagram()->create(['workspace_id' => $user->current_workspace_id]);+ AnalyticsAccountDailySnapshot::factory()->create([+ 'workspace_id' => $user->current_workspace_id,+ 'social_account_id' => $account->id,+ 'social_account_key' => $account->id,+ 'platform' => $account->platform,+ 'network' => $account->platform->network(),+ 'platform_user_id' => $account->platform_user_id,+ 'date' => now('UTC')->subDays(40)->toDateString(),+ 'followers_count' => 100,+ ]);+ $this->actingAs($user);++ $page = visit(route('app.insights'))->resize(1440, 900);+ waitFor($page, '@insights-range-custom');+ $page->click('@insights-range-custom');+ waitFor($page, '[data-slot="popover-content"]');++ $alignment = $page->script(<<<'JS'+ (() => {+ const custom = document.querySelector('[data-testid="insights-range-custom"]').getBoundingClientRect();+ const calendar = document.querySelector('[data-slot="popover-content"]').getBoundingClientRect();++ return { offset: Math.abs(calendar.left - custom.left), below: calendar.top >= custom.bottom };+ })()+ JS);++ expect($alignment['offset'])->toBeLessThanOrEqual(2)+ ->and($alignment['below'])->toBeTrue();+ $page->assertNoJavaScriptErrors();++ $phone = visit(route('app.insights'))->resize(390, 844);+ waitFor($phone, '@insights-range-mobile-custom');+ $phone->click('@insights-range-mobile-custom');+ waitForState($phone, '@date-range-picker-sheet', 'element.getBoundingClientRect().bottom >= window.innerHeight - 1');++ $sheet = $phone->script(<<<'JS'+ (() => {+ const sheet = document.querySelector('[data-testid="date-range-picker-sheet"]').getBoundingClientRect();++ return {+ fullWidth: Math.round(sheet.left) === 0 && Math.round(sheet.right) === window.innerWidth,+ hasCalendar: Boolean(document.querySelector('[data-testid="date-range-picker-sheet"] [data-slot="range-calendar-grid"]')),+ noPopover: !document.querySelector('[data-slot="popover-content"]'),+ };+ })()+ JS);++ expect($sheet)->toBe(['fullWidth' => true, 'hasCalendar' => true, 'noPopover' => true])+ ->and(workspaceInsightsHasNoHorizontalOverflow($phone))->toBeTrue();+ $phone->assertNoJavaScriptErrors();+});+test('charts keep their width while the sidebar animates and resize once it settles', function () {Queue::fake([BootstrapAccountAnalytics::class, CollectAccountDailySnapshot::class]);$user = User::factory()->create();@@ -662,7 +718,7 @@ test('charts keep their width while the sidebar animates and resize once it sett$page->assertNoJavaScriptErrors();});-test('top posts tag each post type like the channel table', function () {+test('top posts name the network each post went out on and leave the post type out', function () {Queue::fake([BootstrapAccountAnalytics::class, CollectAccountDailySnapshot::class]);$user = workspaceInsightsBrowserUser();$workspace = $user->currentWorkspace;@@ -686,13 +742,29 @@ test('top posts tag each post type like the channel table', function () {AnalyticsPublicationDailySnapshot::factory()->create(['publication_id' => $publications[$key]->id, 'reactions_count' => 10]);}+ $verified = SocialAccount::factory()->x()->create(['workspace_id' => $workspace->id, 'meta' => ['x_verified_type' => 'blue']]);+ $publications['x'] = AnalyticsPublication::factory()->create([+ 'workspace_id' => $workspace->id,+ 'social_account_id' => $verified->id,+ 'social_account_key' => $verified->id,+ 'platform' => Platform::X,+ 'network' => Platform::X->network(),+ 'provider_published_at' => now()->subDays(3)->setTime(10, 0),+ ]);+ AnalyticsPublicationDailySnapshot::factory()->create(['publication_id' => $publications['x']->id, 'reactions_count' => 10]);+$this->actingAs($user);$page = visit(route('app.insights'));- waitForWorkspaceInsightsTestId($page, "analytics-top-post-type-{$publications['reel']->id}");-- $page->assertScript("document.querySelector('[data-testid=\"analytics-top-post-type-{$publications['reel']->id}-icon\"]').classList.contains('tabler-icon-circle-play')", true)- ->assertMissing("@analytics-top-post-type-{$publications['image']->id}")- ->assertMissing("@analytics-top-post-type-{$publications['tiktok']->id}")+ waitFor($page, "@analytics-top-post-published-via-{$publications['reel']->id}");++ $page->assertSeeIn("@analytics-top-post-published-via-{$publications['reel']->id}", 'Published via')+ ->assertSeeIn("@analytics-top-post-published-via-{$publications['reel']->id}", 'Instagram')+ ->assertSeeIn("@analytics-top-post-published-via-{$publications['tiktok']->id}", 'TikTok')+ ->assertPresent("[data-testid=\"analytics-top-post-channel\"] [data-testid=\"channel-avatar-verified-{$verified->id}\"]")+ ->assertMissing("[data-testid=\"analytics-top-post-channel\"] [data-testid=\"channel-avatar-verified-{$publications['tiktok']->social_account_id}\"]")+ ->assertScript("document.querySelectorAll('[data-testid=\"analytics-section\"] [data-testid=\"channel-avatar-verified-{$verified->id}\"]').length >= 4", true)+ ->assertMissing("@analytics-top-post-type-{$publications['reel']->id}")+ ->assertDontSee('Published on the social network')->assertNoJavaScriptErrors();});diff --git a/tests/Feature/Analytics/InsightsAccountStatusTest.php b/tests/Feature/Analytics/InsightsAccountStatusTest.phpindex 2a7391fa8..d52df996c 100644--- a/tests/Feature/Analytics/InsightsAccountStatusTest.php+++ b/tests/Feature/Analytics/InsightsAccountStatusTest.php@@ -75,3 +75,54 @@ test('insights rows carry the live connection status and the top post avatar of->where('report.bounds.min', null)->etc());});++test('insights rows carry the verified badge of each channel like the sidebar', function () {+ Queue::fake([BootstrapAccountAnalytics::class, CollectAccountDailySnapshot::class]);++ $user = User::factory()->create();+ $workspace = Workspace::factory()->create(['user_id' => $user->id]);+ $user->update(['current_workspace_id' => $workspace->id]);+ $verified = SocialAccount::factory()->x()->create(['workspace_id' => $workspace->id, 'meta' => ['x_verified_type' => 'blue']]);++ AnalyticsAccountDailySnapshot::factory()->create([+ 'workspace_id' => $workspace->id,+ 'social_account_id' => $verified->id,+ 'social_account_key' => $verified->id,+ 'platform' => Platform::X,+ 'network' => Platform::X->network(),+ 'platform_user_id' => $verified->platform_user_id,+ 'date' => '2026-09-15',+ 'followers_count' => 500,+ ]);+ $publication = AnalyticsPublication::factory()->create([+ 'workspace_id' => $workspace->id,+ 'social_account_id' => $verified->id,+ 'social_account_key' => $verified->id,+ 'platform' => Platform::X,+ 'provider_published_at' => CarbonImmutable::parse('2026-09-15 12:00:00', 'UTC'),+ ]);+ AnalyticsPublicationDailySnapshot::factory()->create([+ 'publication_id' => $publication->id,+ 'date' => '2026-09-15',+ 'reactions_count' => 10,+ ]);++ $this->actingAs($user)+ ->get(route('app.insights', ['start' => '2026-09-01', 'end' => '2026-09-30']))+ ->assertOk()+ ->assertInertia(fn (Assert $page) => $page+ ->where('report.performance.0.verified_badge', 'blue')+ ->where('report.posts.accounts.0.verified_badge', 'blue')+ ->where('report.followers.accounts.0.verified_badge', 'blue')+ ->where('report.top_posts.reactions.0.verified_badge', 'blue')+ ->etc());++ $verified->update(['meta' => []]);++ $this->actingAs($user)+ ->get(route('app.insights', ['start' => '2026-09-01', 'end' => '2026-09-30']))+ ->assertOk()+ ->assertInertia(fn (Assert $page) => $page+ ->where('report.performance.0.verified_badge', null)+ ->etc());+});