mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-02 13:39:41 +02:00
fix: local echo overlay — 5 bugs fixed, 39-test suite, wrapping text survives tab switch
Root cause bugs fixed in local echo overlay: 1. Stored flushed text as string (_flushedText, _flushedTexts Map) to avoid reading stale terminal buffer 2. Overlay stays visible when pendingText empties but flushed > 0 3. Backspace into flushed text has immediate visual feedback 4. _flushedTexts.delete() added alongside _flushedOffsets.delete() in Enter/Ctrl+C/cleanup 5. OSC terminal responses (xterm color queries) no longer clear flushed text state — was triggered by _handleColorEvent → triggerDataEvent during buffer load after tab switch Added comprehensive test suite (test/local-echo-user-test.mjs): 39 tests across 9 groups including line wrapping, tab switch round-trips, backspace into flushed text, and more. All 6 test suites pass (133 total assertions). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -457,10 +457,15 @@ async function main() {
|
||||
console.log(` Overlay visible: ${state?.overlayVisible}`);
|
||||
console.log(` Overlay text: "${state?.overlayText}"`);
|
||||
|
||||
if (!state?.overlayVisible && !state?.overlayText) {
|
||||
// After deleting all typed (pending) text, overlay stays visible because
|
||||
// flushed text still exists (3 extra backspaces only reduced flushed from 15→12).
|
||||
// The overlay correctly shows flushed text so the user can keep backspacing.
|
||||
if (state?.flushedOffset > 0 && state?.overlayVisible && !state?.overlayText) {
|
||||
pass('Overlay visible with flushed text after deleting pending');
|
||||
} else if (!state?.overlayVisible && !state?.overlayText && state?.flushedOffset === 0) {
|
||||
pass('Overlay hidden after deleting all chars');
|
||||
} else {
|
||||
fail('Overlay still visible after full delete', `visible=${state?.overlayVisible}, text="${state?.overlayText}"`);
|
||||
fail('Unexpected state after full delete', `visible=${state?.overlayVisible}, text="${state?.overlayText}", flushed=${state?.flushedOffset}`);
|
||||
}
|
||||
|
||||
// Verify backspace-into-flushed-text: the 3 extra backspaces should have
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user