| 1 | <html> |
| 2 | <head> |
| 3 | <title>Context Window</title> |
| 4 | <script type="module"> |
| 5 | import { store } from "/components/modals/context/context-store.js"; |
| 6 | </script> |
| 7 | </head> |
| 8 | <body> |
| 9 | <div x-data> |
| 10 | <template x-if="$store.context"> |
| 11 | <div class="context-modal-root"> |
| 12 | |
| 13 | <!-- Loading State --> |
| 14 | <template x-if="$store.context.isLoading"> |
| 15 | <div class="loading-state"> |
| 16 | <div class="loading-spinner"></div> |
| 17 | <p>Loading context window…</p> |
| 18 | </div> |
| 19 | </template> |
| 20 | |
| 21 | <!-- Error State --> |
| 22 | <template x-if="$store.context.error"> |
| 23 | <div class="error-state"> |
| 24 | <p class="error-message" x-text="$store.context.error"></p> |
| 25 | </div> |
| 26 | </template> |
| 27 | |
| 28 | <!-- Content (ACE Editor) --> |
| 29 | <template x-if="!$store.context.isLoading && !$store.context.error"> |
| 30 | <div id="context-viewer-container" class="no-scrollbar"></div> |
| 31 | </template> |
| 32 | |
| 33 | </div> |
| 34 | </template> |
| 35 | </div> |
| 36 | |
| 37 | <style> |
| 38 | .context-modal-root { |
| 39 | display: flex; |
| 40 | flex-direction: column; |
| 41 | width: 100%; |
| 42 | height: 100%; |
| 43 | min-height: 400px; |
| 44 | } |
| 45 | |
| 46 | .loading-state, |
| 47 | .error-state { |
| 48 | display: flex; |
| 49 | flex-direction: column; |
| 50 | align-items: center; |
| 51 | justify-content: center; |
| 52 | padding: var(--spacing-lg); |
| 53 | min-height: 200px; |
| 54 | } |
| 55 | |
| 56 | .loading-spinner { |
| 57 | width: 40px; |
| 58 | height: 40px; |
| 59 | border: 3px solid var(--color-border); |
| 60 | border-top: 3px solid var(--color-primary); |
| 61 | border-radius: 50%; |
| 62 | animation: spin 1s linear infinite; |
| 63 | margin-bottom: var(--spacing-md); |
| 64 | } |
| 65 | |
| 66 | @keyframes spin { |
| 67 | 0% { transform: rotate(0deg); } |
| 68 | 100% { transform: rotate(360deg); } |
| 69 | } |
| 70 | |
| 71 | .loading-state p, |
| 72 | .error-state p { |
| 73 | color: var(--color-text-secondary); |
| 74 | margin: 0; |
| 75 | } |
| 76 | |
| 77 | .error-message { |
| 78 | color: var(--color-error); |
| 79 | font-weight: 500; |
| 80 | } |
| 81 | |
| 82 | /* ACE Editor Container */ |
| 83 | #context-viewer-container { |
| 84 | width: 100%; |
| 85 | height: 71vh; |
| 86 | border-radius: 0.4rem; |
| 87 | overflow: auto; |
| 88 | } |
| 89 | |
| 90 | /* ACE Editor Scrollbar */ |
| 91 | .ace_scrollbar-v { |
| 92 | overflow-y: auto; |
| 93 | } |
| 94 | |
| 95 | /* Viewer Styles */ |
| 96 | .context-modal-root { |
| 97 | overflow: hidden; |
| 98 | } |
| 99 | </style> |
| 100 | |
| 101 | </body> |
| 102 | </html> |
| 103 |