diff --git a/.changeset/quiet-session-warnings.md b/.changeset/quiet-session-warnings.md index 434e7a2..dfb7aee 100644 --- a/.changeset/quiet-session-warnings.md +++ b/.changeset/quiet-session-warnings.md @@ -2,4 +2,4 @@ "@jmfederico/pi-web": patch --- -Let users minimise session warnings into an accessible status-bar count that stays minimised when they revisit the session, and replace warning emoji with SVG icons. +Let users minimise session warnings with an accessible status-bar count that remains available as an expand/collapse toggle, remembers its state per session, and uses SVG warning icons. diff --git a/src/client/src/components/ChatView.test.ts b/src/client/src/components/ChatView.test.ts index 69320e7..6c846a7 100644 --- a/src/client/src/components/ChatView.test.ts +++ b/src/client/src/components/ChatView.test.ts @@ -141,22 +141,6 @@ describe("ChatView session-warning dismiss wiring", () => { expect(onDismissWarning).toHaveBeenCalledExactlyOnceWith("anthropicExtraUsage"); }); - // Escape hatch: this verifies the collapse button's Lit callback wiring in - // the node test environment, anchored to its stable semantic class marker. - it("invokes onCollapseWarnings from the visible warning area", () => { - const view = withStatus(new ChatView(), warningStatus([ - { severity: "warning", message: "subscription auth is active" }, - ])); - const onCollapseWarnings = vi.fn(); - view.onCollapseWarnings = onCollapseWarnings; - - const rendered = renderWarnings(view); - if (rendered === null) throw new Error("expected a warnings banner"); - templateEventHandlerAfterMarker(rendered, "session-warnings-collapse")(new Event("click")); - - expect(onCollapseWarnings).toHaveBeenCalledOnce(); - }); - it("removes the warning area while presentation is collapsed or there are no warnings", () => { const view = withStatus(new ChatView(), warningStatus([ { severity: "warning", message: "subscription auth is active" }, diff --git a/src/client/src/components/ChatView.ts b/src/client/src/components/ChatView.ts index c68507a..b8c7390 100644 --- a/src/client/src/components/ChatView.ts +++ b/src/client/src/components/ChatView.ts @@ -1,4 +1,4 @@ -import { LitElement, html, svg } from "lit"; +import { LitElement, html } from "lit"; import { customElement, property, query, state } from "lit/decorators.js"; import { repeat } from "lit/directives/repeat.js"; import { ChatDisclosureController } from "../chatDisclosure"; @@ -199,7 +199,6 @@ export class ChatView extends LitElement { @property({ attribute: false }) onDismissNotification?: (notificationId: string) => void; @property({ attribute: false }) onDismissAllNotifications?: () => void; @property({ type: Boolean }) warningsVisible = true; - @property({ attribute: false }) onCollapseWarnings?: () => void; @property({ attribute: false }) onLoadMore?: () => void; @query(".chat") private chat?: HTMLDivElement; @query("dialog.image-zoom") private imageZoomDialog?: HTMLDialogElement; @@ -253,9 +252,6 @@ export class ChatView extends LitElement { private readonly handleClearServerQueue = (): void => { this.onClearServerQueue?.(); }; - private readonly handleCollapseWarnings = (): void => { - this.onCollapseWarnings?.(); - }; override connectedCallback(): void { super.connectedCallback(); @@ -515,24 +511,6 @@ export class ChatView extends LitElement { if (!this.warningsVisible || rows.length === 0) return null; return html`