Skip to content

Carry search hits through the plugin contract - #105

Open
sidkmenon wants to merge 5 commits into
drop-structural-changesfrom
search/plugin-contract
Open

sidkmenon wants to merge 5 commits into
drop-structural-changesfrom
search/plugin-contract

Conversation

@sidkmenon

Copy link
Copy Markdown
Contributor

Stacked on #104.

  • Leaves carry search_highlights; unchanged files reach plugins as two identical sides.
  • Fold states holding a hit stay open; removed-runs and summarize leave hits to the reader.
  • Context treats a hit as a more specific change: it keeps the hit with its headers and collapses the file's other changes.
  • Each leaf gets pair, its partner's id, set during numbering and cut.

AI assistance: developed with Claude Code.

https://claude.ai/code/session_01Jcs63VAkAWzCT54XzdvDyb

A leaf gains search_highlights, the spans a search hit covers, and a
file can have the status unchanged. has-search-highlights tells a
plugin whether a region's fold state holds a hit. Bundled components
are rebuilt for the new WIT.

AI assistance: developed with OpenAI Codex and Claude Code.

Agent-Session: 01a10126-800c-7922-a418-bb477c280cbd
Agent-Session: dca03de1-4350-4b24-b376-cb54c86fcc2d
Agent-Session: 9a22412a-b2b1-4e3a-a35d-e310f6846f29
Agent-Session: 82924cb5-dcfa-42e4-abb0-ef40393249f8
Agent-Session: 01a103af-15d8-79c3-9da1-1dce5fa8bdc7
Agent-Session: 01a1061e-c424-7fa2-8db0-b8e0c93f5d16
Agent-Session: b7f96806-2bcb-4ee8-aca4-c5bedad0939a
Agent-Session: 01a10ad4-5daa-74b2-9479-9dca5e8b2572
Agent-Session: 01a10dbe-5dcc-74a3-a06b-f810c6d3af7e
Agent-Session: 01a10e7a-1dfa-7bd1-a6f4-8449c22813e2
Agent-Session: 5700e9f2-ed1a-41d0-825c-bda83f9e8aa0
Agent-Session: 01a10f90-e4ce-70f2-84d1-26d64820eed3
Agent-Session: 01a11898-f278-7b30-b366-ea64bfc7ff5e
Agent-Session: 01a118dd-0ded-7b60-a820-60e4f5797db5
set-collapsed and link never collapse a fold state with a highlighted
member, so no plugin can hide a hit.

AI assistance: developed with OpenAI Codex and Claude Code.

Agent-Session: 01a10126-800c-7922-a418-bb477c280cbd
Agent-Session: dca03de1-4350-4b24-b376-cb54c86fcc2d
Agent-Session: 9a22412a-b2b1-4e3a-a35d-e310f6846f29
Agent-Session: 82924cb5-dcfa-42e4-abb0-ef40393249f8
Agent-Session: 01a103af-15d8-79c3-9da1-1dce5fa8bdc7
Agent-Session: 01a1061e-c424-7fa2-8db0-b8e0c93f5d16
Agent-Session: b7f96806-2bcb-4ee8-aca4-c5bedad0939a
Agent-Session: 01a10ad4-5daa-74b2-9479-9dca5e8b2572
Agent-Session: 01a10dbe-5dcc-74a3-a06b-f810c6d3af7e
Agent-Session: 01a10e7a-1dfa-7bd1-a6f4-8449c22813e2
Agent-Session: 5700e9f2-ed1a-41d0-825c-bda83f9e8aa0
Agent-Session: 01a10f90-e4ce-70f2-84d1-26d64820eed3
Agent-Session: 01a11898-f278-7b30-b366-ea64bfc7ff5e
Agent-Session: 01a118dd-0ded-7b60-a820-60e4f5797db5
removed-runs and summarize skip a region that holds a hit.

AI assistance: developed with OpenAI Codex and Claude Code.

