Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions apps/desktop/stories/app-shell.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2423,12 +2423,19 @@ async function verifySubmittedPrompt(canvasElement: HTMLElement, lines = 1): Pro
await painted(40);
const input = canvasElement.querySelector<HTMLElement>('.maka-composer-editor [contenteditable="true"]');
if (!input) throw new Error('The composer input is missing');
await userEvent.type(input, '请简短说明当前提交过程发生了什么。', { delay: null });
for (let line = 1; line < lines; line += 1) {
await userEvent.keyboard('{Shift>}{Enter}{/Shift}', { delay: null });
await userEvent.type(input, '这是多行提示词,提交后输入框收起仍应平稳跟随新回答。', { delay: null });
// Prepare the draft with native text insertion so a tall prompt does not
// spend the render budget dispatching thousands of synthetic keystrokes.
// Keep line breaks and submission on the real composer's keyboard path.
const promptLines = Array.from({ length: lines }, (_, index) => index === 0
? '请简短说明当前提交过程发生了什么。'
: '这是多行提示词,提交后输入框收起仍应平稳跟随新回答。');
await userEvent.click(input);
for (const [index, line] of promptLines.entries()) {
if (index > 0) await userEvent.keyboard('{Shift>}{Enter}{/Shift}', { delay: null });
document.execCommand('insertText', false, line);
}
await painted(40);
await expect(input.innerText).toBe(promptLines.join('\n'));
// Observe admission itself: the correct final bottom can hide a reverse
// jump when an offscreen block first uses an estimate, then its real size.
const tops: number[] = [];
Expand All @@ -2447,21 +2454,25 @@ async function verifySubmittedPrompt(canvasElement: HTMLElement, lines = 1): Pro
await expect(tailMetrics().distance).toBeLessThanOrEqual(4);
}

// Real path: submit a prompt in an existing conversation and follow its new turn.
export const SubmittedPromptDoesNotReverse: Story = {
render: () => <StreamingTailHarness />,
play: async ({ canvasElement }) => verifySubmittedPrompt(canvasElement),
};

// Real path: compose a multiline prompt with Shift+Enter, then submit it.
export const MultilineSubmittedPromptDoesNotReverse: Story = {
render: () => <StreamingTailHarness />,
play: async ({ canvasElement }) => verifySubmittedPrompt(canvasElement, 8),
};

// Real path: submit an overflowing draft and follow its turn as the composer shrinks.
export const TallSubmittedPromptDoesNotReverse: Story = {
render: () => <StreamingTailHarness />,
play: async ({ canvasElement }) => verifySubmittedPrompt(canvasElement, 80),
};

// Real path: submit a prompt and keep following its turn when the reply settles.
export const SubmittedPromptSettlesWithoutReversing: Story = {
render: () => <StreamingTailHarness pendingUser />,
play: async ({ canvasElement }) => {
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
19 changes: 19 additions & 0 deletions scripts/plugins/codex-app-server-executor/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
Comment thread
liuxiaocs7 marked this conversation as resolved.
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->

# Maka Executor for Codex (experimental)

This Maka Host plugin registers `codex.app-server` against the `ctx.executors` API introduced on
Expand Down
17 changes: 17 additions & 0 deletions scripts/plugins/codex-app-server-executor/maka.composition.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

- type: insert
rootId: profile
entry:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env node

/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand Down