fix(tui): selection fidelity for two-pane reader (#185 PR5/5)#192
Merged
fix(tui): selection fidelity for two-pane reader (#185 PR5/5)#192
Conversation
…185 PR5) Closes the last P1 of #185. Pre-fix, an agent calling `get_current_selection` while the human was browsing highlights in the two-pane reader saw `annotation_id: None` — the human *was* sitting on something, the agent just couldn't tell. Only the single-pane annotation-focus path was wired. `current_tui_state` now resolves annotation_id from either source: - Two-pane reader (`reader=true`): index `highlight_focus` over the ROOTS-only list (paper-level notes + replies excluded; they don't carry their own anchor and aren't highlight targets). - Single-pane annotation focus (`reader=false`): index `annotation_focus` over the FULL list (mixed roots + replies), matching the existing semantics — kept identical so the e/d/r-by-row keymap doesn't drift. 4 new tests: reader-mode highlight surfaces correct id, no-focus surfaces None, paper-notes + replies don't shift the highlight mapping, annotation-focus mode unchanged. [tape-exempt: TUI-internal selection plumbing; no visible UI change. The fix is observable only via the MCP get_current_selection tool, already covered by tools-side tests in scitadel-mcp.] Refs #185.
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.
Summary
Closes #185. Last P1 item. Pre-fix, an agent calling `get_current_selection` while the human was browsing highlights in the two-pane reader saw `annotation_id: None` — the human was on something, the agent just couldn't tell.
`current_tui_state` now resolves `annotation_id` from either source:
Test plan
Out of scope
[tape-exempt: TUI-internal selection plumbing; no visible UI change. The fix is observable only via the MCP get_current_selection tool.]
Refs #185 — completes the agent↔human comment loop.