From 6828e64a256caea3c4e51829ae1aa09dfa725324 Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Mon, 7 Sep 2026 00:33:51 +0200 Subject: fix(client): report a directory result under the button that caused it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The message was the first thing in the section, wedged between the intro and the table header — above everything the eye has already moved past by the time it appears. It goes last now, under Add directory. And it was a `settings-hint`: dim grey body text. So "two roots would both be called uploads" read as a footnote about the section rather than as the reason nothing happened. A refusal is styled as one and carries `role="alert"`, so it is announced rather than only drawn; a success stays quiet. Measured in a real Electron window rather than assumed — the failing add driven through the typed-path form, then the message's box compared against the table's and the button's. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_011pvMdvLBG92jyhvD5pD6us --- .../meshbay-hub/tests/test_app_settings_plugin.py | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'packages/meshbay-hub/tests') diff --git a/packages/meshbay-hub/tests/test_app_settings_plugin.py b/packages/meshbay-hub/tests/test_app_settings_plugin.py index 1837c28..6a768a9 100644 --- a/packages/meshbay-hub/tests/test_app_settings_plugin.py +++ b/packages/meshbay-hub/tests/test_app_settings_plugin.py @@ -278,3 +278,45 @@ def test_the_search_cache_reads_both_shapes(): fn = _component(source, "cachedDirs") assert "legacyKey" in fn assert "videoRoot" in source and "audioRoot" in source and "photoRoots" in source + + +# ── Where a result is reported ────────────────────────────────────────────── + +def test_the_directory_result_is_reported_below_the_controls(): + """ + It was rendered first, between the section's intro and the table header — + above everything the eye had already moved past by the time it appeared. + It belongs under the button that caused it, which is the last thing in the + section. + """ + table = _component(GROUP_SETTINGS.read_text(encoding="utf-8"), + "SharedDirectoriesTable") + # Two of them: the early return for a group with no directories yet, and + # the real one. Both report, and both must report last — keyed on the + # wrapper rather than on `return`, of which there are more. + blocks = table.split('
')[1:] + assert len(blocks) == 2, "the section's shape changed; this test is stale" + + for block in blocks: + assert block.index("${addControls}") < block.index("${message}"), ( + "the result is rendered above the Add button rather than below it") + + with_table = next(b for b in blocks if "