/** * OverlaysContainer Component * * Container for all overlay components in the session view. * Manages modals, floating buttons, and overlay states. */ import { html, LitElement } from 'lit'; import { customElement, property } from 'lit/decorators.js'; import type { Session } from '../../../shared/types.js'; import { Z_INDEX } from '../../utils/constants.js'; import type { TerminalThemeId } from '../../utils/terminal-themes.js'; import type { UIState } from './ui-state-manager.js'; import './mobile-input-overlay.js'; import './ctrl-alpha-overlay.js'; import '../terminal-quick-keys.js'; import '../file-browser.js'; import '../file-picker.js'; import './width-selector.js'; export interface OverlaysCallbacks { // Mobile input callbacks onMobileInputSendOnly: (text: string) => void; onMobileInputSend: (text: string) => void; onMobileInputCancel: () => void; onMobileInputTextChange: (text: string) => void; // Ctrl+Alpha callbacks onCtrlKey: (letter: string) => void; onSendCtrlSequence: () => void; onClearCtrlSequence: () => void; onCtrlAlphaCancel: () => void; // Quick keys onQuickKeyPress: (key: string) => void; // File browser/picker onCloseFileBrowser: () => void; onInsertPath: (e: CustomEvent) => void; onFileSelected: (e: CustomEvent) => void; onFileError: (e: CustomEvent) => void; onCloseFilePicker: () => void; // Terminal settings onWidthSelect: (width: number) => void; onFontSizeChange: (size: number) => void; onThemeChange: (theme: TerminalThemeId) => void; onCloseWidthSelector: () => void; // Keyboard button onKeyboardButtonClick: () => void; // Navigation handleBack: () => void; } @customElement('overlays-container') export class OverlaysContainer extends LitElement { // Disable shadow DOM to use parent styles createRenderRoot() { return this; } @property({ type: Object }) session: Session | null = null; @property({ type: Object }) uiState: UIState | null = null; @property({ type: Object }) callbacks: OverlaysCallbacks | null = null; render() { if (!this.uiState || !this.callbacks) { return html``; } return html` ${ this.session?.status === 'exited' ? html`
SESSION EXITED
` : '' } ${(() => { const visible = this.uiState.isMobile && this.uiState.showCtrlAlpha; console.log( '[OverlaysContainer] Ctrl+Alpha visible:', visible, 'isMobile:', this.uiState.isMobile, 'showCtrlAlpha:', this.uiState.showCtrlAlpha, 'z-index should be above', Z_INDEX.TERMINAL_QUICK_KEYS ); return html` `; })()} ${ this.uiState.isMobile && this.uiState.useDirectKeyboard && !this.uiState.showQuickKeys ? html`
{ e.preventDefault(); e.stopPropagation(); this.callbacks?.onKeyboardButtonClick(); }} title="Show keyboard" > ⌨
` : '' } ${ this.uiState.isDragOver ? html`

Drop files here

Files will be uploaded and the path sent to terminal

Or press ⌘V to paste from clipboard
` : '' } `; } }