From 4ca53ccf3aea23899278fd9c4607ce16d5f67346 Mon Sep 17 00:00:00 2001 From: Justin Parker Date: Sun, 8 Nov 2026 08:17:08 -0800 Subject: [PATCH] Warn about a too-long tab name as you type AI Assisted --- CHANGELOG.md | 4 ++++ scripts/test-web-console-page-notepad.mjs | 12 ++++++++++++ src/web-console/public/index.html | 4 +++- src/web-console/public/screens/notepad.js | 23 ++++++++++++++++++++++- src/web-console/public/styles/notepad.css | 2 ++ 5 files changed, 43 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d7b4c14..62f42c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ All notable changes to Plan2Code will be documented in this file. - **web console**: the **Install page** link on the agent setup page now opens in your default browser inside the desktop app. It did nothing there, because the page was not told it was running in the app. - **web console**: a note you have sent now shows a small spinner in front of "Sent, waiting for Plan2Code" in the Notes panel, so it is clear Plan2Code is still working on it. The spinner hides when the agent has gone quiet, so a dead session is not mistaken for a slow one. +### 🔧 Changed + +- **web console**: the Notebook's tab name dialog now counts characters as you type (such as `41/40`), warns the moment a name passes the 40 character limit and disables Save until it fits, instead of only saying so after you press Save. + ## v3.0.3 ### 🐛 Fixed diff --git a/scripts/test-web-console-page-notepad.mjs b/scripts/test-web-console-page-notepad.mjs index c28f4ba..f747574 100644 --- a/scripts/test-web-console-page-notepad.mjs +++ b/scripts/test-web-console-page-notepad.mjs @@ -477,6 +477,17 @@ test("New tab asks for a name, refuses a bad or duplicate one, and Escape backs await s.page.fill("#notepad-name", " "); await s.page.click("#notepad-name-save"); assert.equal(await nameError(s), "Give the tab a name."); + await s.page.fill("#notepad-name", "x".repeat(40)); + assert.equal(await s.page.locator("#notepad-name-count").textContent(), "40/40"); + assert.equal(await s.page.locator("#notepad-name-save").isDisabled(), false, "40 characters still saves"); + await s.page.fill("#notepad-name", "x".repeat(41)); + // The warning and the count show as you type, before Save is pressed. + assert.match(await nameError(s), /40 characters or fewer/); + assert.equal(await s.page.locator("#notepad-name-count").textContent(), "41/40"); + assert.equal(await s.page.locator("#notepad-name-save").isDisabled(), true, "Save waits until the name fits"); + await s.page.fill("#notepad-name", "x".repeat(40)); + assert.equal(await nameError(s), "", "the warning goes once it fits"); + assert.equal(await s.page.locator("#notepad-name-save").isDisabled(), false); await s.page.fill("#notepad-name", "x".repeat(41)); await s.page.keyboard.press("Enter"); assert.match(await nameError(s), /40 characters or fewer/); @@ -582,6 +593,7 @@ test("Double-click opens the rename modal with the name selected; F2 works too, await s.page.locator("#notepad-name-dlg[open]").waitFor(); assert.equal(await s.page.locator("#notepad-name-label").textContent(), "Rename this tab"); assert.equal(await s.page.inputValue("#notepad-name"), "Ideas"); + assert.equal(await s.page.locator("#notepad-name-count").textContent(), "5/40", "Rename shows the count too"); assert.equal(await s.page.evaluate(() => document.getElementById("notepad-name").selectionEnd - document.getElementById("notepad-name").selectionStart), 5, "the name is selected"); // Its own name is not a duplicate; another tab's is. await s.page.keyboard.press("Enter"); diff --git a/src/web-console/public/index.html b/src/web-console/public/index.html index 0c29081..be87b0d 100644 --- a/src/web-console/public/index.html +++ b/src/web-console/public/index.html @@ -3786,7 +3786,8 @@

Name this tab

- + +