AI-powered virtual executive team — a single coherent executive persona backed by 8 specialist agents (FastAPI + Next.js).
feat(ui): keep the Topic view short with one-line topics and five per band (#538)
Rufus511e1a999624
diff --git a/packages/core/openexecutive/guide/prebuilt/chat.json b/packages/core/openexecutive/guide/prebuilt/chat.jsonindex b1bcd18a..b7e1aaac 100644--- a/packages/core/openexecutive/guide/prebuilt/chat.json+++ b/packages/core/openexecutive/guide/prebuilt/chat.json@@ -1,7 +1,7 @@{"section_id": "chat","title": "Chat & Briefing",- "markdown": "**What it is:** Where you talk to the Executive in plain language. The app opens on **Home**, a quick read of what's happened across the company and what needs you, and you drop into a chat whenever you want to ask or decide something. Every conversation is kept on the **Chats** page.\n\n**What it does:**\n\n- Hold a natural conversation with the Executive, which quietly pulls in whichever specialists a question needs.\n- Keep every chat with its full history, so you can pick up where you left off.\n- See each reply under the Executive's name, the one it goes by in mail and chat.\n- Attach files to a message: up to 5 per message, 20 MB each (PNG, JPEG, GIF and WebP images, PDF, Word, Excel, text, Markdown, CSV). The Executive reads them for that message.\n- Stop a reply while it is still coming. Whatever has been written is kept and marked *Stopped by you*. (Escape works too.)\n- Add to a reply while it works: type and send, and your message joins the answer in progress (*Sent while it works*, then *👀 Seen, taking it into this answer*).\n- Redo your last turn in a web chat: **Try again** under the last reply asks the same question again, and **Edit** under your last message lets you change it. Sending an edit replaces that message and its answer.\n- Turn on **Committee review** for a question that matters: a slower pass where reviewers challenge the draft answer before you see it.\n- Continue any item on Home straight into a chat thread, with the context already filled in.\n- Choose **Show agent activity** in the **⋯** menu at the top right to watch what's happening behind a reply: which specialists were consulted and which tools ran.\n- See what an answer drew on: click **Sources (N)** under a reply to list the documents and web pages it looked at (your own documents, the built-in knowledge and any web pages), with links where there are any.\n- Copy a reply with **Copy**, and rate it with 👍 (**Helpful**) or 👎 (**Not helpful**).\n\n**How to use:**\n\n1. Click **New chat** at the top of the sidebar (on a phone, the **+** in the middle of the bar at the bottom), or type into the **Ask your Executive anything…** box on Home. Click **Home** any time to get back.\n2. Type your question and press **Enter** to send. **Shift + Enter** starts a new line. When the box is empty, a greyed-out suggested follow-up may appear; press **Tab** or **→** to use it (on a phone, tap **Use suggestion**).\n3. To include a file, click the **+** next to the message box, choose **Attach files or photos** and pick up to 5 files. Drag-and-drop isn't supported in chat. Attachments are read for that message only. To make a document permanently available, add it on the **Knowledge** page.\n4. For a decision that matters, click the **+** next to the message box and choose **Committee review (slower, reviewed)** before sending. A **Committee review on** chip appears above the box. It stays on for each message you send until you click the chip (or choose **Turn off committee review** in the **+** menu). While it works you see *Drafting → Committee review → Revising*.\n5. Changed your mind mid-answer? Click the stop button (next to the message box while a reply is streaming) or press **Esc**.\n6. In an open chat, the **⋯** menu at the top right has **Pin** / **Unpin**, **Rename**, **Share**, **Download** and **Show agent activity**. Deleting is on the **Chats** page.\n7. If part of an answer couldn't be completed (say, the finance side), you still get the rest, with a short note under it. Ask again to fill in the missing part.\n8. When something you asked for needs your approval (a meeting the Executive set up for you to approve, or actions it suggested from your email), its card appears right under the reply: **Approve**, **Edit** (for a meeting: its title, start and end) and **Dismiss**. After **Approve** a meeting's card says *Booked. It's on your calendar.* The same card also waits under **Needs you** on Today until you answer it in either place. Saying *ok* in the chat doesn't book it; tap **Approve**. Things the Executive raises on its own come only to Today.\n\n**Chats page:** click **Chats** in the sidebar (on a phone, **Chats** in the bar at the bottom). It lists every conversation you own: web chats and the ones that came in through Slack, Telegram, Discord, Email and Google Chat. You only see your own chats here, plus the ones someone shared with you.\n\n- **Channel tabs:** **All** and **Web** are always there. A tab for Slack, Telegram, Discord, Email or Google Chat appears once you have a chat from it. Each tab shows its app's logo and its count. Every chat ends with the logo of where it came from: the Open Executive mark for web chats, the app's own logo for Slack, Telegram, Discord and Google Chat, and an envelope for Email.\n- **Groups:** chats are grouped into **Pinned**, **Today**, **Yesterday**, **Previous 7 Days**, **Previous 30 Days** and **Older** (collapsed until you click it). Each group shows 20 chats, then **Show N more**. Each row shows the title, when it was last active and how many messages it has.\n- **Date or Topic:** the **Date** / **Topic** switch at the right of the channel tabs, under the search box changes how the list is grouped, and the page remembers your choice. **Topic** groups your chats by what they are about (a hire, a customer, a project), whichever app they came from. Every new chat is filed under a topic when it gets its title. The first time you open **Topic**, your earlier chats are grouped from their titles, and the page says *Grouping your earlier chats by topic…* until that's done. **Pinned** stays at the top. A topic with only one chat, and chats with no lasting topic, go under **Other** (collapsed until you click it). Related topics sit under one **area** (one property, deal or client), each header shows the day it was last active, and an open topic shows its three newest chats with **Show more** for the rest. Topics with a chat this week are listed under **Active this week**; quieter ones fold into **Quiet for a week**, **Quiet for 2 weeks** and **Quiet for a month or more**, and a new chat brings a topic back up. In **Topic**, the search box also finds topic and area names.\n- **Topic ⋯ menu:** **Rename topic**, **Merge into…** (moves its chats into another topic), **Pin topic** / **Unpin topic** and **Ungroup** (its chats stay, under **Other**). Renaming a topic to the name of another one merges them. An area's ⋯ menu has **Rename area** and **Ungroup area** (its topics stand on their own, and stay so). Only you see your topics.\n- **Search:** type in **Search titles and messages**. It searches the titles and message text of your own chats (up to 50 results). Each result shows *title match* or how many messages matched, with a snippet that highlights your words. Open a result found in its messages and the chat shows a bar with *match 1 of N* and arrows to step through the matches. Search does not cover chats shared with you.\n- **Row ⋯ menu** (your own chats): **Pin** / **Unpin**, **Rename**, **Move to topic**, **Share**, **Download** and **Delete chat**.\n - **Move to topic** files the chat under one of your topics, a new one, or **No topic**. Your choice sticks: the Executive never moves that chat again, and a topic you renamed, pinned or moved a chat into is never merged on its own.\n - **Pin** moves the chat to the **Pinned** group at the top. Only you see your pins.\n - **Rename** gives the chat a name (up to 120 characters). The automatic title never replaces a name you set.\n - **Download** saves the whole chat as a Markdown (.md) file: each message under who wrote it (the person's name or *Executive*), with each reply's sources listed under it.\n - **Delete chat** asks *Delete this chat? This cannot be undone.* Deleting removes the chat and its messages from Open Executive and ends any sharing of it. Messages in Slack, Telegram or Discord stay in those apps.\n- **New chat** at the top right starts a new web chat.\n\n**Sharing a chat:**\n\n- **Who you can share with:** team members on your **People** list. Contacts, archived people and yourself are not offered. If no one else is on your team, the panel says *There's no one else on your team to share with yet.*\n- **How:** in an open chat, choose **Share** in the **⋯** menu or the **Share** button in the bar above the conversation; on the **Chats** page, the chat's row **⋯** menu has **Share** too. The panel *Share this chat with:* says *They join the chat and can write in it with you.* and lists your team with a checkbox each. Tick the people, then click **Save**. It confirms *Shared.* Only the chat's owner can share it. There is no share link: access goes to the named people only.\n- **What they get:** they join the chat and write in it with you. It appears on their **Chats** page under **Shared with you**, with *<your name> added you* and when. They are not notified. Their row **⋯** menu has **Download** and **Leave chat**.\n- **Working in it together:** a bar above the conversation shows everyone's initials and *You and <name>* (or *You and N others*). Each person's message shows their name; your own stay on the right. The Executive sees who wrote each message and answers whoever wrote the latest. Everyone with the chat open sees a new message and the Executive's reply as it is written, and *<name> is typing…* above the message box. One turn runs at a time: while the Executive answers someone else, the box says *The Executive is answering <name>…* and Send waits. A chat left open in a background tab catches up when you come back to it.\n- **What only the owner can do:** rename, pin, rate replies (👍/👎), share, delete. **Try again** and **Edit** work only on your own last message, and not for the people you shared with. They don't see your ratings or your pin.\n- **What stays out of a shared chat:** everyone in it reads every reply, so it is not a private conversation. **Act as me** is off there, the Executive won't read anyone's own mail there, and your private items on Today (your mail, people waiting on you, new senders) are not brought into it.\n- **Sending from a shared chat:** once someone else writes in it, the Executive's next reply won't send email, message people, post to the company or a department, book or cancel meetings, set follow-ups, run or schedule workflows or change contacts, even when that reply is to the chat's owner. It says so, and the owner can ask again in their following message.\n- **Which chats can't be shared:** a chat in which the Executive read or drafted in your own mailbox (**Act as me**) stays yours alone. Saving a share on it fails with *This chat read your own mail, so it stays yours alone.* If a chat you already shared later reads your mail, it disappears from everyone's **Shared with you** list and they can no longer open it. This can't be undone. A conversation from Slack, Telegram, Discord, Email or Google Chat can't be shared: *Only a chat started here can be shared.*\n- **Leaving and removing:** someone you shared with can leave from the **Leave** button in the bar or **Leave chat** in the row menu; you can add them again. To remove people, open **Share**, untick them and click **Save** (with nobody ticked it says *Not shared with anyone.*). Someone removed, or who leaves, sees *You're no longer in this chat.* and later *This chat isn't shared with you any more.* if they open it. Archiving someone on **People** takes them out of every chat. Deleting the chat ends it for everyone (*This chat was deleted.*).\n- **Records:** each change to who is in a chat, including someone leaving, is written to the audit log.\n\n**Example prompts:**\n\n- \"Here's our Q3 board deck. What questions should I expect from the board?\" *(with the PDF attached)*\n- \"Should we raise prices 10% for new customers? I want the finance and marketing view.\" *(with Committee review on)*\n- \"What changed across the company this week that I should know about?\"\n\n*Tip: this is the front door. Almost everything else in the app is something the Executive references or acts on from here.*",+ "markdown": "**What it is:** Where you talk to the Executive in plain language. The app opens on **Home**, a quick read of what's happened across the company and what needs you, and you drop into a chat whenever you want to ask or decide something. Every conversation is kept on the **Chats** page.\n\n**What it does:**\n\n- Hold a natural conversation with the Executive, which quietly pulls in whichever specialists a question needs.\n- Keep every chat with its full history, so you can pick up where you left off.\n- See each reply under the Executive's name, the one it goes by in mail and chat.\n- Attach files to a message: up to 5 per message, 20 MB each (PNG, JPEG, GIF and WebP images, PDF, Word, Excel, text, Markdown, CSV). The Executive reads them for that message.\n- Stop a reply while it is still coming. Whatever has been written is kept and marked *Stopped by you*. (Escape works too.)\n- Add to a reply while it works: type and send, and your message joins the answer in progress (*Sent while it works*, then *👀 Seen, taking it into this answer*).\n- Redo your last turn in a web chat: **Try again** under the last reply asks the same question again, and **Edit** under your last message lets you change it. Sending an edit replaces that message and its answer.\n- Turn on **Committee review** for a question that matters: a slower pass where reviewers challenge the draft answer before you see it.\n- Continue any item on Home straight into a chat thread, with the context already filled in.\n- Choose **Show agent activity** in the **⋯** menu at the top right to watch what's happening behind a reply: which specialists were consulted and which tools ran.\n- See what an answer drew on: click **Sources (N)** under a reply to list the documents and web pages it looked at (your own documents, the built-in knowledge and any web pages), with links where there are any.\n- Copy a reply with **Copy**, and rate it with 👍 (**Helpful**) or 👎 (**Not helpful**).\n\n**How to use:**\n\n1. Click **New chat** at the top of the sidebar (on a phone, the **+** in the middle of the bar at the bottom), or type into the **Ask your Executive anything…** box on Home. Click **Home** any time to get back.\n2. Type your question and press **Enter** to send. **Shift + Enter** starts a new line. When the box is empty, a greyed-out suggested follow-up may appear; press **Tab** or **→** to use it (on a phone, tap **Use suggestion**).\n3. To include a file, click the **+** next to the message box, choose **Attach files or photos** and pick up to 5 files. Drag-and-drop isn't supported in chat. Attachments are read for that message only. To make a document permanently available, add it on the **Knowledge** page.\n4. For a decision that matters, click the **+** next to the message box and choose **Committee review (slower, reviewed)** before sending. A **Committee review on** chip appears above the box. It stays on for each message you send until you click the chip (or choose **Turn off committee review** in the **+** menu). While it works you see *Drafting → Committee review → Revising*.\n5. Changed your mind mid-answer? Click the stop button (next to the message box while a reply is streaming) or press **Esc**.\n6. In an open chat, the **⋯** menu at the top right has **Pin** / **Unpin**, **Rename**, **Share**, **Download** and **Show agent activity**. Deleting is on the **Chats** page.\n7. If part of an answer couldn't be completed (say, the finance side), you still get the rest, with a short note under it. Ask again to fill in the missing part.\n8. When something you asked for needs your approval (a meeting the Executive set up for you to approve, or actions it suggested from your email), its card appears right under the reply: **Approve**, **Edit** (for a meeting: its title, start and end) and **Dismiss**. After **Approve** a meeting's card says *Booked. It's on your calendar.* The same card also waits under **Needs you** on Today until you answer it in either place. Saying *ok* in the chat doesn't book it; tap **Approve**. Things the Executive raises on its own come only to Today.\n\n**Chats page:** click **Chats** in the sidebar (on a phone, **Chats** in the bar at the bottom). It lists every conversation you own: web chats and the ones that came in through Slack, Telegram, Discord, Email and Google Chat. You only see your own chats here, plus the ones someone shared with you.\n\n- **Channel tabs:** **All** and **Web** are always there. A tab for Slack, Telegram, Discord, Email or Google Chat appears once you have a chat from it. Each tab shows its app's logo and its count. Every chat ends with the logo of where it came from: the Open Executive mark for web chats, the app's own logo for Slack, Telegram, Discord and Google Chat, and an envelope for Email.\n- **Groups:** chats are grouped into **Pinned**, **Today**, **Yesterday**, **Previous 7 Days**, **Previous 30 Days** and **Older** (collapsed until you click it). Each group shows 20 chats, then **Show N more**. Each row shows the title, when it was last active and how many messages it has.\n- **Date or Topic:** the **Date** / **Topic** switch at the right of the channel tabs, under the search box changes how the list is grouped, and the page remembers your choice. **Topic** groups your chats by what they are about (a hire, a customer, a project), whichever app they came from. Every new chat is filed under a topic when it gets its title. The first time you open **Topic**, your earlier chats are grouped from their titles, and the page says *Grouping your earlier chats by topic…* until that's done. **Pinned** stays at the top. A topic with only one chat, and chats with no lasting topic, go under **Other** (collapsed until you click it). Related topics sit under one **area** (one property, deal or client), each header shows the day it was last active, and an open topic shows its three newest chats with **Show more** for the rest. Topics with a chat this week are listed under **Active this week**; quieter ones fold into **Quiet for a week**, **Quiet for 2 weeks** and **Quiet for a month or more**, and a new chat brings a topic back up. Each band lists its five most recent topics, one line each, then **Show N more topics**. In **Topic**, the search box also finds topic and area names.\n- **Topic ⋯ menu:** **Rename topic**, **Merge into…** (moves its chats into another topic), **Pin topic** / **Unpin topic** and **Ungroup** (its chats stay, under **Other**). Renaming a topic to the name of another one merges them. An area's ⋯ menu has **Rename area** and **Ungroup area** (its topics stand on their own, and stay so). Only you see your topics.\n- **Search:** type in **Search titles and messages**. It searches the titles and message text of your own chats (up to 50 results). Each result shows *title match* or how many messages matched, with a snippet that highlights your words. Open a result found in its messages and the chat shows a bar with *match 1 of N* and arrows to step through the matches. Search does not cover chats shared with you.\n- **Row ⋯ menu** (your own chats): **Pin** / **Unpin**, **Rename**, **Move to topic**, **Share**, **Download** and **Delete chat**.\n - **Move to topic** files the chat under one of your topics, a new one, or **No topic**. Your choice sticks: the Executive never moves that chat again, and a topic you renamed, pinned or moved a chat into is never merged on its own.\n - **Pin** moves the chat to the **Pinned** group at the top. Only you see your pins.\n - **Rename** gives the chat a name (up to 120 characters). The automatic title never replaces a name you set.\n - **Download** saves the whole chat as a Markdown (.md) file: each message under who wrote it (the person's name or *Executive*), with each reply's sources listed under it.\n - **Delete chat** asks *Delete this chat? This cannot be undone.* Deleting removes the chat and its messages from Open Executive and ends any sharing of it. Messages in Slack, Telegram or Discord stay in those apps.\n- **New chat** at the top right starts a new web chat.\n\n**Sharing a chat:**\n\n- **Who you can share with:** team members on your **People** list. Contacts, archived people and yourself are not offered. If no one else is on your team, the panel says *There's no one else on your team to share with yet.*\n- **How:** in an open chat, choose **Share** in the **⋯** menu or the **Share** button in the bar above the conversation; on the **Chats** page, the chat's row **⋯** menu has **Share** too. The panel *Share this chat with:* says *They join the chat and can write in it with you.* and lists your team with a checkbox each. Tick the people, then click **Save**. It confirms *Shared.* Only the chat's owner can share it. There is no share link: access goes to the named people only.\n- **What they get:** they join the chat and write in it with you. It appears on their **Chats** page under **Shared with you**, with *<your name> added you* and when. They are not notified. Their row **⋯** menu has **Download** and **Leave chat**.\n- **Working in it together:** a bar above the conversation shows everyone's initials and *You and <name>* (or *You and N others*). Each person's message shows their name; your own stay on the right. The Executive sees who wrote each message and answers whoever wrote the latest. Everyone with the chat open sees a new message and the Executive's reply as it is written, and *<name> is typing…* above the message box. One turn runs at a time: while the Executive answers someone else, the box says *The Executive is answering <name>…* and Send waits. A chat left open in a background tab catches up when you come back to it.\n- **What only the owner can do:** rename, pin, rate replies (👍/👎), share, delete. **Try again** and **Edit** work only on your own last message, and not for the people you shared with. They don't see your ratings or your pin.\n- **What stays out of a shared chat:** everyone in it reads every reply, so it is not a private conversation. **Act as me** is off there, the Executive won't read anyone's own mail there, and your private items on Today (your mail, people waiting on you, new senders) are not brought into it.\n- **Sending from a shared chat:** once someone else writes in it, the Executive's next reply won't send email, message people, post to the company or a department, book or cancel meetings, set follow-ups, run or schedule workflows or change contacts, even when that reply is to the chat's owner. It says so, and the owner can ask again in their following message.\n- **Which chats can't be shared:** a chat in which the Executive read or drafted in your own mailbox (**Act as me**) stays yours alone. Saving a share on it fails with *This chat read your own mail, so it stays yours alone.* If a chat you already shared later reads your mail, it disappears from everyone's **Shared with you** list and they can no longer open it. This can't be undone. A conversation from Slack, Telegram, Discord, Email or Google Chat can't be shared: *Only a chat started here can be shared.*\n- **Leaving and removing:** someone you shared with can leave from the **Leave** button in the bar or **Leave chat** in the row menu; you can add them again. To remove people, open **Share**, untick them and click **Save** (with nobody ticked it says *Not shared with anyone.*). Someone removed, or who leaves, sees *You're no longer in this chat.* and later *This chat isn't shared with you any more.* if they open it. Archiving someone on **People** takes them out of every chat. Deleting the chat ends it for everyone (*This chat was deleted.*).\n- **Records:** each change to who is in a chat, including someone leaving, is written to the audit log.\n\n**Example prompts:**\n\n- \"Here's our Q3 board deck. What questions should I expect from the board?\" *(with the PDF attached)*\n- \"Should we raise prices 10% for new customers? I want the finance and marketing view.\" *(with Committee review on)*\n- \"What changed across the company this week that I should know about?\"\n\n*Tip: this is the front door. Almost everything else in the app is something the Executive references or acts on from here.*","mermaid": null,"generated_at": "2026-10-17T22:00:00Z"}diff --git a/packages/ui/scripts/sessionGroups.test.mjs b/packages/ui/scripts/sessionGroups.test.mjsindex 3a23769e..d6db0014 100644--- a/packages/ui/scripts/sessionGroups.test.mjs+++ b/packages/ui/scripts/sessionGroups.test.mjs@@ -175,3 +175,44 @@ test("activeLabel says Today, Yesterday, a weekday, then the date", async () =>);assert.equal(activeLabel("", now), "");});++test("topic layout: an area's name comes off only as a whole word", async () => {+ const { layoutTopics } = await import("../src/lib/sessionGroups.ts");+ const now = new Date(2026, 9, 17, 12, 0, 0);+ const when = new Date(2026, 9, 16, 9).toISOString();+ const topics = [+ { id: 1, name: "Board: Q3 deck", chat_count: 2, kept: false, area: "Board" },+ { id: 2, name: "Boardwalk Permit", chat_count: 2, kept: false, area: "Board" },+ ];+ const sessions = ["a", "b", "c", "d"].map((id, i) => ({+ session_id: id,+ title: id,+ created_at: when,+ updated_at: when,+ message_count: 2,+ topic_id: i < 2 ? 1 : 2,+ }));+ const [area] = layoutTopics(sessions, topics, now).bands[0].entries;+ assert.deepEqual(area.children.map((g) => g.label).sort(), ["Boardwalk Permit", "Q3 deck"]);+});++test("topic layout: six days ago is still this week, seven is quiet", async () => {+ const { layoutTopics } = await import("../src/lib/sessionGroups.ts");+ const now = new Date(2026, 9, 17, 12, 0, 0);+ const topics = [+ { id: 1, name: "Six", chat_count: 2, kept: false },+ { id: 2, name: "Seven", chat_count: 2, kept: false },+ ];+ const chat = (session_id, day, topic_id) => {+ const t = new Date(2026, 9, 17 - day, 9).toISOString();+ return { session_id, title: session_id, created_at: t, updated_at: t, message_count: 2, topic_id };+ };+ const sessions = [chat("s1", 6, 1), chat("s2", 6, 1), chat("v1", 7, 2), chat("v2", 7, 2)];+ assert.deepEqual(+ layoutTopics(sessions, topics, now).bands.map((b) => [b.label, b.entries.map((e) => e.label)]),+ [+ ["Active this week", ["Six"]],+ ["Quiet for a week", ["Seven"]],+ ],+ );+});diff --git a/packages/ui/src/components/sessions/ChatHistory.tsx b/packages/ui/src/components/sessions/ChatHistory.tsxindex 3d23cc04..54aa23d2 100644--- a/packages/ui/src/components/sessions/ChatHistory.tsx+++ b/packages/ui/src/components/sessions/ChatHistory.tsx@@ -37,6 +37,8 @@ import {const GROUP_CAP = 20;// Chats an open topic shows before "Show N more".const TOPIC_CAP = 3;+// How many topics a band shows before "Show N more topics".+const BAND_CAP = 5;const DEFAULT_COLLAPSED = new Set<string>(["older" satisfies GroupKey, "other"]);export type ChatsView = "date" | "topic";@@ -170,8 +172,9 @@ export default function ChatHistory({// The Topic view: pinned chats, then topics (and areas over related ones)// in bands by how long since their last chat, then Other. The active band-// shows its topics; a quiet band folds into one line until opened. An open-// topic shows its newest few chats. A search opens everything.+// shows its topics; a quiet band folds into one line until opened. A band+// shows its five most recent topics, one short line each, then "Show N more+// topics"; an open topic shows its newest few chats. A search opens everything.function TopicHistory({sessions,searching,@@ -286,7 +289,6 @@ function TopicHistory({key: g.key,label: g.label,count: g.items.length,- preview: g.items[0] ? sessionTitle(g.items[0]) : undefined,when: activeLabel(g.items[0]?.updated_at ?? ""),menu: g.topic ? <TopicMenu topic={g.topic} topics={topics} onChanged={onChanged} /> : undefined,indent,@@ -313,6 +315,26 @@ function TopicHistory({topicBlock({ key: e.key, label: e.label, topic: e.topic, items: e.items }, ""));+ const entries = (key: string, list: TopicEntry[]) => {+ const all = searching || showAll.has(key);+ const visible = all ? list : list.slice(0, BAND_CAP);+ const hidden = list.length - visible.length;+ return (+ <>+ {visible.map(entryBlock)}+ {hidden > 0 && (+ <button+ type="button"+ onClick={() => setShowAll((prev) => new Set(prev).add(key))}+ className="w-full text-left min-h-[40px] px-6 text-sm font-medium text-accent hover:text-fg border-b border-line cursor-pointer"+ >+ Show {hidden} more topic{hidden === 1 ? "" : "s"}+ </button>+ )}+ </>+ );+ };+return (<div>{layout.pinned && (@@ -327,7 +349,7 @@ function TopicHistory({<section key={band.key} aria-label={band.label} className="mt-6"><h2 className="px-1 mb-1 text-xs font-semibold uppercase tracking-wider text-fg-subtle">{band.label}</h2>{band.key === "active" ? (- band.entries.map(entryBlock)+ entries(bandKey, band.entries)) : (<>{header({@@ -336,7 +358,7 @@ function TopicHistory({count: band.entries.reduce((n, e) => n + e.items.length, 0),preview: band.entries.map((e) => e.label).join(" · "),})}- {isOpen(bandKey) && <div className="ml-6">{band.entries.map(entryBlock)}</div>}+ {isOpen(bandKey) && <div className="ml-6">{entries(bandKey, band.entries)}</div>}</>)}</section>diff --git a/packages/ui/src/lib/sessionGroups.ts b/packages/ui/src/lib/sessionGroups.tsindex 70b8d58a..9cf30943 100644--- a/packages/ui/src/lib/sessionGroups.ts+++ b/packages/ui/src/lib/sessionGroups.ts@@ -179,7 +179,10 @@ function newest(items: SessionSummary[]): string {function withinArea(name: string, area: string): string {if (!name.toLowerCase().startsWith(area.toLowerCase())) return name;- const rest = name.slice(area.length).replace(/^[\s:·–—-]+/, "");+ // Only a whole word: "Boardwalk Permit" stays as is under "Board".+ const after = name.slice(area.length);+ if (after && !/^[\s:·–—-]/.test(after)) return name;+ const rest = after.replace(/^[\s:·–—-]+/, "");return rest ? rest[0].toUpperCase() + rest.slice(1) : name;}