Skip to content

Fix workspace tree double-click rename#1702

Merged
1 commit merged into
nesquena:masterfrom
Michaelyklam:fix/issue-1698-double-click-rename
May 5, 2026
Merged

Fix workspace tree double-click rename#1702
1 commit merged into
nesquena:masterfrom
Michaelyklam:fix/issue-1698-double-click-rename

Conversation

@Michaelyklam
Copy link
Copy Markdown
Contributor

Thinking Path

  • Hermes WebUI's right workspace panel advertises double-click rename on file names.
  • File rows also use a single-click handler to open preview content.
  • The bug was that the file-name click bubbled to the row before the dblclick rename path could take over, making the inline input unreachable in practice.
  • The narrow fix is to stop propagation on the file-name span while leaving row/icon/whitespace clicks available for preview.
  • Right-click context-menu rename remains an existing workaround, but double-click now matches the tooltip.

What Changed

  • Added a nameEl.onclick propagation guard before the existing nameEl.ondblclick rename handler in static/ui.js.
  • Added regression coverage proving the name span swallows clicks before dblclick rename while the file row still opens preview.
  • Added browser QA evidence for the inline rename state.

Why It Matters

  • Double-click rename now works from the advertised affordance instead of silently opening preview on the first click.
  • The fix preserves the existing preview behavior for clicks outside the file-name text.

Evidence / UI media

Workspace double-click rename evidence

Browser validation: in an isolated temp WebUI instance, a synthetic workspace row was rendered, click + double-click were dispatched against the file name, openFile() remained at 0 calls, and the focused inline rename input contained selected text rename-me.md.

Verification

  • tests/test_workspace_tree_rename.py initially failed before the fix (1 failed, 1 passed).
  • /home/michael/.hermes/hermes-agent/venv/bin/python -m pytest tests/test_workspace_tree_rename.py -q2 passed in 1.34s
  • env -u HERMES_CONFIG_PATH /home/michael/.hermes/hermes-agent/venv/bin/python -m pytest tests/ -q4479 passed, 2 skipped, 3 xpassed, 1 warning, 8 subtests passed in 407.16s
  • git diff --check → passed
  • Raw media URL check → 200 image/png

Risks / Follow-ups

  • Low risk: the change only stops propagation on the file-name span.
  • Directory double-click behavior is unchanged because the existing dblclick handler still routes directories through loadDir().
  • Existing right-click context-menu rename remains available as a fallback.

Model Used

  • OpenAI Codex gpt-5.5 via Hermes Agent CLI.
  • Tool use: git, pytest, isolated local WebUI server, browser DOM/visual QA.

Closes #1698

@nesquena-hermes nesquena-hermes closed this pull request by merging all changes into nesquena:master in 4daa238 May 5, 2026
Michaelyklam pushed a commit to Michaelyklam/hermes-webui that referenced this pull request May 5, 2026
Michaelyklam added a commit to Michaelyklam/hermes-webui that referenced this pull request May 5, 2026
10 PRs (3 surfaces additions, 7 fixes):
- nesquena#1644 model picker chip + group count (@bergeouss, closes nesquena#1425)
- nesquena#1684 update network failures UX (@Michaelyklam, closes nesquena#1321)
- nesquena#1685 Codex spark models (@Michaelyklam, closes nesquena#1680)
- nesquena#1689 normalize profile base homes (@Michaelyklam, refs nesquena#749)
- nesquena#1693 adaptive title refresh deadlock (@ai-ag2026)
- nesquena#1701 normalize update banner URL (@Michaelyklam, closes nesquena#1691)
- nesquena#1702 workspace double-click rename (@Michaelyklam, closes nesquena#1698)
- nesquena#1703 cache invalidation on auth-store drift (@Michaelyklam, closes nesquena#1699)
- nesquena#1704 markdown fence lengths (@Michaelyklam, closes nesquena#1696)
- nesquena#1706 multi-image paste fix (@Michaelyklam, closes nesquena#1697)

Tests: 4477 → 4503 (+26). Opus: SHIP, 7/7 verification clean.

