patchrelay 0.49.2 → 0.49.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "service": "patchrelay",
3
- "version": "0.49.2",
4
- "commit": "a8a5369ebec5",
5
- "builtAt": "2026-04-19T15:58:56.832Z"
3
+ "version": "0.49.3",
4
+ "commit": "39948af65ed2",
5
+ "builtAt": "2026-04-20T00:34:55.802Z"
6
6
  }
@@ -11,7 +11,7 @@ import { buildWatchDetailExportText, exportWatchTextToTempFile, findLastAssistan
11
11
  import { measureRenderedTextRows } from "./layout-measure.js";
12
12
  import { PROMPT_COMPOSER_HINT, measurePromptComposerRows } from "./prompt-layout.js";
13
13
  import { clearTransientStatus, defaultTimerApi, setPersistentStatus, showTransientStatus } from "./transient-status.js";
14
- import { isPromptBackspaceKey, isPromptDeleteKey } from "./input-keys.js";
14
+ import { getPromptEditAction } from "./input-keys.js";
15
15
  async function postPrompt(baseUrl, issueKey, text, bearerToken) {
16
16
  const headers = { "content-type": "application/json" };
17
17
  if (bearerToken)
@@ -259,6 +259,7 @@ export function App({ baseUrl, bearerToken, initialIssueKey }) {
259
259
  }, [promptBuffer, promptDraftBeforeHistory, promptHistory, promptHistoryIndex]);
260
260
  useInput((input, key) => {
261
261
  if (promptMode) {
262
+ const editAction = getPromptEditAction({ input, key, cursor: promptCursor, bufferLength: promptBuffer.length });
262
263
  if (key.escape) {
263
264
  resetPromptComposer();
264
265
  }
@@ -286,14 +287,14 @@ export function App({ baseUrl, bearerToken, initialIssueKey }) {
286
287
  else if (key.downArrow) {
287
288
  recallPromptHistory("newer");
288
289
  }
289
- else if (isPromptBackspaceKey(input, key)) {
290
+ else if (editAction === "backspace") {
290
291
  if (promptCursor > 0) {
291
292
  setPromptBuffer((buffer) => `${buffer.slice(0, promptCursor - 1)}${buffer.slice(promptCursor)}`);
292
293
  setPromptCursor((cursor) => Math.max(0, cursor - 1));
293
294
  setPromptHistoryIndex(null);
294
295
  }
295
296
  }
296
- else if (isPromptDeleteKey(input, key)) {
297
+ else if (editAction === "delete") {
297
298
  if (promptCursor < promptBuffer.length) {
298
299
  setPromptBuffer((buffer) => `${buffer.slice(0, promptCursor)}${buffer.slice(promptCursor + 1)}`);
299
300
  setPromptHistoryIndex(null);
@@ -7,3 +7,18 @@ export function isPromptBackspaceKey(input, key) {
7
7
  export function isPromptDeleteKey(input, key) {
8
8
  return key.delete === true || input === "\u001b[3~";
9
9
  }
10
+ export function getPromptEditAction(params) {
11
+ if (isPromptBackspaceKey(params.input, params.key)) {
12
+ return "backspace";
13
+ }
14
+ if (isPromptDeleteKey(params.input, params.key)) {
15
+ // Some terminal stacks normalize physical backspace as `delete` with
16
+ // empty input. At end-of-line, treat that as backward delete so prompt
17
+ // editing still works instead of turning into a no-op.
18
+ if (params.input === "" && params.cursor >= params.bufferLength) {
19
+ return "backspace";
20
+ }
21
+ return "delete";
22
+ }
23
+ return null;
24
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "patchrelay",
3
- "version": "0.49.2",
3
+ "version": "0.49.3",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {