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
@@ -11,8 +11,8 @@
transition: min-height 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
/* Height of the voice view; the wrapper animates to it so the page never jumps. */
.ai-chat-input-wrapper.voice-active {
/* Height of the dictation view; the wrapper animates to it so the page never jumps. */
.ai-chat-input-wrapper.dictation-active {
min-height: 460px;
}
@@ -33,10 +33,20 @@
inset: 0;
opacity: 0;
transform: translateY(10px) scale(0.98);
/* Never blocks the transcript underneath; the dictation view re-enables it. */
pointer-events: none;
/* The layer is inset:0 of a collapsed wrapper while dictation is not running, so the
dictation view inside it would overflow its box and add phantom height to the page
(visible as a gap under the composer + a Y scroll). Clipping keeps it out of layout.
It stays in the DOM (display is untouched) so the viewChild refs stay valid. */
overflow: hidden;
}
.ai-chat-input-wrapper.voice-active .composer-layer {
/* Out of the flow so the voice view takes the full height while it runs. */
position: absolute;
inset-inline: 0;
bottom: 0;
opacity: 0;
transform: translateY(10px);
pointer-events: none;
@@ -45,8 +55,8 @@
.ai-chat-input-wrapper.voice-active .voice-layer {
opacity: 1;
transform: translateY(0) scale(1);
pointer-events: auto;
}
:host-context(.has-messages) {
position: fixed;
bottom: 0;
@@ -118,6 +128,7 @@
}
.composer-textarea::-webkit-scrollbar-thumb {
background: var(--muted);
border: none;
border-radius: 9999px;
}
@@ -307,6 +318,8 @@
border: 1px solid var(--surface-border);
border-radius: 1.5rem;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.03);
/* Re-enabled on the view itself; the layer stays click-through for the transcript. */
pointer-events: auto;
}
.orb-container {
@@ -509,7 +522,7 @@
max-width: 100%;
}
.ai-chat-input-wrapper.voice-active {
.ai-chat-input-wrapper.dictation-active {
min-height: 410px;
}
@@ -554,11 +567,7 @@
}
}
/* ---------- Live voice call (taller view for the running transcript) ---------- */
.ai-chat-input-wrapper.stream-active {
min-height: min(580px, 78vh);
}
/* ---------- Send icon ---------- */
.send-btn svg {
animation: sendIconIn 0.18s ease;
}
@@ -578,10 +587,4 @@
.send-btn svg {
animation: none !important;
}
}
@media (max-width: 640px) {
.ai-chat-input-wrapper.stream-active {
min-height: min(540px, 80vh);
}
}
@@ -1,7 +1,7 @@
<div
class="ai-chat-input-wrapper"
[class.voice-active]="anyVoiceActive()"
[class.stream-active]="streamOpen()"
[class.dictation-active]="isVoiceMode()"
[attr.data-voice-state]="voiceState()"
(keydown.escape)="onEscape()"
>
@@ -153,60 +153,58 @@
[attr.inert]="anyVoiceActive() ? null : ''"
[attr.aria-hidden]="anyVoiceActive() ? null : 'true'"
>
@if (layerMode() === 'stream') {
<app-voice-stream-panel />
} @else {
<div class="voice-mode" role="region" aria-label="حالت صوتی">
<div class="orb-container" #orbContainer aria-hidden="true">
@if (!orbAvailable()) {
<div class="orb-fallback"></div>
}
</div>
<div class="voice-status" [class.is-speaking]="voiceState() === 'transcribing'">
<span class="rec-dot" aria-hidden="true"></span>
<p class="voice-mode-text">{{ statusText() }}</p>
</div>
<div class="voice-transcript" #transcript dir="rtl">
@if (liveFinal() || liveInterim()) {
<span class="t-final">{{ liveFinal() }}</span>
@if (liveInterim()) {
<span class="t-interim"> {{ liveInterim() }}</span>
@if (!streamOpen()) {
<div class="voice-mode" role="region" aria-label="حالت صوتی">
<div class="orb-container" #orbContainer aria-hidden="true">
@if (!orbAvailable()) {
<div class="orb-fallback"></div>
}
} @else {
<span class="t-placeholder">صحبت کنید؛ متن اینجا نمایش داده می‌شود</span>
}
</div>
</div>
<div class="voice-actions">
<button
type="button"
class="voice-stop-btn is-primary"
[disabled]="voiceState() === 'stopping'"
(click)="stopVoice(true)"
aria-label="پایان ضبط و ویرایش متن"
>
<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
<rect x="6" y="6" width="12" height="12" rx="2" />
</svg>
<span>پایان و ویرایش</span>
</button>
<button
type="button"
class="voice-stop-btn"
[disabled]="voiceState() === 'stopping'"
(click)="stopVoice(false)"
aria-label="لغو ضبط و حذف متن گفتاری"
>
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<line x1="18" x2="6" y1="6" y2="18" />
<line x1="6" x2="18" y1="6" y2="18" />
</svg>
<span>لغو</span>
</button>
<div class="voice-status" [class.is-speaking]="voiceState() === 'transcribing'">
<span class="rec-dot" aria-hidden="true"></span>
<p class="voice-mode-text">{{ statusText() }}</p>
</div>
<div class="voice-transcript" #transcript dir="rtl">
@if (liveFinal() || liveInterim()) {
<span class="t-final">{{ liveFinal() }}</span>
@if (liveInterim()) {
<span class="t-interim"> {{ liveInterim() }}</span>
}
} @else {
<span class="t-placeholder">صحبت کنید؛ متن اینجا نمایش داده می‌شود</span>
}
</div>
<div class="voice-actions">
<button
type="button"
class="voice-stop-btn is-primary"
[disabled]="voiceState() === 'stopping'"
(click)="stopVoice(true)"
aria-label="پایان ضبط و ویرایش متن"
>
<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
<rect x="6" y="6" width="12" height="12" rx="2" />
</svg>
<span>پایان و ویرایش</span>
</button>
<button
type="button"
class="voice-stop-btn"
[disabled]="voiceState() === 'stopping'"
(click)="stopVoice(false)"
aria-label="لغو ضبط و حذف متن گفتاری"
>
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<line x1="18" x2="6" y1="6" y2="18" />
<line x1="6" x2="18" y1="6" y2="18" />
</svg>
<span>لغو</span>
</button>
</div>
</div>
</div>
}
</div>
</div>
</div>
@@ -24,7 +24,6 @@ import {
import { VoiceOrbService } from '../../../services/voice-orb/voice-orb.service';
import { VoiceStreamService } from '../../../services/voice-stream/voice-stream.service';
import { VoiceMessage } from '../../../services/voice-stream/voice-stream.types';
import { VoiceStreamPanelComponent } from '../voice-stream-panel/voice-stream-panel.component';
export type VoiceState =
| 'idle'
@@ -53,8 +52,6 @@ export const DEFAULT_ATTACHMENT_ACTIONS: readonly AttachmentAction[] = [
];
const NOTICE_TIMEOUT_MS = 7000;
/** Keeps the previous voice view mounted while the layer fades out (matches the 0.35 s CSS fade). */
const LAYER_SWAP_MS = 400;
const MIC_ERRORS: Record<string, string> = {
unsupported: 'مرورگر شما از دسترسی به میکروفون پشتیبانی نمی‌کند (اتصال امن HTTPS لازم است).',
@@ -76,7 +73,6 @@ const SPEECH_ERRORS: Record<SpeechErrorKind, string> = {
@Component({
selector: 'app-ai-chat-input',
standalone: true,
imports: [VoiceStreamPanelComponent],
changeDetection: ChangeDetectionStrategy.OnPush,
templateUrl: './ai-chat-input.component.html',
styleUrl: './ai-chat-input.component.css',
@@ -114,8 +110,6 @@ export class AiChatInputComponent implements OnDestroy {
// Live voice call (voice-to-voice stream)
readonly streamOpen = this.voiceStream.isOpen;
/** Which view the voice layer shows; swapped after the fade so nothing flashes. */
readonly layerMode = signal<'dictation' | 'stream'>('dictation');
readonly canSend = computed(() => !!this.message().trim());
readonly anyVoiceActive = computed(() => this.isVoiceMode() || this.streamOpen());
readonly actionLabel = computed(() => (this.canSend() ? 'ارسال پیام' : 'شروع گفتگوی صوتی'));
@@ -173,7 +167,6 @@ export class AiChatInputComponent implements OnDestroy {
/** Textarea content when recording started; dictated text is appended to it. */
private baseText = '';
private noticeTimer: ReturnType<typeof setTimeout> | null = null;
private layerTimer: ReturnType<typeof setTimeout> | null = null;
constructor() {
// The outside-click listener only exists while the menu is open.
@@ -193,7 +186,6 @@ export class AiChatInputComponent implements OnDestroy {
this.voiceToggled.emit(false);
this.voiceSessionEnded.emit(messages);
if (error) this.showNotice({ kind: 'error', text: error });
this.scheduleLayerReset();
this.focusTextarea();
});
}
@@ -204,7 +196,6 @@ export class AiChatInputComponent implements OnDestroy {
this.mic.release();
this.voiceStream.dispose();
this.voiceOrb.dispose();
if (this.layerTimer) clearTimeout(this.layerTimer);
this.clearNoticeTimer();
}
@@ -351,36 +342,18 @@ export class AiChatInputComponent implements OnDestroy {
this.dismissNotice();
this.closeAttachmentMenu();
this.cancelLayerReset();
this.layerMode.set('stream');
this.voiceToggled.emit(true);
const result = await this.voiceStream.start();
if (!result.ok) {
// The call never connected, so no sessionEnded event is emitted for it.
this.voiceToggled.emit(false);
this.scheduleLayerReset();
if (result.reason !== 'cancelled') {
this.showNotice({ kind: 'error', text: result.message });
}
}
}
private scheduleLayerReset(): void {
this.cancelLayerReset();
this.layerTimer = setTimeout(() => {
this.layerTimer = null;
if (!this.streamOpen()) this.layerMode.set('dictation');
}, LAYER_SWAP_MS);
}
private cancelLayerReset(): void {
if (this.layerTimer) {
clearTimeout(this.layerTimer);
this.layerTimer = null;
}
}
// ---- voice: start ---------------------------------------------------------
async toggleVoiceMode(): Promise<void> {
@@ -403,8 +376,6 @@ export class AiChatInputComponent implements OnDestroy {
private async startVoice(): Promise<void> {
if (this.disabled() || this.streamOpen()) return;
this.cancelLayerReset();
this.layerMode.set('dictation');
this.dismissNotice();
this.closeAttachmentMenu();