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

+18
View File
@@ -48,6 +48,8 @@ function loadKeyboardModule() {
_focusedPane: () => ({ sessionId: 'session-1', isPrimary: true }),
_paneForSession: (sessionId: string) => ({ sessionId, isPrimary: true }),
_localEchoEnabled: false,
_localEchoPolicy: 'off',
_predictiveEcho: { clearPredictions: vi.fn() },
_localEchoOverlay: { appendText: vi.fn() },
_prepareExternalInput: vi.fn(),
};
@@ -186,6 +188,22 @@ describe('mobile filesystem picker actions', () => {
expect(app._sendInputAsync).toHaveBeenCalledWith('session-1', '/mnt/d/AI/project/file.ts', { useMux: true });
});
it.each([false, true])('clears primary predictions before inserting a path (buffered=%s)', (buffered) => {
const { app, bar, picker } = loadKeyboardModule();
app._localEchoPolicy = 'predict';
app._localEchoEnabled = buffered;
picker.open = vi.fn();
bar.handleAction('pick-path');
picker.open.mock.calls[0][0].onSelect('/project/file.ts');
expect(app._predictiveEcho.clearPredictions).toHaveBeenCalledOnce();
const insert = buffered ? app._localEchoOverlay.appendText : app._sendInputAsync;
expect(app._predictiveEcho.clearPredictions.mock.invocationCallOrder[0]).toBeLessThan(
insert.mock.invocationCallOrder[0]
);
});
it.each([false, true])(
'appends a picked path to the destination primary overlay without flushing (focus moved=%s)',
(moved) => {