File size: 2,370 Bytes
8d1819a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<html>
<head>
  <title>Context Window</title>
  <script type="module">
    import { store } from "/components/modals/context/context-store.js";
  </script>
</head>
<body>
  <div x-data>
    <template x-if="$store.context">
      <div class="context-modal-root">
        
        <!-- Loading State -->
        <template x-if="$store.context.isLoading">
          <div class="loading-state">
            <div class="loading-spinner"></div>
            <p>Loading context window…</p>
          </div>
        </template>
        
        <!-- Error State -->
        <template x-if="$store.context.error">
          <div class="error-state">
            <p class="error-message" x-text="$store.context.error"></p>
          </div>
        </template>
        
        <!-- Content (ACE Editor) -->
        <template x-if="!$store.context.isLoading && !$store.context.error">
          <div id="context-viewer-container"></div>
        </template>
        
      </div>
    </template>
  </div>

  <style>
    .context-modal-root {
      display: flex;
      flex-direction: column;
      width: 100%;
      height: 100%;
      min-height: 400px;
    }

    .loading-state,
    .error-state {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: var(--spacing-lg);
      min-height: 200px;
    }

    .loading-spinner {
      width: 40px;
      height: 40px;
      border: 3px solid var(--color-border);
      border-top: 3px solid var(--color-primary);
      border-radius: 50%;
      animation: spin 1s linear infinite;
      margin-bottom: var(--spacing-md);
    }

    @keyframes spin {
      0% { transform: rotate(0deg); }
      100% { transform: rotate(360deg); }
    }

    .loading-state p,
    .error-state p {
      color: var(--color-text-secondary);
      margin: 0;
    }

    .error-message {
      color: var(--color-error);
      font-weight: 500;
    }

    /* ACE Editor Container */
    #context-viewer-container {
      width: 100%;
      height: 71vh;
      border-radius: 0.4rem;
      overflow: auto;
    }

    #context-viewer-container::-webkit-scrollbar {
      width: 0;
    }

    /* ACE Editor Scrollbar */
    .ace_scrollbar-v {
      overflow-y: auto;
    }

    /* Viewer Styles */
    .context-modal-root {
      overflow: hidden;
    }
  </style>

</body>
</html>