Co-authored-by: Michael Lam <Michaelyklam1@gmail.com>
Co-authored-by: ai-ag2026 <noreply@github.com>
Co-authored-by: bergeouss <noreply@github.com>
@nesquena-hermes
Copy link
Copy Markdown
Collaborator

Closed by the v0.51.4 release in PR #1707 (merged at 4daa238, deployed to production).

Live on production: https://github.com/nesquena/hermes-webui/releases/tag/v0.51.4

🚀

wwg135 pushed a commit to wwg135/hermes-webui that referenced this pull request May 5, 2026
…ilename (nesquena#1707)

Closes nesquena#1707 — single-click on a workspace tree filename did nothing.

nesquena#1698 was a regression where the filename's dblclick rename handler was
unreachable because the row's el.onclick (openFile) fired synchronously
on the first click. The fix in nesquena#1702 stopped click propagation on nameEl
— but that broke single-click activation entirely (nesquena#1707): clicking the
filename now did nothing, you had to click the icon or row whitespace
to open the file.

Restored fix preserves both intents via a 300ms debounced delegator:

  let _nameClickTimer = null;
  nameEl.onclick = (e) => {
    e.stopPropagation();
    if (_nameClickTimer) { clearTimeout(_nameClickTimer); _nameClickTimer = null; }
    _nameClickTimer = setTimeout(() => {
      _nameClickTimer = null;
      if (typeof el.onclick === 'function') el.onclick(e);
    }, 300);
  };
  nameEl.ondblclick = (e) => {
    e.stopPropagation();
    if (_nameClickTimer) { clearTimeout(_nameClickTimer); _nameClickTimer = null; }
    // ... existing rename body
  };

Single-click on nameEl schedules a setTimeout that calls el.onclick(e)
after the dblclick threshold passes (300ms — matches the OS dblclick
threshold on most platforms). Double-click cancels the pending timer
and triggers the existing rename input.

Cost: 300ms latency on file-open clicks. Acceptable trade for keeping
rename reachable on single-click.

Also updated tests/test_workspace_tree_rename.py to accept both the
pre-nesquena#1707 (pure stopPropagation) and post-nesquena#1707 (debounced delegator)
shapes — the original assertion was too narrow and would have rejected
the correct fix.

9 new regression tests in tests/test_1707_workspace_filename_click.py:
  - 6 source-level static-analysis checks on the patched handler shape
  - 3 behavioral tests via Node VM (synthesize click → 300ms delay,
    click → dblclick within tick → assert rename mounts + openFile
    is not called).

7 of 9 tests fail on master pre-fix (verified); all 9 pass after.
githb-ac pushed a commit to githb-ac-org/hermes-webui that referenced this pull request May 5, 2026
…quena#1710)

The file-tree row tooltip says 'Double-click to rename' on every entry,
but folders don't actually rename on double-click — they navigate via
loadDir(). The tooltip is therefore misleading on directory rows.

Reported by @Deor in the WebUI Discord testers thread (May 5 2026):
'Ah that works yeah. May want to change the popup text as it also says
double click at the moment.'

Fix: gate the tooltip on item.type !== 'dir' so it only attaches to file
rows, where double-click does what the hint advertises. Folder rename
still reachable via the right-click context menu (unchanged).

Companion to nesquena#1698/nesquena#1702/nesquena#1707 — completes the rename-affordance triage:
- nesquena#1698 fixed: dblclick rename was unreachable on files (preview hijacked)
- nesquena#1707 fixed: single-click on filename did nothing (over-aggressive guard)
- nesquena#1710 (this PR): tooltip claimed dblclick-rename on folders too

Closes nesquena#1710

Tests: 4 source-level regression tests in tests/test_1710_folder_tooltip.py
guard the gate, the unchanged dir-dblclick navigate behaviour, the i18n key,
and that files still receive the tooltip. All 13 file-tree handler tests
(4 new + 9 from nesquena#1707) pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(workspace): can't rename files from tree — first click of dblclick opens preview, dblclick handler unreachable

2 participants