Hello from MCP server
<template>
<ion-modal :is-open="isOpen" @didDismiss="$emit('close')">
<ion-header>
<ion-toolbar>
<ion-title>{{ title || 'Help' }}</ion-title>
<ion-buttons slot="end">
<ion-button @click="$emit('close')">Close</ion-button>
</ion-buttons>
</ion-toolbar>
</ion-header>
<ion-content class="ion-padding">
<div class="help-content">
<!-- Documentation Section -->
<div class="documentation-section">
<slot name="documentation">
<p class="no-docs">No documentation available for this screen.</p>
</slot>
</div>
<!-- Debug Controls Section -->
<div class="debug-section">
<div class="debug-header" @click="toggleDebug">
<span class="debug-title">Debug Info</span>
<ion-icon :icon="debugExpanded ? chevronUp : chevronDown" class="chevron-icon"></ion-icon>
</div>
<div v-if="debugExpanded" class="debug-content">
<!-- Custom debug controls slot -->
<slot name="debug-controls"></slot>
<!-- Log Jobs Button -->
<ion-button expand="block" color="medium" @click="logJobs" class="debug-button">
Log Jobs to Console
</ion-button>
<!-- Log Session Button -->
<ion-button expand="block" color="medium" @click="logSession" class="debug-button">
Log Full Session to Console
</ion-button>
<!-- Session State Display -->
<div class="session-state">
<h4>Session State</h4>
<pre>{{ sessionStateJson }}</pre>
</div>
</div>
</div>
</div>
</ion-content>
</ion-modal>
</template>
<script setup lang="ts">
import { ref, computed } from 'vue';
import {
IonModal,
IonHeader,
IonToolbar,
IonTitle,
IonButtons,
IonButton,
IonContent,
IonIcon,
} from '@ionic/vue';
import { chevronDown, chevronUp } from 'ionicons/icons';
import { useSessionStore } from '@/stores/session';
const props = defineProps<{
isOpen: boolean;
title?: string;
}>();
defineEmits(['close']);
const sessionStore = useSessionStore();
const debugExpanded = ref(false);
const toggleDebug = () => {
debugExpanded.value = !debugExpanded.value;
};
const sessionStateJson = computed(() => {
const stateCopy = { ...sessionStore.$state };
delete (stateCopy as any).db;
return JSON.stringify(stateCopy, null, 2);
});
const logJobs = () => {
console.log('[HelpModal] Jobs in session:', sessionStore.jobs);
sessionStore.jobs.forEach((job, index) => {
console.log(`[HelpModal] Job ${index + 1}:`, {
id: job.id,
title: job.title,
problemName: job.problem?.name,
baseHours: job.baseHours,
extraTime: job.extraTime,
totalHours: (job.baseHours || 0) + (job.extraTime || 0),
checklistIssues: job.checklistIssues,
selectedTierName: job.selectedTierName,
selectedPrice: job.selectedPrice,
});
});
};
const logSession = () => {
const stateCopy = { ...sessionStore.$state };
delete (stateCopy as any).db;
console.log('[HelpModal] Full session state:', stateCopy);
};
</script>
<style scoped>
.help-content {
display: flex;
flex-direction: column;
gap: 24px;
}
.documentation-section {
padding: 16px;
background-color: var(--ion-background-color-step-50);
border-radius: 8px;
}
.documentation-section :deep(h2) {
margin: 0 0 16px 0;
font-size: 20px;
font-weight: 600;
color: var(--ion-text-color);
}
.documentation-section :deep(h3) {
margin: 16px 0 8px 0;
font-size: 16px;
font-weight: 600;
color: var(--ion-text-color);
}
.documentation-section :deep(p) {
margin: 0 0 12px 0;
font-size: 14px;
line-height: 1.6;
color: var(--ion-text-color);
}
.documentation-section :deep(ul) {
margin: 0 0 12px 0;
padding-left: 20px;
}
.documentation-section :deep(li) {
margin-bottom: 8px;
font-size: 14px;
line-height: 1.5;
color: var(--ion-text-color);
}
.no-docs {
color: var(--ion-color-medium);
font-style: italic;
}
.debug-section {
border: 1px solid var(--ion-color-medium);
border-radius: 8px;
overflow: hidden;
}
.debug-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 12px 16px;
background-color: var(--ion-background-color-step-100);
cursor: pointer;
user-select: none;
}
.debug-header:hover {
background-color: var(--ion-background-color-step-150);
}
.debug-title {
font-size: 14px;
font-weight: 600;
color: var(--ion-color-medium);
text-transform: uppercase;
letter-spacing: 0.5px;
}
.chevron-icon {
font-size: 20px;
color: var(--ion-color-medium);
}
.debug-content {
padding: 16px;
background-color: var(--ion-background-color);
}
.debug-button {
margin-bottom: 12px;
font-size: 14px;
}
.session-state {
margin-top: 16px;
}
.session-state h4 {
margin: 0 0 8px 0;
font-size: 14px;
font-weight: 600;
color: var(--ion-color-medium);
}
.session-state pre {
background-color: var(--ion-background-color-step-50);
padding: 12px;
border-radius: 8px;
font-size: 11px;
line-height: 1.4;
overflow-x: auto;
max-height: 300px;
overflow-y: auto;
margin: 0;
white-space: pre-wrap;
word-wrap: break-word;
}
</style>