feat: Structure dashboard AI summary into detailed sections and update UI to display them.

This commit is contained in:
xds
2025-12-15 11:45:45 +03:00
parent 2156e57716
commit cbdf8f613f
2 changed files with 32 additions and 3 deletions

View File

@@ -203,8 +203,26 @@ const userName = computed(() => {
<div class="flex flex-col card"> <div class="flex flex-col card">
<span class="text-xl !font-semibold pl-1 mb-2">AI Summary</span> <span class="text-xl !font-semibold pl-1 mb-2">AI Summary</span>
<div class="ai-summary-wrapper"> <div class="ai-summary-wrapper">
<div :class="['ai-summary-content', { 'expanded': isAiSummaryExpanded }]"> <div :class="['ai-summary-content', { 'expanded': isAiSummaryExpanded }]" class="">
<span v-html="dashboardData.analyzedText" /> <div class="flex flex-col gap-0">
<span class="text-lg bold">Общая оценка</span>
<span class="!whitespace-pre-wrap" v-html="dashboardData.analyzedText.common" />
</div>
<div class="h-4"/>
<div class="flex flex-col gap-0">
<span class="text-lg bold">Анализ категорий</span>
<span class="!whitespace-pre-wrap" v-html="dashboardData.analyzedText.categoryAnalysis" />
</div>
<div class="h-4"/>
<div class="flex flex-col gap-0">
<span class="text-lg bold">Ключевые инсайты</span>
<span class="!whitespace-pre-wrap" v-html="dashboardData.analyzedText.keyInsights" />
</div>
<div class="h-4"/>
<div class="flex flex-col gap-0">
<span class="text-lg bold">Рекомендации</span>
<span class="!whitespace-pre-wrap" v-html="dashboardData.analyzedText.recommendations" />
</div>
</div> </div>
<div v-if="!isAiSummaryExpanded" class="ai-summary-fade"></div> <div v-if="!isAiSummaryExpanded" class="ai-summary-fade"></div>
</div> </div>
@@ -289,6 +307,10 @@ const userName = computed(() => {
background: linear-gradient(135deg, #764ba2 0%, #667eea 100%) !important; background: linear-gradient(135deg, #764ba2 0%, #667eea 100%) !important;
} }
b {
font-weight: bold !important;
}
.expand-button:active { .expand-button:active {
transform: translateY(0); transform: translateY(0);
} }

View File

@@ -9,7 +9,14 @@ export interface DashboardData {
upcomingTransactions: Transaction[], upcomingTransactions: Transaction[],
recentTransactions: Transaction[], recentTransactions: Transaction[],
weeks: DashboardWeek[], weeks: DashboardWeek[],
analyzedText: string, analyzedText: AISummary,
}
export interface AISummary {
common: string,
categoryAnalysis: string,
keyInsights: string,
recommendations: string
} }
export interface DashboardWeek { export interface DashboardWeek {