fix(web): exact iOS caret, review fixes and round-eight items (#830)

Toolbar Enter spends one-shot Ctrl; Backspace finds the last grapheme with Segments.containing(); accessory Shift+Tab keeps the draft like a typed one.
Pass the captured session to Compose uploads, voice compose and held CJK drafts; clear Ctrl on deletion-only native edits; path picker clears predictions.
Clear xterm dead-key state on native commits; restore a borrowed clipboard field before classifying a key; overlay removeChar spans the pending/flushed boundary.
Place the trackpad caret from the overlay layout (getInputAnchor, committedText) or validated xterm cells, hiding when unproven; no end-minus-width arithmetic.
Grapheme-aware replay Backspace; docs, README rows, changeset and comment updates.
This commit is contained in:
Hadrien Kerlero committed 2026-11-21 21:16:13 +01:00
1 parent 414dd51eb2
commit cda5d96451
26 files changed
+1072 -170

No files matched your search

+20 -4
View File
@@ -1543,7 +1543,7 @@ describe('TerminalTile iOS native input ownership', () => {
return { owner, create, attachCaretMarker, dispose, send: (ops: string[]) => options.sendTransaction(ops) };
};
it('creates an owner and xterm-cursor marker, but no 229 recovery, on iOS', async () => {
it('creates an owner and parsed-buffer marker without an anchor, but no 229 recovery, on iOS', async () => {
const native = install();
const { tile, term } = await connectTile(makeApp());
expect(native.create).toHaveBeenCalledOnce();
@@ -1676,14 +1676,30 @@ describe('TerminalTile iOS native input ownership', () => {
expect(native.owner.reset).toHaveBeenCalledExactlyOnceWith('ctrl');
});
it('does not consume Ctrl for a deletion-only transaction', async () => {
it('spends Ctrl on a deletion-only transaction without resetting the owner', async () => {
const native = install();
const app = makeApp();
app._enqueueInput = vi.fn();
const consumeCtrl = vi.fn();
context.KeyboardAccessoryBar = { isCtrlArmed: () => true, consumeCtrl };
let armed = true;
const consumeCtrl = vi.fn(() => {
armed = false;
return '\x03';
});
context.KeyboardAccessoryBar = {
isCtrlArmed: () => armed,
consumeCtrl,
clearCtrl: () => {
armed = false;
},
};
await connectTile(app);
native.send(['\x7f']);
expect(armed).toBe(false);
native.send(['c']);
expect(app._enqueueInput.mock.calls).toEqual([
['s-tile', [{ write: '\x7f' }]],
['s-tile', [{ write: 'c' }]],
]);
expect(consumeCtrl).not.toHaveBeenCalled();
expect(native.owner.reset).not.toHaveBeenCalled();
});