refactor: move selection surgery into rich-text-dom.ts (RD-21)
deleteAdjacentChip and insert did getSelection()/Range work inside the component, which pushed it over the max-lines budget under a disable comment. rich-text-dom.ts already owns the DOM boundary, so the surgery moves there as two new exports, chipAtCaret and insertChipAtCaret, and the component keeps only its event-handling and output concerns. adjacentChip stays exported with its own spec case. The component disable comment is gone, since the file is now under the line budget. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -20,7 +20,7 @@ tested where._
|
||||
|
||||
Every bullet below is a real test name from the suite — an `it()` title (frontend) or a test
|
||||
method name (backend), read as a sentence. Nothing here is hand-written prose: this page
|
||||
**is** the suite, reshaped for a business reader. 538 frontend behaviours across
|
||||
**is** the suite, reshaped for a business reader. 543 frontend behaviours across
|
||||
9 contexts; 261 backend behaviours across 42 test
|
||||
classes.
|
||||
|
||||
@@ -758,6 +758,14 @@ classes.
|
||||
- redirects an anonymous user to /login without waiting for caps
|
||||
- reads authentication through the port, not an app-local store
|
||||
|
||||
#### chipAtCaret / insertChipAtCaret (selection surgery)
|
||||
|
||||
- chipAtCaret returns the chip before a Backspace caret
|
||||
- chipAtCaret returns null for a non-collapsed selection
|
||||
- chipAtCaret returns null for a caret outside root
|
||||
- insertChipAtCaret splices at the caret and leaves the caret after the chip
|
||||
- insertChipAtCaret appends when there is no selection inside root
|
||||
|
||||
#### createDebouncedSave
|
||||
|
||||
- flushes after the delay when canSave is true
|
||||
|
||||
Reference in New Issue
Block a user