From b13976c5168505a361779b62a96b8374dd2ca3fd Mon Sep 17 00:00:00 2001 From: hl-valdemar Date: Sun, 18 Oct 2026 02:02:12 +0200 Subject: [PATCH] style: match translation footer action ordering and keycaps --- README.md | 2 ++ Sources/Conjure/TranslationController.swift | 16 ++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index d6840d7..8c38945 100644 --- a/README.md +++ b/README.md @@ -134,6 +134,8 @@ Notes autosave locally as RTFD packages, including embedded images, under `~/Lib Search for **Conjure Translate**, identified by its centered 🌏 icon, and open it. Choose a provider in the pill-shaped header selector, enter text in the search bar, then press Return or click **Translate**. Typing alone never sends text. When the translation is available, the action changes to **Copy**: press Return or click it to copy the full translation and close Conjure. Command-C still copies selected output. Editing the input restores **Translate**. +The footer places **Translate/Copy** and its Return keycap before **Actions**, whose Command and K keys use separate keycaps, matching the launcher. + Press Command-P or click the provider selector to expand a searchable action-style popup from its top edge downwards, hiding the indicator until the popup closes. A checkmark marks the current provider. Use Up/Down and Return or click a provider to select it; Escape, Back, or clicking outside closes the popup. Changing providers clears the previous result without submitting a request. The footer shows the current language pair (initially **English → Japanese**). Click it or open **Actions** with Command-K to change the source language, change the target language, or swap them. Language choices are saved locally and apply to both providers. Changing languages clears the previous result without submitting another request. The input hint and output accessibility label follow the selected pair. Escape closes an open action/provider picker first and dismisses the window only when no picker is open. Back closes the picker first, then returns to the launcher and restores your search. Command-W always dismisses the entire window. diff --git a/Sources/Conjure/TranslationController.swift b/Sources/Conjure/TranslationController.swift index d6dfe0a..d4c34d3 100644 --- a/Sources/Conjure/TranslationController.swift +++ b/Sources/Conjure/TranslationController.swift @@ -130,22 +130,22 @@ final class TranslationController: NSViewController { let returnKey = ShortcutIndicator("↵") let actionPill = NSView() stylePill(actionPill) - let actionsKey = ShortcutIndicator("⌘K") - for control in [actionsButton, actionsKey, translateButton, returnKey] { + let actionsKey = ShortcutIndicator("⌘", "K") + for control in [translateButton, returnKey, actionsButton, actionsKey] { control.translatesAutoresizingMaskIntoConstraints = false actionPill.addSubview(control) } NSLayoutConstraint.activate([ actionPill.heightAnchor.constraint(equalToConstant: 36), - actionsButton.leadingAnchor.constraint(equalTo: actionPill.leadingAnchor, constant: 14), - actionsButton.centerYAnchor.constraint(equalTo: actionPill.centerYAnchor), - actionsKey.leadingAnchor.constraint(equalTo: actionsButton.trailingAnchor, constant: 8), - actionsKey.centerYAnchor.constraint(equalTo: actionPill.centerYAnchor), - translateButton.leadingAnchor.constraint(equalTo: actionsKey.trailingAnchor, constant: 16), + translateButton.leadingAnchor.constraint(equalTo: actionPill.leadingAnchor, constant: 14), translateButton.centerYAnchor.constraint(equalTo: actionPill.centerYAnchor), returnKey.leadingAnchor.constraint(equalTo: translateButton.trailingAnchor, constant: 8), returnKey.centerYAnchor.constraint(equalTo: actionPill.centerYAnchor), - returnKey.trailingAnchor.constraint(equalTo: actionPill.trailingAnchor, constant: -12), + actionsButton.leadingAnchor.constraint(equalTo: returnKey.trailingAnchor, constant: 14), + actionsButton.centerYAnchor.constraint(equalTo: actionPill.centerYAnchor), + actionsKey.leadingAnchor.constraint(equalTo: actionsButton.trailingAnchor, constant: 8), + actionsKey.centerYAnchor.constraint(equalTo: actionPill.centerYAnchor), + actionsKey.trailingAnchor.constraint(equalTo: actionPill.trailingAnchor, constant: -12), ]) let footer = NSStackView(views: [languageButton, status, settingsButton, NSView(), actionPill]) footer.orientation = .horizontal