Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 31 additions & 1 deletion frontend/src/components/TerminalPanel.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<script setup>
import { watch } from 'vue'
import { useTerminal } from '../composables/useTerminal'
import { useSettingsStore } from '../stores/settings'

const settingsStore = useSettingsStore()

const props = defineProps({
sessionId: {
Expand All @@ -13,7 +16,7 @@ const props = defineProps({
},
})

const { containerRef, isConnected, started, start, reconnect } = useTerminal(props.sessionId)
const { containerRef, isConnected, started, start, reconnect, copyMode } = useTerminal(props.sessionId)

// Lazy init: start the terminal only when the tab becomes active for the first time
watch(
Expand All @@ -29,6 +32,20 @@ watch(

<template>
<div class="terminal-panel">
<!-- Mobile toolbar — copy mode toggle -->
<div v-if="settingsStore.isTouchDevice && started" class="mobile-toolbar">
<span class="toolbar-spacer"></span>
<wa-button
size="small"
:appearance="copyMode ? 'filled' : 'plain'"
:variant="copyMode ? 'brand' : 'neutral'"
@click="copyMode = !copyMode"
>
<wa-icon slot="start" name="copy"></wa-icon>
Copy
</wa-button>
</div>

<div ref="containerRef" class="terminal-container"></div>

<!-- Disconnect overlay -->
Expand Down Expand Up @@ -76,6 +93,19 @@ watch(
overflow-y: auto !important;
}

.mobile-toolbar {
display: flex;
align-items: center;
gap: var(--wa-space-2xs);
padding: var(--wa-space-2xs) var(--wa-space-xs);
flex-shrink: 0;
border-bottom: 1px solid var(--wa-color-border-default);
}

.toolbar-spacer {
flex: 1;
}

.disconnect-overlay {
position: absolute;
inset: 0;
Expand Down
Loading