build(ui): expand application shell and implement administrative dashboard pages
This commit significantly expands the application's routing, navigation, and administrative capabilities. It introduces several new functional modules and refines the core layout for a more professional, dashboard-oriented experience. - **Routing & Navigation**: - Added routes for `wallboard`, `call-center`, `call-center/calls`, and `chat-questions`. - Updated `SidebarComponent` to include all new navigation items. - Enhanced `LayoutComponent` with dynamic navigation based on user roles (admin vs. user). - **New Administrative Pages**: - `WallboardPage`: Implements a real-time KPI dashboard with call activity trends and outcome distributions. - `CallCenterPage`: Provides a symbolic interface for managing call center connectivity and synchronization. - `CallCenterCallsPage`: Implements a call history retrieval interface with filtering capabilities. - `ChatQuestionsPage`: Adds a module for reviewing user questions from web and mobile channels. - **Core Infrastructure & Refinement**: - Updated `AppConfig` to include an `APP_INITIALIZER` for validating user identity via `AuthService` on startup. - Refined `HomeComponent` layout to a "Claude-style" continuous chat column. - Implemented global themed scrollbars and integrated the 'Lahze' font family. - Added `proxy.conf.json` and updated `angular.json` to support local backend development. - **Documentation**: - Added comprehensive API handoff guides for frontend-backend connection and MVP API catalog.
This commit is contained in:
@@ -3,18 +3,21 @@ import {
|
||||
Component,
|
||||
inject,
|
||||
signal,
|
||||
computed,
|
||||
OnInit,
|
||||
OnDestroy,
|
||||
} from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { AiChatInputComponent } from '../../shared/ui/ai-chat-input/ai-chat-input.component';
|
||||
import { VoiceStreamPanelComponent } from '../../shared/ui/voice-stream-panel/voice-stream-panel.component';
|
||||
import { VoiceStreamService } from '../../services/voice-stream/voice-stream.service';
|
||||
import { Router, NavigationEnd } from '@angular/router';
|
||||
import { filter } from 'rxjs/operators';
|
||||
import { ThemeService } from '../../services/theme/theme.service';
|
||||
import { Subscription } from 'rxjs';
|
||||
|
||||
const HOME_TITLES = [
|
||||
'چه چیزی میخواهید بدانید؟...',
|
||||
'چه چیزی میخواهید بدانید؟',
|
||||
'سوالتان را بپرسید، با شما هستم...',
|
||||
'هر سوالی دارید، از من بپرسید...',
|
||||
'از هر چیزی که میخواهید شروع کنید...',
|
||||
@@ -29,7 +32,7 @@ const HOME_TITLES = [
|
||||
@Component({
|
||||
selector: 'app-home',
|
||||
standalone: true,
|
||||
imports: [CommonModule, AiChatInputComponent],
|
||||
imports: [CommonModule, AiChatInputComponent, VoiceStreamPanelComponent],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
templateUrl: './home.page.html',
|
||||
styleUrl: './home.page.css',
|
||||
@@ -37,6 +40,7 @@ const HOME_TITLES = [
|
||||
export class HomePage implements OnInit, OnDestroy {
|
||||
private readonly themeService = inject(ThemeService);
|
||||
private readonly router = inject(Router);
|
||||
private readonly voiceStream = inject(VoiceStreamService);
|
||||
|
||||
readonly isDarkMode = this.themeService.isDarkMode;
|
||||
|
||||
@@ -45,6 +49,20 @@ export class HomePage implements OnInit, OnDestroy {
|
||||
|
||||
readonly hasMessages = signal(false);
|
||||
|
||||
/**
|
||||
* Conversation owns the layout when there is a live voice call,
|
||||
* leftover voice transcript, or text messages — same idea as Claude's
|
||||
* chat column switching from empty state to transcript list.
|
||||
*/
|
||||
readonly voiceHasTranscript = computed(
|
||||
() => this.voiceStream.isOpen() || this.voiceStream.messages().length > 0,
|
||||
);
|
||||
|
||||
readonly hasConversation = computed(() => this.hasMessages() || this.voiceHasTranscript());
|
||||
|
||||
/** @deprecated use hasConversation — kept for any external bindings */
|
||||
readonly voicePanelVisible = this.hasConversation;
|
||||
|
||||
readonly homeTitle = signal('');
|
||||
readonly streamedText = signal('');
|
||||
readonly isStreaming = signal(false);
|
||||
@@ -97,12 +115,9 @@ export class HomePage implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
index++;
|
||||
|
||||
this.streamedText.set(text.substring(0, index));
|
||||
|
||||
// Slightly random timing makes it feel more natural
|
||||
const delay = 16 + Math.random() * 8;
|
||||
|
||||
this.typingTimer = setTimeout(typeNextCharacter, delay);
|
||||
};
|
||||
|
||||
@@ -114,7 +129,6 @@ export class HomePage implements OnInit, OnDestroy {
|
||||
clearTimeout(this.typingTimer);
|
||||
this.typingTimer = null;
|
||||
}
|
||||
|
||||
this.isStreaming.set(false);
|
||||
}
|
||||
|
||||
@@ -130,4 +144,4 @@ export class HomePage implements OnInit, OnDestroy {
|
||||
onVoiceToggled(active: boolean): void {
|
||||
console.log('Voice mode:', active ? 'active' : 'inactive');
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user