blob: 1c12b2cb101f1839b4cacc90d67a71a4233861f3 [file] [log] [blame]
David Crawshaw77358442025-06-25 00:26:08 +00001import { html } from "lit";
2import { customElement } from "lit/decorators.js";
3import { ref } from "lit/directives/ref.js";
4import { SketchAppShellBase } from "./sketch-app-shell-base";
Sean McCullough86b56862025-04-18 13:04:03 -07005
6@customElement("sketch-app-shell")
David Crawshaw77358442025-06-25 00:26:08 +00007export class SketchAppShell extends SketchAppShellBase {
banksean141547d2025-07-24 09:21:18 -07008 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 McCullough86b56862025-04-18 13:04:03 -070020 render() {
21 return html`
Sean McCulloughbf66a2f2025-06-23 21:53:55 -070022 <!-- Main container: flex column, full height, system font, hidden overflow-x -->
23 <div
banksean3eaa4332025-07-19 02:19:06 +000024 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 McCulloughbf66a2f2025-06-23 21:53:55 -070025 >
David Crawshaw77358442025-06-25 00:26:08 +000026 ${this.renderTopBanner()}
Sean McCullough86b56862025-04-18 13:04:03 -070027
Sean McCulloughbf66a2f2025-06-23 21:53:55 -070028 <!-- Main content area: scrollable, flex-1 -->
Josh Bleecher Snyder112b9232025-05-23 11:26:33 -070029 <div
Sean McCulloughbf66a2f2025-06-23 21:53:55 -070030 id="view-container"
31 ${ref(this.scrollContainerRef)}
32 class="self-stretch overflow-y-auto flex-1 flex flex-col min-h-0"
Josh Bleecher Snyder112b9232025-05-23 11:26:33 -070033 >
Pokey Rule4097e532025-04-24 18:55:28 +010034 <div
Sean McCulloughbf66a2f2025-06-23 21:53:55 -070035 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 Rule4097e532025-04-24 18:55:28 +010041 >
David Crawshaw77358442025-06-25 00:26:08 +000042 ${this.renderMainViews()}
Josh Bleecher Snyder112b9232025-05-23 11:26:33 -070043 </div>
Sean McCullough86b56862025-04-18 13:04:03 -070044 </div>
Sean McCullough86b56862025-04-18 13:04:03 -070045
David Crawshaw77358442025-06-25 00:26:08 +000046 ${this.renderChatInput()}
Pokey Rule4097e532025-04-24 18:55:28 +010047 </div>
Sean McCullough86b56862025-04-18 13:04:03 -070048 `;
49 }
Sean McCullough86b56862025-04-18 13:04:03 -070050}
51
52declare global {
53 interface HTMLElementTagNameMap {
54 "sketch-app-shell": SketchAppShell;
55 }
56}