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:
Peyman Honarjoo
2026-10-10 00:20:00 +03:30
parent 0b5a882ecb
commit ff7fcbc4bb
71 changed files with 9148 additions and 780 deletions
+145 -75
View File
@@ -1,16 +1,33 @@
/* --------------------------------------------------------------------------
Home page — Claude-style chat column
Structure:
.home-page
.chat-column
.transcript-list (flex: 1, scroll)
.composer (pinned bottom of column)
Two layouts, CSS-only, driven by [class.has-conversation]:
- empty state column hugs its content and centers (logo + composer as a group)
- conversation column is exactly one viewport tall, transcript scrolls inside it
-------------------------------------------------------------------------- */
/* The host defaults to `display: inline`, which adds a line-box strut under the
full-height column and pushes the page into Y overflow. Block removes it. */
:host {
display: block;
min-height: 0;
}
.home-page {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-height: 100dvh;
box-sizing: border-box;
padding: 2rem 1rem;
transition: padding 0.4s ease;
padding: 0;
position: relative;
background:
radial-gradient(ellipse 50% 40% at 50% 45%, rgba(59, 130, 246, 0.1), transparent 70%),
var(--app-bg);
/* Flat page color; every decorative glow lives in ::below so it can fade out as one. */
background: var(--app-bg);
}
.home-page::before {
@@ -18,54 +35,91 @@
position: absolute;
inset: 0;
background:
radial-gradient(ellipse 50% 40% at 50% 45%, rgba(59, 130, 246, 0.1), transparent 70%),
radial-gradient(circle at 50% 40%, rgba(59, 130, 246, 0.07), transparent 55%),
radial-gradient(circle at 35% 55%, rgba(99, 102, 241, 0.05), transparent 50%),
radial-gradient(circle at 65% 50%, rgba(59, 130, 246, 0.04), transparent 45%);
pointer-events: none;
z-index: 0;
transition: opacity 0.35s ease;
}
.home-page > .home-content {
/* Conversation open (messages or voice call): the bluish glow disappears completely. */
.home-page.has-conversation::before {
opacity: 0;
}
/* ---- Chat column (Claude: one continuous column) ---- */
.chat-column {
position: relative;
z-index: 1;
}
.home-page.has-messages {
justify-content: flex-end;
background: var(--app-bg);
}
.home-page.has-messages::before {
opacity: 0;
}
.home-header {
position: absolute;
top: 2rem;
left: 50%;
transform: translateX(-50%);
text-align: center;
transition:
opacity 0.35s ease,
transform 0.35s ease,
margin 0.35s ease;
opacity: 1;
}
.home-page.has-messages .home-header {
opacity: 0;
transform: translateX(-50%) translateY(-8px);
pointer-events: none;
}
.home-page.has-messages .home-title {
opacity: 0;
pointer-events: none;
}
.home-content {
display: flex;
flex-direction: column;
width: 100%;
max-width: 800px;
/* Auto height + viewport floor: grows only if the empty group cannot fit (then the
shell scrolls) instead of clipping. */
height: auto;
min-height: 100dvh;
box-sizing: border-box;
}
/* Conversation: the column is exactly one viewport tall so the composer stays pinned
and only the transcript area scrolls. `overflow` keeps any stray child box from
propagating phantom height to the page. */
.home-page.has-conversation .chat-column {
height: 100dvh;
overflow: hidden;
}
/* Empty state: the column stops stretching, so the empty content and the composer are
centered together in the viewport instead of the composer being pinned to the bottom. */
.home-page:not(.has-conversation) .chat-column {
justify-content: center;
}
.home-page:not(.has-conversation) .transcript-list {
flex: 0 0 auto;
overflow: visible;
}
.home-page:not(.has-conversation) .empty-state {
flex: 0 0 auto;
}
/* ---- Transcript list (scrollable body) ---- */
.transcript-list {
flex: 1 1 auto;
min-height: 0;
overflow-y: auto;
overflow-x: hidden;
/* Hide the scrollbar, keep wheel / trackpad / touch scrolling */
scrollbar-width: none; /* Firefox */
-ms-overflow-style: none; /* legacy Edge */
scroll-behavior: smooth;
display: flex;
flex-direction: column;
/* Space so last message clears the composer */
padding: 1.25rem 1rem 0.5rem;
box-sizing: border-box;
}
.transcript-list::-webkit-scrollbar {
display: none; /* Chrome, Safari, Edge */
width: 0;
height: 0;
}
/* Empty state centered in the transcript area */
.empty-state {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
padding: 2rem 1rem;
min-height: 0;
}
.home-icon-wrapper {
@@ -89,7 +143,7 @@
.home-title {
width: 100%;
margin: 0 0 1rem;
margin: 0;
display: flex;
align-items: center;
@@ -98,7 +152,7 @@
text-align: center;
direction: rtl;
font-size: 1.5rem;
font-size: 1.45rem;
font-weight: 400;
line-height: 1.5;
color: var(--text-primary);
@@ -110,18 +164,12 @@
.cursor {
display: inline-block;
width: 2px;
height: 1.15em;
margin-right: 3px;
background-color: var(--text-primary);
border-radius: 1px;
animation: cursorBlink 0.8s ease-in-out infinite;
flex-shrink: 0;
}
@@ -134,20 +182,56 @@
45% {
opacity: 1;
}
46%,
100% {
opacity: 0;
}
}
/* Voice panel becomes the transcript body — no extra card chrome */
.chat-transcript-body {
display: block;
flex: 1 1 auto;
min-height: 0;
width: 100%;
}
/* ---- Composer (pinned bottom of the chat column) ---- */
.composer {
flex-shrink: 0;
width: 100%;
padding: 0.75rem 1rem 1.25rem;
box-sizing: border-box;
background: transparent;
/* Subtle top fade so messages don't collide with the input */
position: relative;
}
.composer::before {
content: '';
position: absolute;
left: 0;
right: 0;
bottom: 100%;
height: 1.5rem;
pointer-events: none;
background: linear-gradient(to top, var(--app-bg), transparent);
opacity: 0;
transition: opacity 0.25s ease;
}
.home-page.has-conversation .composer::before {
opacity: 1;
}
/* ---- Responsive ---- */
@media (max-width: 640px) {
.home-page {
padding: 1.25rem 0.75rem;
.transcript-list {
padding: 1rem 0.75rem 0.5rem;
}
.home-header {
top: 1.25rem;
.composer {
padding: 0.5rem 0.75rem 1rem;
}
.home-icon-wrapper {
@@ -156,11 +240,6 @@
padding: 0.5rem;
}
.home-logo {
width: 100%;
height: 100%;
}
.home-title {
font-size: 1.375rem;
}
@@ -168,20 +247,11 @@
@media (prefers-reduced-motion: reduce) {
.home-page,
.home-header,
.home-icon-wrapper {
.home-page::before,
.transcript-list,
.composer::before {
transition: none !important;
animation: none !important;
scroll-behavior: auto !important;
}
}
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
}
+47 -31
View File
@@ -1,36 +1,52 @@
<div class="home-page" [class.has-messages]="hasMessages()">
<div
class="home-page"
[class.has-conversation]="hasConversation()"
>
<!-- Claude-style chat column: transcript list + composer in one continuous column -->
<div class="chat-column" role="main">
<!-- Transcript list (scrollable). Empty state or live/ended voice transcript. -->
<div
class="transcript-list"
#transcriptScroller
role="log"
aria-label="متن گفتگو"
aria-live="polite"
aria-relevant="additions"
>
@if (!hasConversation()) {
<!-- Empty state: logo + typing title (Claude empty chat feel) -->
<div class="empty-state">
<div class="home-icon-wrapper">
<img
class="home-logo"
[src]="logoSrc()"
alt="Raymand"
/>
</div>
<h1 class="home-title">
<span class="home-title-text">{{ streamedText() }}</span>
<span
class="cursor"
[class.cursor-hidden]="!isStreaming()"
aria-hidden="true"
></span>
</h1>
</div>
} @else if (voiceHasTranscript()) {
<!-- Voice stream fills the transcript list (no separate card chrome) -->
<app-voice-stream-panel class="chat-transcript-body" />
}
</div>
<div class="home-header" [class.header-hidden]="hasMessages()">
<div class="home-icon-wrapper">
<img
class="home-logo"
[src]="logoSrc()"
alt="Raymand"
<!-- Composer: always at the bottom of the same column (Claude pattern) -->
<div class="composer">
<app-ai-chat-input
placeholder="پیام خود را بنویسید..."
[hasMessages]="hasConversation()"
(messageSent)="onMessageSent($event)"
(fileSelected)="onFileSelected($event)"
(voiceToggled)="onVoiceToggled($event)"
/>
</div>
</div>
<div class="home-content">
<h1 class="home-title">
<span class="home-title-text">
{{ streamedText() }}
</span>
<span
class="cursor"
[class.cursor-hidden]="!isStreaming()"
aria-hidden="true"
></span>
</h1>
<app-ai-chat-input
placeholder="پیام خود را بنویسید..."
[hasMessages]="hasMessages()"
(messageSent)="onMessageSent($event)"
(fileSelected)="onFileSelected($event)"
(voiceToggled)="onVoiceToggled($event)"
/>
</div>
</div>
+21 -7
View File
@@ -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');
}
}
}