Repository navigation
test(switch): guard the on_update preview poke at the producer site - #3251
Merged
Merged
Conversation
Add a fast unit test asserting `on_update` injects `Event::RunPreview` for the selected row when its live CI status lands (and stays silent for a row the cursor isn't on), so the `pr`/`comments` auto-refresh wiring can't be dropped without a red test — verified to fail when the poke is removed. Also share one `render_tx` between the orchestrator's notifier and the handler in `make_handler`, matching `handle_picker`, so the test can observe the poke on the same channel skim's loop uses. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
# Conflicts: # src/commands/picker/progressive_handler.rs
worktrunk-bot
approved these changes
Jun 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A fast, producer-site regression guard for the picker preview auto-refresh wiring that landed in #3247 — test-only, no production change.
Why
#3247 closed two preview auto-refresh loops with different protection:
PreviewOrchestrator::fill— which callsnotify_filled. A producer physically cannot fill the cache without notifying, so that path is self-guarding.on_updatemirrors a row'spr_status/local_content, then pokesnotify_row_changed) wires the poke as a separate call at the tail of the mirror block, with no compile-time tie to the writes it surfaces. Only the slow end-to-end PTY test (test_switch_picker_pr_tab_auto_resolves_from_fetching) guarded it.That asymmetry is exactly how the CI-status loop got left keystroke-driven in the first pass of #3247. This adds a fast guard at the producer site so a future edit that drops the poke turns red immediately rather than stranding the
pr/commentstab on "Fetching PR status…".Change
on_update_pokes_run_preview_for_the_selected_rowassertson_updateinjectsEvent::RunPreviewfor the selected row when its live CI status lands, and stays silent for a row the cursor isn't on (the no-thrash half). Verified to fail (the positive assertion panics) when the poke is removed.make_handlernow shares onerender_txbetween the orchestrator's notifier and the handler — matchinghandle_picker— so the test observes the poke on the same channel skim's loop uses. This also closes a test-fidelity gap where the harness diverged from production by building two separate senders.🤖 Generated with Claude Code