Claude-Session: https://claude.ai/code/session_01Jcs63VAkAWzCT54XzdvDyb
Agent-Session: 01a1061e-c424-7fa2-8db0-b8e0c93f5d16
Agent-Session: b7f96806-2bcb-4ee8-aca4-c5bedad0939a
Agent-Session: 82924cb5-dcfa-42e4-abb0-ef40393249f8
Agent-Session: 01a10ad4-5daa-74b2-9479-9dca5e8b2572
Agent-Session: 01a10dbe-5dcc-74a3-a06b-f810c6d3af7e
Agent-Session: 01a10e7a-1dfa-7bd1-a6f4-8449c22813e2
Agent-Session: 5700e9f2-ed1a-41d0-825c-bda83f9e8aa0
Agent-Session: 01a10f90-e4ce-70f2-84d1-26d64820eed3
Agent-Session: 01a11898-f278-7b30-b366-ea64bfc7ff5e
Agent-Session: 01a118dd-0ded-7b60-a820-60e4f5797db5
In a file with search hits, `changed` reports hits instead of changes,
so every context rule follows the hits: lines near a hit stay open, a
scope holding a hit keeps its header and closer, and folds without a
hit fold like unchanged code. A leaf keeps only the lines near its
hits, not all of itself.

Unpaired lines in the same hunk as a hit stay open on the other side,
so a hit shows what it replaced. A row shorter than two lines still
folds when it hides a change.

AI assistance: developed with Claude Code.

Claude-Session: https://claude.ai/code/session_01Jcs63VAkAWzCT54XzdvDyb
Agent-Session: b7f96806-2bcb-4ee8-aca4-c5bedad0939a
Agent-Session: 82924cb5-dcfa-42e4-abb0-ef40393249f8
Agent-Session: 01a10ad4-5daa-74b2-9479-9dca5e8b2572
Agent-Session: 01a10dbe-5dcc-74a3-a06b-f810c6d3af7e
Agent-Session: 01a10e7a-1dfa-7bd1-a6f4-8449c22813e2
Agent-Session: 5700e9f2-ed1a-41d0-825c-bda83f9e8aa0
Agent-Session: 01a10f90-e4ce-70f2-84d1-26d64820eed3
Agent-Session: 01a11898-f278-7b30-b366-ea64bfc7ff5e
Agent-Session: 01a118dd-0ded-7b60-a820-60e4f5797db5
A leaf's new `pair` field names the leaf on the other side with the
same `alignment_id`, and is absent for an added or deleted leaf. Clients
can read a leaf's partner, or see that it has none, without searching
the other side. Ids and pairs are set together: projection gives the
second leaf of a pair its partner as it numbers it, and the first once
the other side is built; a cut names each new tail's partner as it makes
them. The plugin contract is unchanged.

diffr-ts and the TUI's wire schema accept the field.

AI assistance: developed with Claude Code.

Claude-Session: https://claude.ai/code/session_01Jcs63VAkAWzCT54XzdvDyb
Agent-Session: 82924cb5-dcfa-42e4-abb0-ef40393249f8
Agent-Session: 01a10dbe-5dcc-74a3-a06b-f810c6d3af7e
Agent-Session: 01a10e7a-1dfa-7bd1-a6f4-8449c22813e2
Agent-Session: 5700e9f2-ed1a-41d0-825c-bda83f9e8aa0
Agent-Session: 01a10f90-e4ce-70f2-84d1-26d64820eed3
Agent-Session: 01a11898-f278-7b30-b366-ea64bfc7ff5e
Agent-Session: 01a118dd-0ded-7b60-a820-60e4f5797db5
@sidkmenon sidkmenon mentioned this pull request Oct 8, 2026
@sidkmenon
sidkmenon added this pull request to stack #107 October 8, 2026 08:00

This branch has not been deployed

No deployments
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.

1 participant