Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

address review (codex): guard IME composition commit keys

[._.]/ Adam Eivy1322706a3e99
diff --git a/client/src/components/cos/tabs/MindTab.jsx b/client/src/components/cos/tabs/MindTab.jsx
index 6fb54401b9..dc0dce8836 100644
--- a/client/src/components/cos/tabs/MindTab.jsx
+++ b/client/src/components/cos/tabs/MindTab.jsx
@@ -316,7 +316,7 @@ export default function MindTab() {
};
const handleMessageKeyDown = (event) => {
- if (event.key !== 'Enter' || event.altKey || event.nativeEvent.isComposing) return;
+ if (event.key !== 'Enter' || event.altKey || event.nativeEvent.isComposing || event.keyCode === 229) return;
void submitMessage(event);
};
diff --git a/client/src/components/cos/tabs/MindTab.test.jsx b/client/src/components/cos/tabs/MindTab.test.jsx
index bf3ea5f9a4..c58b10238c 100644
--- a/client/src/components/cos/tabs/MindTab.test.jsx
+++ b/client/src/components/cos/tabs/MindTab.test.jsx
@@ -282,6 +282,19 @@ describe('MindTab', () => {
));
});
+ it('does not submit an IME composition commit key', async () => {
+ const user = userEvent.setup();
+ renderTab();
+ await screen.findByText('Review the next bounded slice.');
+ const message = screen.getByLabelText('Message');
+
+ await user.type(message, 'Composing text');
+ fireEvent(message, createEvent.keyDown(message, { key: 'Enter', keyCode: 229 }));
+
+ expect(api.sendPersistentMindMessage).not.toHaveBeenCalled();
+ expect(message).toHaveValue('Composing text');
+ });
+
it('mints a new id when failed text is edited into a different submission', async () => {
const user = userEvent.setup();
api.sendPersistentMindMessage.mockRejectedValueOnce(new Error('Connection lost'));