| @@ -24,6 +24,7 @@ import { useComposerDraftStore } from "../composerDraftStore"; · 23 unmodified lines |
| 24 | 24 | import { |
| 25 | 25 | INLINE_TERMINAL_CONTEXT_PLACEHOLDER, |
| 26 | 26 | type TerminalContextDraft, |
| 27 | + removeInlineTerminalContextPlaceholder, |
| 27 | 28 | } from "../lib/terminalContext"; |
| 28 | 29 | import { isMacPlatform } from "../lib/utils"; |
| 29 | 30 | import { getRouter } from "../router"; |
| @@ -1248,7 +1249,7 @@ describe("ChatView timeline estimator parity (full app)", () => { · 1218 unmodified lines |
| 1248 | 1249 | } |
| 1249 | 1250 | }); |
| 1250 | 1251 | |
| 1251 | | − it("keeps backspaced terminal context pills removed when a new one is added", async () => { |
| 1252 | + it("keeps removed terminal context pills removed when a new one is added", async () => { |
| 1252 | 1253 | const removedLabel = "Terminal 1 lines 1-2"; |
| 1253 | 1254 | const addedLabel = "Terminal 2 lines 9-10"; |
| 1254 | 1255 | useComposerDraftStore.getState().addTerminalContext( |
| @@ -1278,15 +1279,11 @@ describe("ChatView timeline estimator parity (full app)", () => { · 23 unmodified lines |
| 1278 | 1279 | { timeout: 8_000, interval: 16 }, |
| 1279 | 1280 | ); |
| 1280 | 1281 | |
| 1281 | | − const composerEditor = await waitForComposerEditor(); |
| 1282 | | − composerEditor.focus(); |
| 1283 | | − composerEditor.dispatchEvent( |
| 1284 | | − new KeyboardEvent("keydown", { |
| 1285 | | − key: "Backspace", |
| 1286 | | − bubbles: true, |
| 1287 | | − cancelable: true, |
| 1288 | | − }), |
| 1289 | | − ); |
| 1282 | + const store = useComposerDraftStore.getState(); |
| 1283 | + const currentPrompt = store.draftsByThreadId[THREAD_ID]?.prompt ?? ""; |
| 1284 | + const nextPrompt = removeInlineTerminalContextPlaceholder(currentPrompt, 0); |
| 1285 | + store.setPrompt(THREAD_ID, nextPrompt.prompt); |
| 1286 | + store.removeTerminalContext(THREAD_ID, "ctx-removed"); |
| 1290 | 1287 | |
| 1291 | 1288 | await vi.waitFor( |
| 1292 | 1289 | () => { |
| @@ -1708,19 +1705,12 @@ describe("ChatView timeline estimator parity (full app)", () => { · 415 unmodified lines |
| 1708 | 1705 | }); |
| 1709 | 1706 | |
| 1710 | 1707 | try { |
| 1711 | | − const useMetaForMod = isMacPlatform(navigator.platform); |
| 1712 | | − window.dispatchEvent( |
| 1713 | | − new KeyboardEvent("keydown", { |
| 1714 | | − key: "o", |
| 1715 | | − shiftKey: true, |
| 1716 | | − metaKey: useMetaForMod, |
| 1717 | | − ctrlKey: !useMetaForMod, |
| 1718 | | − bubbles: true, |
| 1719 | | − cancelable: true, |
| 1720 | | − }), |
| 1721 | | − ); |
| 1722 | | − |
| 1723 | | − await waitForURL( |
| 1708 | + await waitForNewThreadShortcutLabel(); |
| 1709 | + await waitForServerConfigToApply(); |
| 1710 | + const composerEditor = await waitForComposerEditor(); |
| 1711 | + composerEditor.focus(); |
| 1712 | + await waitForLayout(); |
| 1713 | + await triggerChatNewShortcutUntilPath( |
| 1724 | 1714 | mounted.router, |
| 1725 | 1715 | (path) => UUID_ROUTE_RE.test(path), |
| 1726 | 1716 | "Route should have changed to a new draft thread UUID from the shortcut.", |