Skip to content

fix(browser): preserve replaced rows and rename navigation - #1890

Merged
l0gicgate merged 6 commits into
mainfrom
fix/1858-replace-without-trash-monitor
Oct 25, 2026
Merged

l0gicgate merged 6 commits into
mainfrom
fix/1858-replace-without-trash-monitor

Conversation

@JoeJoeflyn

@JoeJoeflyn JoeJoeflyn commented Oct 25, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Keep files visible after Replace on a filesystem without Trash by reconciling same-path arrival/departure events through the existing entry lookup.

Also fix the requested rename/navigation edge case: seed GTK's cursor while a row rebinds and ignore deferred focus requests superseded by newer input. Reuse borrowed entries for the reveal lookup instead of cloning each entry. Extend the existing regressions and make playback/frame-readiness checks tolerate completed work between observations.

Visual evidence

Before:

rename-before.mp4
replace-before.mp4

After:

rename-after.mp4
replace-after.mp4

How to test

  1. Copy a file over an existing same-named file in a writable folder without Trash (for example, a temporary folder under /dev/shm; confirm gio info -a access::can-trash reports FALSE). Choose Replace without refreshing.
  2. In List view with enough files to scroll, go to the bottom, create a new file, rename it so it sorts near the top, and press Down twice.

Expected result: The replacement contents are correct and its row stays visible without F5. After renaming, each Down advances selection and focus to the next file; a delayed callback does not move focus back.

Related issue

Closes #1858

Preserve an upsert followed by a same-path departure so the existing metadata lookup resolves the final state. An exchange can report both events while the replacement remains on disk; genuine deletions still produce a removal.

Cover the real exchange monitor sequence and the no-Trash copy/Replace UI flow without adding operation-specific refresh logic.

Refs #1858
Seed GTK's native cursor through the existing collection focus helper while a renamed row is being rebound. Reject deferred cursor restores after a newer logical cursor or source position supersedes them, instead of moving focus back after the next arrow key.

Reuse borrowed column entries for rename reveal lookup rather than cloning every scanned entry on each frame. Extend the existing QA owner to verify continued navigation and stable focus.

Refs #1858
A loaded renderer can finish playback before QA observes its transient playing state. Accept either active playback or verified progress to the endpoint, and do not require one particular intermediate distance sample.

Resume near-end playback from 90% and wait for both plots to show that position, so a no-op command cannot satisfy the completion check. Keep the endpoint assertions without sleeps or longer timeouts.

Refs #1858
The native fixture can dispatch Tab before GTK has painted the new empty-directory page, so its native Tab traversal skips the focus surface. Wait on the frame clock's after-paint signal rather than adding a delay or a geometry assertion.

Refs #1858
@github-actions github-actions Bot added the fix label Oct 25, 2026
@JoeJoeflyn

Copy link
Copy Markdown
Collaborator Author

Implementation and validation handoff

The owner expanded #1858 to include the pre-existing rename/navigation failure, related concrete edge cases, reuse/no-duplication, performance, and before/after captures. All work stays on this branch/PR.

Architecture and implementation: the replacement fix stays in the shared monitor coalescer and reuses the existing asynchronous entry lookup; no per-operation reload or view-specific replacement implementation was added. The rename repair reuses collection scrolling and listing focus-ownership checks. The existing deferred-focus helper now rejects a request if its captured depth/source/location is no longer the current cursor. The reveal lookup uses the existing borrowed-column accessor rather than cloning every scanned entry.

Regression quality: the real monitor test exchanges a file through a hidden directory and covers a subsequent genuine deletion. The new no-Trash QA case asserts both disk contents/source preservation and row visibility. The existing committed-rename scenario now also verifies stable focus after the first arrow and continued movement on the second. Existing playback checks verify progress/endpoint completion rather than requiring a transient frame to be observed. The native empty-pane fixture waits for its first after-paint signal, not a sleep or geometry assertion.

Final scoped Rust validation: each command below ran a nonzero selection on private Xvfb/private D-Bus via scripts/test-headless.py; 25 tests passed in total:

./scripts/test-headless.py ui::browser_modes::tests::                                      # 6 passed
./scripts/test-headless.py ui::browser::collection::tests::                                # 1 passed
./scripts/test-headless.py ui::window::tests::keyboard_dispatch::pane_focus::               # 7 passed
./scripts/test-headless.py ui::window::tests::keyboard_dispatch::reload_cursor::            # 5 passed
./scripts/test-headless.py ui::chooser::tests::keyboard::footer_create_and_rename_keep_the_request_open # 1 passed
./scripts/test-headless.py ui::preview::tests::route::                                      # 4 passed
./scripts/test-headless.py exchanged_files_stay_listed_unless_they_are_deleted             # 1 passed

The isolated empty_directory_focus_is_a_named_mapped_surface_and_tabs_out rerun also passed five consecutive times after fixing fixture readiness. Earlier failures are preserved in local logs, not reported as passing.

Final pinned rootless-Podman QA selection:

./scripts/qa.sh committed-rename-stays-visible replace-without-trash-keeps-row route-preview-shows-offline-track-and-elevation refresh-reconciles-external-changes control-click-sets-shift-anchor rename-and-undo-restores rename-commits-on-enter window-accelerators-leave-rename empty-directory-focus-and-tab-order

Result: 22 passed, 0 failed, covering Columns/List/Icons input, live changes/reloads, rename/undo, editor focus, empty-pane tab order, and playback. The three core scenarios also passed three consecutive scoped runs before the final caller selection. The replacement and stale-focus assertions were observed failing before their respective fixes.

Pre-push checks: ./scripts/quality.sh fmt, ./scripts/quality.sh clippy, and git diff --check passed on final code.

Preserved earlier full runs / intentional scope: the full pinned ./scripts/quality.sh test run before the follow-up focus changes passed 3,550 application tests (11 pre-existing ignored tests) and 27 runner tests. The initial full ./scripts/qa.sh run was 590 passed / 2 failed, exposing the rename and playback checks subsequently investigated and fixed. Those initial full results are not a claim of a full final-code run. Per the scoped-after-failures policy, affected callers/regressions were rerun instead of repeating unrelated full suites. Required CI remains the authoritative complete gate. No GUI check used the user's desktop or inherited session bus.

Performance evidence: in the pinned unoptimized QA build, a 12,000-file rename probe measured missing-target reveal lookups at 8,161–8,175 µs with per-entry clones versus 2,448–4,883 µs with the borrowed-entry lookup. This is a localized sample, not an overall application or release benchmark. The temporary large fixture and instrumentation were removed.

Visual-capture override: the owner's explicit request to take before/after images overrides the normal no-PR-capture default for this task. Four screenshots were captured/reviewed locally under target/issue-1858-before-after/, never committed or uploaded. Replace-before was captured with only the coalescer rule temporarily reverted; it was restored and both UI regressions passed again. Rename-before is the preserved original failure capture. The PR Visual evidence section does not claim attachments exist.

Optional QA-quality grading: self-review retained the existing rename scenario rating 3/4/4/3 = 45. An independent Haiku CLI grading attempt timed out during tool startup; no independent grading is claimed as passed.

@JoeJoeflyn
JoeJoeflyn marked this pull request as ready for review October 25, 2026 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(operations): Replace in a folder without Trash hides the row until F5

2 participants