Skip to content

Commit 82041dd

Browse files
committed
feat: adjust the default shortcut keys to align with Original GhostText
Assigning the same shortcut key to two or more commands makes Thunderbird unhappy and results in warning, which will likely be confusing to users. Define a shortcut key to toggle separately. Also, change the default shortcut key configuration to replicate Original GhostText.
1 parent 0c45b2f commit 82041dd

4 files changed

Lines changed: 18 additions & 11 deletions

File tree

‎locales.toml‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,19 @@ ja = "Ghostbird - Thunderbird用GhostText"
1414
[manifest_description]
1515
# Description of the extension.
1616
en = "Use your favorite text editor to compose emails"
17-
ja = "お好みのテキストエディタでメールを編集"
17+
ja = "好きなテキストエディタでメールを編集"
1818

1919
[manifest_commands_start_ghostbird_description]
2020
# Description of the shortcut key to start Ghostbird.
21-
en = "Start syncing with the text editor"
22-
ja = "テキストエディタとの同期を開始"
21+
en = "Connect to the text editor"
22+
ja = "テキストエディタに接続"
2323

2424
[manifest_commands_stop_ghostbird_description]
2525
# Description of the shortcut key to stop Ghostbird.
26-
en = "End syncing with the text editor"
27-
ja = "テキストエディタとの同期を停止"
26+
en = "Disconnect from the text editor"
27+
ja = "テキストエディタから切断"
28+
29+
[manifest_commants_toggle_ghostbird_description]
30+
# Description of the shortcut key to toggle Ghostbird.
31+
en = "Toggle connection with the text editor"
32+
ja = "テキストエディタとの接続を切り替え"

‎manifest_template.json‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@
3434
"start_ghostbird": {
3535
"description": "__MSG_manifest_commands_start_ghostbird_description__",
3636
"suggested_key": {
37-
"default": "Ctrl+E"
37+
"default": "Ctrl+Shift+H"
3838
}
3939
},
4040
"stop_ghostbird": {
41-
"description": "__MSG_manifest_commands_stop_ghostbird_description__",
42-
"suggested_key": {
43-
"default": "Ctrl+E"
44-
}
41+
"description": "__MSG_manifest_commands_stop_ghostbird_description__"
42+
},
43+
"toggle_ghostbird": {
44+
"description": "__MSG_manifest_commands_toggle_ghostbird_description__"
4545
}
4646
},
4747
"background": {

‎src/app-background/api.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { IComposeWindow } from "src/ghosttext-adaptor/api"
33
export type { IGhostServerPort } from "src/ghosttext-adaptor/api"
44

55
/** IDs of shortcut keys. Must be in sync with ones in manifest.json */
6-
export type CommandId = "start_ghostbird" | "stop_ghostbird"
6+
export type CommandId = "start_ghostbird" | "stop_ghostbird" | "toggle_ghostbird"
77

88
/** Queries current shortcut key config */
99
export interface ICommandConfig {

‎src/app-background/background_event_router.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ export class BackgroundEventRouter {
3434
return this.composeActionNotifier.start(composeTab)
3535
case "stop_ghostbird":
3636
return this.composeActionNotifier.stop(composeTab)
37+
case "toggle_ghostbird":
38+
return this.composeActionNotifier.toggle(composeTab)
3739
}
3840
// We don't handle default here so that tsc checks for exhaustiveness
3941
}

0 commit comments

Comments
 (0)