From 660fd4eb9cd7069a0cd3242325cee8e0540b5f35 Mon Sep 17 00:00:00 2001 From: akastijn Date: Sun, 19 Jul 2026 18:57:19 +0200 Subject: [PATCH] Add mobile breakpoint detection to chat for responsive behavior and fullscreen prompt control --- .../src/app/pages/altitude/chat/chat.component.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/pages/altitude/chat/chat.component.ts b/frontend/src/app/pages/altitude/chat/chat.component.ts index e351228..5609440 100644 --- a/frontend/src/app/pages/altitude/chat/chat.component.ts +++ b/frontend/src/app/pages/altitude/chat/chat.component.ts @@ -7,6 +7,7 @@ import {FullSizeComponent} from '@shared-components/full-size/full-size.componen import {ChatBoxComponent} from '@pages/altitude/chat/components/chat/chat-box.component'; import {ServerListComponent} from '@pages/altitude/chat/components/server-list/server-list.component'; import {ChatInfoComponent} from '@pages/altitude/chat/components/chat-info/chat-info.component'; +import {BreakpointObserver, Breakpoints} from '@angular/cdk/layout'; @Component({ selector: 'app-chat', @@ -27,14 +28,21 @@ export class ChatComponent implements OnInit, AfterViewInit, OnDestroy { protected readonly messages = this.chatService.messages; protected readonly servers = this.chatService.servers; protected readonly selectedServer = this.chatService.selectedServer; - protected readonly showFullscreenPrompt = signal(true); + protected readonly showFullscreenPrompt = signal(false); + protected readonly isMobile = signal(false); - constructor(private interaction: MiniMessageInteractionService) { + constructor(private interaction: MiniMessageInteractionService, private breakpointObserver: BreakpointObserver) { interaction.clicks$.subscribe(({action, value}) => { if (action === 'run_command') { alert(value); } }); + this.breakpointObserver + .observe([Breakpoints.Handset]) + .subscribe(result => { + this.isMobile.set(result.matches); + this.showFullscreenPrompt.set(this.isMobile()); + }); } public onSelectedServerChange(server: string) {