@sailfish-ai/recorder 1.7.12-alpha5 → 1.7.13

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.
package/dist/modal.js CHANGED
@@ -20,14 +20,11 @@ export function setupIssueReporting(options) {
20
20
  resolveSessionId = options.getSessionId;
21
21
  // Attach keyboard shortcuts
22
22
  window.addEventListener("keydown", (e) => {
23
- // 1. Ignore if user is typing in input
24
- if (isTypingInInput())
25
- return;
26
- // 2. Normalize keys
23
+ const typingInInput = isTypingInInput();
27
24
  const key = e.key.toLowerCase();
28
25
  const isCmdOrCtrl = e.metaKey || e.ctrlKey;
29
- // 3. Shortcuts for modal open
30
- if (options.enableShortcuts) {
26
+ // Shortcuts for modal open
27
+ if (!typingInInput && options.enableShortcuts) {
31
28
  if (key === "o") {
32
29
  e.preventDefault();
33
30
  injectModalHTML("lookback");
@@ -39,11 +36,11 @@ export function setupIssueReporting(options) {
39
36
  return;
40
37
  }
41
38
  }
42
- // 4. Inside modal actions
39
+ // Inside modal actions
43
40
  const modalOpen = !!document.getElementById("sf-report-issue-modal");
44
41
  if (!modalOpen && !isRecording)
45
42
  return;
46
- // (a) Cmd/Ctrl + Enter → submit
43
+ // Cmd/Ctrl + Enter → submit
47
44
  if (isCmdOrCtrl && key === "enter" && modalOpen) {
48
45
  const submitBtn = document.getElementById("sf-issue-submit-btn");
49
46
  if (submitBtn && !submitBtn.disabled) {
@@ -51,13 +48,16 @@ export function setupIssueReporting(options) {
51
48
  submitBtn.click();
52
49
  }
53
50
  }
54
- // (b) Cmd/Ctrl + Esc → stop recording
51
+ // Cmd/Ctrl + Esc → stop recording
55
52
  if (isCmdOrCtrl && key === "escape" && isRecording) {
56
53
  e.preventDefault();
57
54
  stopRecording();
58
55
  }
59
- // (c) "r" to start recording (only in capture-new mode)
60
- if (key === "r" && modalOpen && currentState.mode === "startnow") {
56
+ // "r" to start recording (only in capture-new mode)
57
+ if (!typingInInput &&
58
+ key === "r" &&
59
+ modalOpen &&
60
+ currentState.mode === "startnow") {
61
61
  const recordIcon = document.getElementById("sf-record-icon");
62
62
  if (recordIcon) {
63
63
  e.preventDefault();