From 80ca7dd0765a6c08fa5ea54c2e14972bba6fa564 Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Mon, 7 Sep 2026 00:18:54 +0200 Subject: fix(client): New folder did nothing — prompt() throws in the desktop client MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The same `static/` tree is the web page and the application, and Electron does not implement `window.prompt`: Chromium leaves it to the embedder and Electron declines. It does not return null — it **throws**. The call sat above its own try, so clicking produced no folder, no error and nothing on screen to react to. A dead button, which is exactly how it was reported. Measured against this repo's own Electron 44 rather than assumed, because the first two diagnoses this session were reasoned and wrong: prompt('name?') -> Error: prompt() is not supported. confirm('sure?') -> opens a real modal alert('hi') -> opens a real modal So `confirm` and `alert` stay — a dozen call sites depend on them — and only `prompt` is banned. `test_no_prompt_in_the_spa.py` holds the whole tree to it, with the near-misses it must not flag (`mkdir_prompt`, `promptForName`). The name now comes from a field in the toolbar, which works in both clients and can show the node's refusal beside the input instead of after a dialog has closed. Navigating away drops a half-typed name: it would otherwise create the folder somewhere the person is no longer looking. The rest of the chain was verified end to end and was sound: `dir_create` {dir,name} → the node's handler → `dir_create_ack`, and `list_dirs` walks the filesystem rather than the index, so a folder with nothing in it appears on the very fetch that follows. The field itself was then driven inside a real Electron window — typing, Enter, the click, and the icon rendering. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_011pvMdvLBG92jyhvD5pD6us --- .../meshbay-hub/tests/test_upload_controls_hidden.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'packages/meshbay-hub/tests/test_upload_controls_hidden.py') diff --git a/packages/meshbay-hub/tests/test_upload_controls_hidden.py b/packages/meshbay-hub/tests/test_upload_controls_hidden.py index a61de1f..bdba373 100644 --- a/packages/meshbay-hub/tests/test_upload_controls_hidden.py +++ b/packages/meshbay-hub/tests/test_upload_controls_hidden.py @@ -94,13 +94,20 @@ def test_an_icon_only_button_still_says_what_it_is(): The name moved into a tooltip to save toolbar width. A `title` is invisible to a screen reader on a button with no text, so the label has to be there as well — otherwise the control is simply unnamed for anyone not reading - with their eyes. + with their eyes. The same goes for the field it opens, which has a + placeholder and no visible label. """ page = _component(FILES_APP.read_text(encoding="utf-8"), "FilesPanel") - block = page[page.index("canCreateDir && html`"):] - block = block[:block.index("")] - assert "title=" in block and "aria-label=" in block - assert "group.mkdir" in block + opener = page[page.index("canCreateDir && newDirName === null"):] + opener = opener[:opener.index("")] + assert "title=" in opener and "aria-label=" in opener + assert "group.mkdir" in opener + + field = page[page.index("canCreateDir && newDirName !== null"):] + field = field[:field.index("")] + assert "aria-label=" in field, ( + "the name field is labelled by a placeholder alone, which a screen " + "reader does not announce as a name") def test_the_chat_composer_hides_its_paperclip(): -- cgit v1.2.3