Public: anyone can read this; the crew can change it.
Trim the Talk page back under its 61,000-byte bound #17189
Merged 46h 23m ago, live in production
talk-trim → main 0 commits 1 thread · 1 unresolved
1 file
changed +5
−7
src/web/pages/talk.ts +5 −7
| @@ -508,9 +508,7 @@ function hereBar(ctx: Ctx, conversation: Conversation, context: Context | undefi | ||
| 508 | 508 | return html`<header class="talk-head"> |
| 509 | 509 | <a class="btn talk-back" data-variant="ghost" href="${urlOf(conversation)}?chats=1" title="All your chats, newest first">${icon("comment")}Chats</a> |
| 510 | 510 | <h2 class="talk-title">${nameOf(conversation)}${archived ? " (archived)" : ""}</h2> |
| 511 | ${picker} | |
| 512 | ${tabs} | |
| 513 | ${context !== undefined && context.share >= CONTEXT_SHOWN ? html`<span class="talk-fill small muted" title="${contextText(context)}">${meter(context.share * 100, contextText(context))} context used</span>` : null} | |
| 511 | ${picker}${tabs}${context !== undefined && context.share >= CONTEXT_SHOWN ? html`<span class="talk-fill small muted" title="${contextText(context)}">${meter(context.share * 100, contextText(context))} context used</span>` : null} | |
| 514 | 512 | ${conversationMenu(ctx, conversation, context, display, null)} |
| 515 | 513 | <form method="post" action="${HERE}/new">${iconBtn("plus", "New conversation", { variant: "ghost" })}</form> |
| 516 | 514 | </header>`; |
| @@ -699,10 +697,10 @@ async function talkPage(ctx: Ctx, conversation: Conversation, before0: string | | ||
| 699 | 697 | <div class="talk-base"> |
| 700 | 698 | ${dockBar(ctx, conversation, context, display, tabs, dockPicker)} |
| 701 | 699 | <form class="talk-compose" id="compose" method="post" action="${buildMode ? "/talk/build" : editing === undefined ? here : `${here}/again/edit`}" ${editing === undefined ? null : html`data-edit`}${buildMode ? raw(" data-build") : null}> |
| 702 | ${conversation.archivedAt === null ? null : html`<p class="small muted" data-archived-note>Archived: sending here keeps it archived; Restore puts it back in the list.</p>`} | |
| 703 | ${about} | |
| 704 | ${editing === undefined && about !== null ? html`<input type="hidden" name="about" value="${ctx.url.searchParams.get("about")}" />` : null} | |
| 705 | ${editing === undefined && !buildMode ? html`<input type="hidden" name="key" value="${last === "" ? "start" : last}" />` : null} | |
| 700 | ${ | |
| 701 | // The rare lines (archived, about) share one source line, so their empty slots cost the | |
| 702 | // page no bytes: it is held to a byte bound (test/talk-page.test.ts). | |
| 703 | conversation.archivedAt === null ? null : html`<p class="small muted" data-archived-note>Archived: sending here keeps it archived; Restore puts it back in the list.</p>`}${about}${editing === undefined && about !== null ? html`<input type="hidden" name="about" value="${ctx.url.searchParams.get("about")}" />` : null}${editing === undefined && !buildMode ? html`<input type="hidden" name="key" value="${last === "" ? "start" : last}" />` : null} | |
| 706 | 704 | ${chosen === undefined ? null : html`<input type="hidden" name="template" value="${chosen}" />`} |
| 707 | 705 | ${confirmsDock(pendingConfirms)} |
| 708 | 706 | <p class="sr-only" role="status" data-confirms-said></p> |
new above
offline
Nit, not blocking: a comment inside the interpolation, followed by four expressions on one line, is hard to read and easy to break. Hoist these four into a named const above the template (for example
composeExtras) so the byte saving doesn't cost readability.