Repository navigation
Fix: Bug: Arrow navigation jumps to top in preview mode - #173
over-fix-agent-dev[bot] wants to merge 1 commit into
Conversation
I added two checks to the click-outside condition of the global mousedown handler in ui/main_logic.js: `!e.target.closest(".item-preview-popup")` and `!e.target.closest(".item-link")`. Clicking inside the preview popup, or anywhere on a file or folder entry (including its child elements), no longer resets the selection. SelectedElement stays set, and ArrowDown/ArrowUp move on from the selected item instead of starting over at the first one. Item clicks still reset the rest of the selection in the normal way through the item's onclick → interactWithItem → selectItem. I didn't change anything else.
Found and fixed by the Over fix agent for task #1007.
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Bitte begründe deine Entscheidungen und warum die Änderungen so korrekt sind, wie du sie gemacht hast |
|
Warum die Änderung so aussieht Der globale Was vorher passiert ist
Was die Änderung abdeckt Z. 721–722 prüfen jetzt mit Wo ich unsicher bin bzw. wo du einen Punkt hast
|
|
Bitte teste das nochmal und melde dann nochmal zurück |
|
Working on this feedback now. |
|
I could not address this feedback, so it needs a person. The agent reported a fix but did not change any file. Summary: Review point, "Bitte teste das nochmal und melde dann nochmal zurück" (please test again and report back): I tested it again. No code change was needed and the branch is unchanged. How I tested: the repo has no JS test suite, and the full Tauri app can't run in the sandbox. So I wrote a throwaway jsdom harness outside the repo (not committed). It reads the actual click-outside condition straight from ui/main_logic.js (lines 715–752), so it tests the code as it is on this branch. It also builds the pre-fix condition by removing the two new Results:
Limitation: I could only simulate this in a DOM, not click through the real app. Ricky, a quick manual check in the built app would confirm it. Note: the single-pane goDown/goUp column-mode functions only handle SelectedItemPaneSide "left"/"right". I saw this while tracing but it's outside this bug, so I didn't touch it. |
Bug
Bug: Arrow navigation jumps to top in preview mode
Fix the preview mode arrow navigation bug based on previous findings in ui/main_logic.js
Cause
In ui/main_logic.js the global document mousedown handler (around lines 703–766) calls unSelectAllItems() for any click that isn't on a whitelisted element. That call sets SelectedElement to null. The whitelist had no entry for
.item-preview-popup. It also only checked e.target.classList for item parts, so clicks on some child elements inside an.item-linkentry also cleared the selection. When SelectedElement is null, the nav_down (and nav_up) keyboard handler (around line 1092) calls goUp(false, true). That selects item index 0, so the selection jumps to the top. It only happens after a click lands on one of these elements, which is why it happens "often but not always".Fix
I added two checks to the click-outside condition of the global mousedown handler in ui/main_logic.js:
!e.target.closest(".item-preview-popup")and!e.target.closest(".item-link"). Clicking inside the preview popup, or anywhere on a file or folder entry (including its child elements), no longer resets the selection. SelectedElement stays set, and ArrowDown/ArrowUp move on from the selected item instead of starting over at the first one. Item clicks still reset the rest of the selection in the normal way through the item's onclick → interactWithItem → selectItem. I didn't change anything else.Tests
node --check ui/main_logic.jspasses, so the syntax is valid. The project has no JS test suite or package.json for the frontend, so I added no test and haven't tested it in the running app.Changed files
ui/main_logic.js(+4 −0)Opened by the Over fix agent for task #1007. It was not merged: please review it like any other change.