Skip to content

fix: let ⌘V, ⌘C, ⌘X and ⌘A work in Settings text fields - #261

Merged
M4n0x merged 1 commit into
mainfrom
fix/258-edit-shortcuts
Oct 23, 2026
Merged

M4n0x merged 1 commit into
mainfrom
fix/258-edit-shortcuts

Conversation

@M4n0x

@M4n0x M4n0x commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator

Problem

⌘V, ⌘C, ⌘X and ⌘A do nothing in Settings text fields, so a token can't be pasted into Packages → Sources… → Add source…; only right-click → Paste works. StableBar is an accessory app with no main menu, and AppKit routes these shortcuts to text fields only through the main menu's key equivalents. Closes #258.

Changes

  • EditMenu.swift builds a main menu with one Edit menu: Cut (⌘X), Copy (⌘C), Paste (⌘V) and Select All (⌘A), each sent to the first responder. An accessory app never shows its menu bar, so nothing visible changes.
  • StableBarApp.swift: applicationDidFinishLaunching installs it as NSApp.mainMenu.
  • ⌘Z and ⇧⌘Z stay out of the menu. The Undo and Redo buttons in the Settings footer keep them, as fix: keep the Settings form the same height while saving or showing errors #165 decided.

No configuration properties change, so decoding, layers, editing, docs and examples don't apply.

Testing

  • swift test --filter "editMenu|ThemeTrial|BarEditing": the new editMenuGivesTextFieldsTheClipboardShortcuts test checks that the menu maps exactly ⌘X, ⌘C, ⌘V and ⌘A to cut:, copy:, paste: and selectAll: and leaves ⌘Z free. The XCTest suites that create AppDelegate pass (66 tests).
  • In a dev build with a scratch configuration, the reporter pressed ⌘V in the Token and Index URL fields of Add source, and ⌘A and ⌘C in the URL field: all of them work. In the 0.6.0 beta, ⌘V did nothing in those fields.
  • No screenshots: the menu is hidden and nothing on screen changes.

Merging

One commit; any merge method works.

Claude Opus 5.5 via Claude Code

StableBar is an accessory app with no main menu, and AppKit sends these
shortcuts to text fields only through the main menu's key equivalents.
Give the app a hidden Edit menu with Cut, Copy, Paste and Select All.
⌘Z stays with the Undo and Redo buttons in Settings.

Closes #258
@M4n0x
M4n0x requested a review from Seb-GRAF as a code owner October 23, 2026 07:50
@M4n0x
M4n0x merged commit 51d71b7 into main Oct 23, 2026
7 checks passed
@M4n0x
M4n0x deleted the fix/258-edit-shortcuts branch October 23, 2026 08:04
@stablebar-releases

Copy link
Copy Markdown

🎉 This PR is included in version 0.7.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Copy and paste shortcuts do nothing in Settings text fields

1 participant