Repository navigation
Add iOS custom toolbar macros #6924
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
austinywang
wants to merge
13
commits into
main
from
issue-6087-ios-custom-key-combos-macros-in-the-toolbar-e
+999
−50
Closed
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
2f0509c
Add iOS custom toolbar macros
1f4b998
Address toolbar macro review feedback
514d354
Merge remote-tracking branch 'origin/main' into issue-6087-ios-custom…
ca6ebbb
Use stable identity for toolbar macro steps
a6bfce1
Avoid rescanning toolbar macro steps
e951634
Address toolbar macro review nits
be0dd0a
Merge remote-tracking branch 'origin/main' into issue-6087-ios-custom…
austinywang 8c5472c
Fix crash-prone index bindings in macro step editor
austinywang b0d4fe0
Localize macro step title with localizedStringWithFormat
austinywang 9815f1b
Merge remote-tracking branch 'origin/main' into issue-6087-ios-custom…
austinywang de32ca0
Re-trigger CI: Vercel preview deploy orphaned on merge commit
austinywang a1430bb
Merge remote-tracking branch 'origin/main' into issue-6087-ios-custom…
austinywang 4737f62
Merge remote-tracking branch 'origin/main' into issue-6087-ios-custom…
austinywang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
...es/iOS/CmuxMobileShellUI/Sources/CmuxMobileShellUI/TerminalSpecialKey+ToolbarEditor.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| #if os(iOS) | ||
| import CmuxMobileSupport | ||
| import CmuxMobileTerminalKit | ||
|
|
||
| extension TerminalSpecialKey { | ||
| static let toolbarEditorOptions: [TerminalSpecialKey] = [ | ||
| .escape, | ||
| .tab, | ||
| .upArrow, | ||
| .downArrow, | ||
| .leftArrow, | ||
| .rightArrow, | ||
| .home, | ||
| .end, | ||
| .pageUp, | ||
| .pageDown, | ||
| .delete, | ||
| ] | ||
|
|
||
| var toolbarEditorDisplayName: String { | ||
| switch self { | ||
| case .escape: | ||
| L10n.string("terminal.shortcut.name.escape", defaultValue: "Escape") | ||
| case .tab: | ||
| L10n.string("terminal.shortcut.name.tab", defaultValue: "Tab") | ||
| case .upArrow: | ||
| L10n.string("terminal.shortcut.name.upArrow", defaultValue: "Up Arrow") | ||
| case .downArrow: | ||
| L10n.string("terminal.shortcut.name.downArrow", defaultValue: "Down Arrow") | ||
| case .leftArrow: | ||
| L10n.string("terminal.shortcut.name.leftArrow", defaultValue: "Left Arrow") | ||
| case .rightArrow: | ||
| L10n.string("terminal.shortcut.name.rightArrow", defaultValue: "Right Arrow") | ||
| case .home: | ||
| L10n.string("terminal.shortcut.name.home", defaultValue: "Home") | ||
| case .end: | ||
| L10n.string("terminal.shortcut.name.end", defaultValue: "End") | ||
| case .pageUp: | ||
| L10n.string("terminal.shortcut.name.pageUp", defaultValue: "Page Up") | ||
| case .pageDown: | ||
| L10n.string("terminal.shortcut.name.pageDown", defaultValue: "Page Down") | ||
| case .delete: | ||
| L10n.string("terminal.shortcut.name.delete", defaultValue: "Delete") | ||
| } | ||
| } | ||
| } | ||
| #endif |
22 changes: 22 additions & 0 deletions
22
Packages/iOS/CmuxMobileShellUI/Sources/CmuxMobileShellUI/ToolbarActionEditorMode.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| #if os(iOS) | ||
| import CmuxMobileSupport | ||
|
|
||
| enum ToolbarActionEditorMode: String, CaseIterable, Identifiable { | ||
| case text | ||
| case keyCombo | ||
| case macro | ||
|
|
||
| var id: String { rawValue } | ||
|
|
||
| var title: String { | ||
| switch self { | ||
| case .text: | ||
| L10n.string("mobile.toolbar.editor.type.text", defaultValue: "Text") | ||
| case .keyCombo: | ||
| L10n.string("mobile.toolbar.editor.type.keyCombo", defaultValue: "Key Combo") | ||
| case .macro: | ||
| L10n.string("mobile.toolbar.editor.type.macro", defaultValue: "Macro") | ||
| } | ||
| } | ||
| } | ||
| #endif |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.