Fix: sending several selected headings drops the last heading's cards - #51
Merged
Merged
Conversation
Selecting across several headings and sending (` / Alt-` / Starred / Dropzone) rounded the end to a top-level node boundary. Headings are flat siblings of their cards, so the final heading either arrived bare (its cards left behind) or, if the drag ended in its first half, was dropped entirely. A bare cursor on a heading already sends its whole section; the selection path now matches: - any heading text selected at the end includes that heading (a caret parked at its very start, as after shift-down, still excludes it); - a heading ending the range extends to its section end; - the collapsed fallback expands a heading to its section too. Claude-Session: https://claude.ai/code/session_01GX8wvCNHHvWsEyKwjqHPMo
ant981228
added a commit
that referenced
this pull request
Sep 19, 2026
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015vDCxeP1FvdfeEWXSKqzao
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.
Problem
Reported against 1.01 and still present on main: select across several headings and press
`(Send to Speech) and the last heading doesn't come through properly. WithH1, card1, H2, card2, H3, card3selected from H1's text to H3's text:H1, card1, H2, card2, H3— H3 arrives bare, card3 left behindH1, card1, H2, card2— H3 missing entirelyRoot cause:
normalizeSelectionForSendrounds the selection end to the nearest top-level node boundary. Headings are flat siblings of their cards, not containers, so rounding to a heading's boundary never picks up its section. The bare-cursor path (enclosingStructureRange) already expands a heading to its section viasectionEndFromHeading; the selection path didn't.Fix
In
src/editor/send-normalize.ts:The shared normalizer is used by
takeSendSlice, so Send to Speech (at cursor / at end), Send to Starred / Recipient, and Send to Dropzone all get the fix. The widened range is also reflected back as the visible selection before sending.Test plan
send-normalizecases: late end and early end in the last heading, stopping at the start of the next heading, the section stopping at a shallower heading, and a selection inside one heading's text`→ all three sections land in the speech docNo changelog entry since there's no unreleased section yet; happy to add one wherever you'd like it.
https://claude.ai/code/session_01GX8wvCNHHvWsEyKwjqHPMo