fix(web): address #839 review for the iOS keyboard fix (#830)

Keep the unsent draft out of slash-command keys; settle the iOS owner without flushing local echo.
Restore the overlay last-prompt fallback and the #520 Shift/Ctrl+Enter gate guard.
Pin the xterm privates the iOS owner needs; retarget browser/mobile harnesses to the session FIFO edge.
Document the session FIFO invariants and link #830 for the device sequences.
This commit is contained in:
Hadrien Kerlero committed 2026-11-20 20:13:31 +01:00
1 parent c4b382b727
commit db5ab5a701
11 files changed
+128 -53

No files matched your search

+15 -9
View File
@@ -620,7 +620,7 @@ describe('native main transactions and boundaries', () => {
}
);
it.each(['upload', 'voice', 'Esc', 'command', 'paste'])(
it.each(['upload', 'voice', 'Esc', 'paste'])(
'%s preserves the typed prefix before direct writes with echo on or off',
async (producer) => {
for (const echo of [true, false]) {
@@ -668,14 +668,6 @@ describe('native main transactions and boundaries', () => {
['old', 'hel'],
['old', '\x1b'],
]);
} else if (producer === 'command') {
vm.runInContext("KeyboardAccessoryBar.sendCommand('/help')", context);
expect(wire).toEqual([
['old', 'hel'],
['old', '/help'],
]);
vi.advanceTimersByTime(120);
expect(wire.at(-1)).toEqual(['old', '\r']);
} else {
vm.runInContext("KeyboardAccessoryBar._sendBracketedPaste('old', 'world', 'Paste')", context);
expect(wire).toEqual([
@@ -688,6 +680,20 @@ describe('native main transactions and boundaries', () => {
}
);
it('sends a slash command without submitting the unsent local-echo draft', () => {
for (const echo of [true, false]) {
const { app, wire, context } = harness();
loadProducerModules(app, context);
app._localEchoEnabled = echo;
app._handleTerminalData('hel', 'old');
vm.runInContext("KeyboardAccessoryBar.sendCommand('/help')", context);
vi.advanceTimersByTime(120);
// Echo on: `hel` stays in the overlay. Echo off: it was already typed into the PTY.
expect(wire).toEqual([...(echo ? [] : [['old', 'hel']]), ['old', '/help'], ['old', '\r']]);
expect(app._localEchoOverlay.pendingText).toBe(echo ? 'hel' : '');
}
});
it('keeps the typed prefix in the overlay when a toolbar attachment appends', async () => {
const { app, wire, context } = harness();
loadProducerModules(app, context);