Skip to content

Add Ctrl+Enter / Cmd+Enter shortcut to Input TextArea - #8

Merged
N-ha-1050 merged 5 commits into
mainfrom
copilot/add-input-shortcut-functionality
May 3, 2026
Merged

Add Ctrl+Enter / Cmd+Enter shortcut to Input TextArea#8
N-ha-1050 merged 5 commits into
mainfrom
copilot/add-input-shortcut-functionality

Conversation

Copilot AI commented May 3, 2026

Copy link
Copy Markdown
Contributor

The Input TextArea had no keyboard shortcut to trigger code execution, requiring users to click the Run button or focus the editor to use existing shortcuts.

Changes

  • src/main.ts: Added inputTextArea/isTextArea to imports from ./elements, added the corresponding existence check, and attached a keydown listener that calls run() on Ctrl+Enter (Windows/Linux) or Cmd+Enter (macOS)
if (!isTextArea(inputTextArea)) return

inputTextArea.addEventListener("keydown", (e) => {
  if ((e.ctrlKey || e.metaKey) && e.key === "Enter") {
    run()
  }
})

Copilot AI linked an issue May 3, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add shortcut functionality for Input TextArea Add Ctrl+Enter shortcut to Input TextArea May 3, 2026
Copilot AI requested a review from N-ha-1050 May 3, 2026 18:45
Comment thread package-lock.json Outdated
Copilot AI requested a review from N-ha-1050 May 3, 2026 18:53

@N-ha-1050 N-ha-1050 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrokflow の code quality のチェックが失敗している内容は見ることができますか?見られるなら修正してください。見られない場合は言ってもらえればログを送ります。

Comment thread .gitignore Outdated

Copilot AI commented May 3, 2026

Copy link
Copy Markdown
Contributor Author

Wrokflow の code quality のチェックが失敗している内容は見ることができますか?見られるなら修正してください。見られない場合は言ってもらえればロ...

ログを確認できました。Biome のフォーマットチェックが失敗しており、src/main.ts のインポート文が1行になっていたのが原因でした。Biome は複数行形式を要求していたため、以下のように修正しました(commit f90b9f1)。

import {
  formatButton,
  inputTextArea,
  isButton,
  isTextArea,
  runButton,
} from "./elements"

Copilot AI requested a review from N-ha-1050 May 3, 2026 19:00

@N-ha-1050 N-ha-1050 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot LGTM

@N-ha-1050
N-ha-1050 marked this pull request as ready for review May 3, 2026 19:09
@N-ha-1050
N-ha-1050 requested a review from Copilot May 3, 2026 19:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a keyboard shortcut so users can execute code directly from the input textarea, aligning that part of the UI more closely with the rest of the editor workflow.

Changes:

  • Import the input textarea element and its type guard into src/main.ts
  • Validate that the input element exists and is a textarea before wiring events
  • Add a keydown handler that triggers run() when Ctrl+Enter is pressed in the input textarea

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/main.ts Outdated
Comment thread src/main.ts Outdated
Copilot AI changed the title Add Ctrl+Enter shortcut to Input TextArea Add Ctrl+Enter / Cmd+Enter shortcut to Input TextArea May 3, 2026
Copilot AI requested a review from N-ha-1050 May 3, 2026 19:20
@N-ha-1050
N-ha-1050 merged commit 74e97b4 into main May 3, 2026
2 checks passed
@N-ha-1050
N-ha-1050 deleted the copilot/add-input-shortcut-functionality branch May 3, 2026 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Input 欄での実行ショートカット

3 participants