| David Crawshaw | 7735844 | 2025-06-25 00:26:08 +0000 | [diff] [blame] | 1 | import { html } from "lit"; |
| 2 | import { customElement } from "lit/decorators.js"; |
| 3 | import { ref } from "lit/directives/ref.js"; |
| 4 | import { SketchAppShellBase } from "./sketch-app-shell-base"; |
| Sean McCullough | 86b5686 | 2025-04-18 13:04:03 -0700 | [diff] [blame] | 5 | |
| 6 | @customElement("sketch-app-shell") |
| David Crawshaw | 7735844 | 2025-06-25 00:26:08 +0000 | [diff] [blame] | 7 | export class SketchAppShell extends SketchAppShellBase { |
| banksean | 141547d | 2025-07-24 09:21:18 -0700 | [diff] [blame] | 8 | connectedCallback(): void { |
| 9 | super.connectedCallback(); |
| 10 | |
| 11 | this.dataManager.addEventListener("sessionEnded", () => { |
| 12 | this.handleSessionEnded(); |
| 13 | }); |
| 14 | } |
| 15 | |
| 16 | async handleSessionEnded() { |
| 17 | await this.navigateToMessagesArchiveView(); |
| 18 | } |
| 19 | |
| Sean McCullough | 86b5686 | 2025-04-18 13:04:03 -0700 | [diff] [blame] | 20 | render() { |
| 21 | return html` |
| Sean McCullough | bf66a2f | 2025-06-23 21:53:55 -0700 | [diff] [blame] | 22 | <!-- Main container: flex column, full height, system font, hidden overflow-x --> |
| 23 | <div |
| banksean | 3eaa433 | 2025-07-19 02:19:06 +0000 | [diff] [blame] | 24 | class="block font-sans text-gray-800 dark:text-gray-200 leading-relaxed h-screen w-full relative overflow-x-hidden flex flex-col bg-white dark:bg-gray-900" |
| Sean McCullough | bf66a2f | 2025-06-23 21:53:55 -0700 | [diff] [blame] | 25 | > |
| David Crawshaw | 7735844 | 2025-06-25 00:26:08 +0000 | [diff] [blame] | 26 | ${this.renderTopBanner()} |
| Sean McCullough | 86b5686 | 2025-04-18 13:04:03 -0700 | [diff] [blame] | 27 | |
| Sean McCullough | bf66a2f | 2025-06-23 21:53:55 -0700 | [diff] [blame] | 28 | <!-- Main content area: scrollable, flex-1 --> |
| Josh Bleecher Snyder | 112b923 | 2025-05-23 11:26:33 -0700 | [diff] [blame] | 29 | <div |
| Sean McCullough | bf66a2f | 2025-06-23 21:53:55 -0700 | [diff] [blame] | 30 | id="view-container" |
| 31 | ${ref(this.scrollContainerRef)} |
| 32 | class="self-stretch overflow-y-auto flex-1 flex flex-col min-h-0" |
| Josh Bleecher Snyder | 112b923 | 2025-05-23 11:26:33 -0700 | [diff] [blame] | 33 | > |
| Pokey Rule | 4097e53 | 2025-04-24 18:55:28 +0100 | [diff] [blame] | 34 | <div |
| Sean McCullough | bf66a2f | 2025-06-23 21:53:55 -0700 | [diff] [blame] | 35 | id="view-container-inner" |
| 36 | class="${this.viewMode === "diff2" |
| 37 | ? "max-w-full w-full h-full p-0 flex flex-col flex-1 min-h-0" |
| 38 | : this._todoPanelVisible && this.viewMode === "chat" |
| 39 | ? "max-w-none w-full m-0 px-5" |
| 40 | : "max-w-6xl w-[calc(100%-40px)] mx-auto"} relative pb-2.5 pt-2.5 flex flex-col h-full" |
| Pokey Rule | 4097e53 | 2025-04-24 18:55:28 +0100 | [diff] [blame] | 41 | > |
| David Crawshaw | 7735844 | 2025-06-25 00:26:08 +0000 | [diff] [blame] | 42 | ${this.renderMainViews()} |
| Josh Bleecher Snyder | 112b923 | 2025-05-23 11:26:33 -0700 | [diff] [blame] | 43 | </div> |
| Sean McCullough | 86b5686 | 2025-04-18 13:04:03 -0700 | [diff] [blame] | 44 | </div> |
| Sean McCullough | 86b5686 | 2025-04-18 13:04:03 -0700 | [diff] [blame] | 45 | |
| David Crawshaw | 7735844 | 2025-06-25 00:26:08 +0000 | [diff] [blame] | 46 | ${this.renderChatInput()} |
| Pokey Rule | 4097e53 | 2025-04-24 18:55:28 +0100 | [diff] [blame] | 47 | </div> |
| Sean McCullough | 86b5686 | 2025-04-18 13:04:03 -0700 | [diff] [blame] | 48 | `; |
| 49 | } |
| Sean McCullough | 86b5686 | 2025-04-18 13:04:03 -0700 | [diff] [blame] | 50 | } |
| 51 | |
| 52 | declare global { |
| 53 | interface HTMLElementTagNameMap { |
| 54 | "sketch-app-shell": SketchAppShell; |
| 55 | } |
| 56 | } |