fix(panel): land a revealed thread only where it is placed and seen
Merged
DA
11d ago+183+183+012345678901234567890123456789-36-36-01234567890123456789
This fixes two problems Devin raised on #3884 (review-thread deep links). #3884 entered the merge queue and merged before I could push these to it, so they come as a follow-up.
- Place a revealed thread from its file's entry as drawn (thread).
- Before:
useListLandingworked out the thread's place as soon as the ask came in. If a filter hid the file, it had no entry yet, so it guessed fromfileNoticeand could not tell that a changed image is drawn as its picture. - Now: the place, the chip shown, the scroll target and the lit lines all come from the entry once the list holds it, exactly as
entryOfplaces the thread. A pictured image's threads land above it, with the list scrolled to the file header.
- Before:
- Wait for the panel to be visible before landing (thread).
- Before: the landing checked only that the card was connected and not inside a
[hidden]view. A panel still arriving isvisibility: hidden, which refuses focus, and the landing then ended without it. - Now:
landablealso requires computed visibility, both by default and in Files changed's in-the-box check, the same thingfocusSeek's staged check waits for.
- Before: the landing checked only that the card was connected and not inside a
Tests:
- A thread on a changed SVG that a filter left out when the jump arrived: the filter is cleared, the list scrolls to the file header rather than line 2, and the thread stands above the picture. This fails on main.
- A landing on a
visibility: hiddenpanel waits, then rings and focuses the thread once the panel is visible. This fails without the fix.
Checks: panel tsc, the PR tab and Files changed suites, and oxlint pass. Desktop/panel only.
Made with Luke