Skip to content

Commit c584ba5

Browse files
committed
feat(core): add favorite folder feature and support opening workspaces (#25)
- Implement add to favorite, remove from favorite, and open favorite commands - Update UI and add new views for favorite folders - Modify existing commands to support new favorite functionality - Update localization files with new translations for favorite-related features
1 parent fad08d0 commit c584ba5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+668
-205
lines changed

l10n/bundle.l10n.ja.json

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"Switch the current window to this folder.": "現在のウィンドウをこのフォルダに切り替える",
2+
"Open in Current Window": "現在のウィンドウで開く",
33
"Reveal in the system explorer": "システムエクスプローラーで表示",
44
"Open in External Terminal": "外部ターミナルで開く",
55
"Open in Built-in Terminal": "内蔵ターミナルで開く",
@@ -36,7 +36,7 @@
3636
"Please select the git repository folder path": "Gitリポジトリのフォルダパスを選択してください",
3737
"Enter the name of the repository for the showcase": "表示用のリポジトリ名を入力",
3838
"Rename the git repository alias": "Gitリポジトリのエイリアスを変更",
39-
"Remove the git repository reference in list": "リストからGitリポジトリの参照を削除",
39+
"Remove the git repository reference from the list": "リストからGitリポジトリの参照を削除",
4040
"Are you sure to delete this repository reference with path {0} and alias {1}?": "パス {0} とエイリアス {1} のリポジトリ参照を削除してもよろしいですか?",
4141
"Please enter a name for the presentation": "表示用の名前を入力してください",
4242
"Select command": "コマンドを選択",
@@ -86,6 +86,8 @@
8686
"Copy • {0}": "コピー • {0}",
8787
"Click to display worktree list in workspace": "ワークスペース内のワークツリー一覧を表示するにはクリック",
8888
"Click to display all worktree list": "すべてのワークツリー一覧を表示するにはクリック",
89+
"Click to display recently used folders": "最近使用したフォルダを表示するにはクリック",
90+
"Click to display Favorites": "クリックしてお気に入りを表示",
8991
"Please select an action": "操作を選択してください",
9092
"template content": "テンプレート内容",
9193
"folder path": "フォルダパス",
@@ -107,6 +109,7 @@
107109
"All folders have been added, there are no more folders to add": "すべてのフォルダが追加され、追加可能なフォルダはありません",
108110
"Refresh": "更新",
109111
"Save git repository": "Gitリポジトリを保存",
112+
"Add to Favorites": "お気に入りに追加",
110113
"Open recently used folders": "最近使用したフォルダを開く",
111114
"Open worktree list": "ワークツリー一覧を開く",
112115
"Input worktree directory": "ワークツリーディレクトリを入力",
@@ -132,7 +135,8 @@
132135
"Loading...": "ロード中...",
133136
"Bundling repo..., {path}": "リポジトリをバンドル中..., {path}",
134137
"Repository backup successful: {path}": "リポジトリのバックアップに成功しました: {path}",
135-
"The selected Git repository paths will be removed from the list": "選択された Git リポジトリのパスはリストから削除されます",
136-
"Please select the Git repository paths you want to remove": "削除したい Git リポジトリのパスを選択してください",
137-
"Select git repository for prune worktree": "ワークツリーを整理するGitリポジトリを選択してください"
138+
"The selected items will be removed from the list": "選択した項目がリストから削除されます",
139+
"Please select the items you want to remove": "削除する項目を選択してください",
140+
"Select git repository for prune worktree": "ワークツリーを整理するGitリポジトリを選択してください",
141+
"Remove the items from the list": "リストから項目を削除します"
138142
}

l10n/bundle.l10n.zh-cn.json

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"Switch the current window to this folder.": "当前窗口切换到这个文件夹",
2+
"Open in Current Window": "在当前窗口打开",
33
"Reveal in the system explorer": "在系统文件管理器中展示",
44
"Open in External Terminal": "在外部终端中打开",
55
"Open in Built-in Terminal": "在内置终端中打开",
@@ -36,7 +36,7 @@
3636
"Please select the git repository folder path": "请选择git仓库文件夹",
3737
"Enter the name of the repository for the showcase": "输入展示用的仓库名称",
3838
"Rename the git repository alias": "重命名git仓库别名",
39-
"Remove the git repository reference in list": "删除git仓库引用",
39+
"Remove the git repository reference from the list": "删除git仓库引用",
4040
"Are you sure to delete this repository reference with path {0} and alias {1}?": "确定删除 路径为 {0} , 别名为 {1} 的这个仓库引用?",
4141
"Please enter a name for the presentation": "请输入展示用的名称",
4242
"Select command": "选择命令",
@@ -86,6 +86,8 @@
8686
"Copy • {0}": "复制 • {0}",
8787
"Click to display worktree list in workspace": "点击以展示工作区内的 worktree 列表",
8888
"Click to display all worktree list": "点击以展示全部的 worktree 列表",
89+
"Click to display recently used folders": "点击以展示最近使用的文件夹",
90+
"Click to display Favorites": "点击以展示收藏夹",
8991
"Please select an action": "请选择一个操作",
9092
"template content": "模板内容",
9193
"folder path": "目录路径",
@@ -107,6 +109,7 @@
107109
"All folders have been added, there are no more folders to add": "已添加全部文件夹,没有文件夹可以额外添加",
108110
"Refresh": "刷新",
109111
"Save git repository": "添加到 git 仓库管理",
112+
"Add to Favorites": "添加到收藏夹",
110113
"Open recently used folders": "打开最近使用的文件夹",
111114
"Open worktree list": "打开 worktree 列表",
112115
"Input worktree directory": "输入 worktree 文件夹",
@@ -132,7 +135,8 @@
132135
"Loading...": "正在加载...",
133136
"Bundling repo..., {path}": "打包仓库中..., {path}",
134137
"Repository backup successful: {path}": "仓库备份成功: {path}",
135-
"The selected Git repository paths will be removed from the list": "选中的 Git 仓库路径将从列表中移除",
136-
"Please select the Git repository paths you want to remove": "请选择需要移除的 Git 仓库路径",
137-
"Select git repository for prune worktree": "请选择需要清理 worktree 的 git 仓库"
138+
"The selected items will be removed from the list": "将会从列表中移除所选项目",
139+
"Please select the items you want to remove": "请选择要移除的项目",
140+
"Select git repository for prune worktree": "请选择需要清理 worktree 的 git 仓库",
141+
"Remove the items from the list": "从列表中移除项目"
138142
}

l10n/bundle.l10n.zh-tw.json

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"Switch the current window to this folder.": "當前視窗切換到這個資料夾",
2+
"Open in Current Window": "在目前視窗中開啟",
33
"Reveal in the system explorer": "在系統檔案總管中顯示",
44
"Open in External Terminal": "在外部終端機中開啟",
55
"Open in Built-in Terminal": "在內建終端機中開啟",
@@ -36,7 +36,7 @@
3636
"Please select the git repository folder path": "請選擇 git 儲存庫資料夾",
3737
"Enter the name of the repository for the showcase": "輸入展示用的儲存庫名稱",
3838
"Rename the git repository alias": "重命名 git 儲存庫別名",
39-
"Remove the git repository reference in list": "刪除 git 儲存庫引用",
39+
"Remove the git repository reference from the list": "刪除 git 儲存庫引用",
4040
"Are you sure to delete this repository reference with path {0} and alias {1}?": "確定刪除路徑為 {0}、別名為 {1} 的這個儲存庫引用?",
4141
"Please enter a name for the presentation": "請輸入展示用的名稱",
4242
"Select command": "選擇命令",
@@ -86,6 +86,8 @@
8686
"Copy • {0}": "複製 • {0}",
8787
"Click to display worktree list in workspace": "點擊以顯示工作區內的 worktree 清單",
8888
"Click to display all worktree list": "點擊以顯示所有的 worktree 清單",
89+
"Click to display recently used folders": "點擊以顯示最近使用的資料夾",
90+
"Click to display Favorites": "點擊以顯示收藏夾",
8991
"Please select an action": "請選擇一個操作",
9092
"template content": "範本內容",
9193
"folder path": "資料夾路徑",
@@ -107,6 +109,7 @@
107109
"All folders have been added, there are no more folders to add": "已新增所有資料夾,沒有更多可新增的資料夾",
108110
"Refresh": "重新整理",
109111
"Save git repository": "儲存 git 儲存庫",
112+
"Add to Favorites": "新增到收藏夾",
110113
"Open recently used folders": "開啟最近使用的資料夾",
111114
"Open worktree list": "開啟 worktree 清單",
112115
"Input worktree directory": "輸入 worktree 目錄",
@@ -132,7 +135,8 @@
132135
"Loading...": "載入中...",
133136
"Bundling repo..., {path}": "組合儲存庫..., {path}",
134137
"Repository backup successful: {path}": "儲存庫備份成功: {path}",
135-
"The selected Git repository paths will be removed from the list": "選取的 Git 儲存庫路徑將從清單中移除",
136-
"Please select the Git repository paths you want to remove": "請選擇要移除的 Git 儲存庫路徑",
137-
"Select git repository for prune worktree": "請選擇需要清理 worktree 的 git 儲存庫"
138+
"The selected items will be removed from the list": "選取的項目將會從列表中移除",
139+
"Please select the items you want to remove": "請選取您要移除的項目",
140+
"Select git repository for prune worktree": "請選擇需要清理 worktree 的 git 儲存庫",
141+
"Remove the items from the list": "從列表中移除項目"
138142
}

package.json

Lines changed: 71 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323
"多工作区",
2424
"切换分支",
2525
"切换文件夹",
26-
"运行命令"
26+
"运行命令",
27+
"cursor",
28+
"Trae"
2729
],
2830
"repository": {
2931
"type": "git",
@@ -51,8 +53,8 @@
5153
"category": "Worktree"
5254
},
5355
{
54-
"command": "git-worktree-manager.switchToSelectFolder",
55-
"title": "%cmd.switchToSelectFolder%",
56+
"command": "git-worktree-manager.switchToSelectWorkspace",
57+
"title": "%cmd.switchToSelectWorkspace%",
5658
"icon": "$(arrow-right)"
5759
},
5860
{
@@ -70,6 +72,11 @@
7072
"title": "%cmd.refreshFolder%",
7173
"icon": "$(refresh)"
7274
},
75+
{
76+
"command": "git-worktree-manager.refreshFavorite",
77+
"title": "%cmd.refreshFavorite%",
78+
"icon": "$(refresh)"
79+
},
7380
{
7481
"command": "git-worktree-manager.addWorktree",
7582
"title": "%cmd.addWorktree%",
@@ -145,6 +152,16 @@
145152
"title": "%cmd.removeMultiGitFolder%",
146153
"icon": "$(trash)"
147154
},
155+
{
156+
"command": "git-worktree-manager.removeFavorite",
157+
"title": "%cmd.removeFavorite%",
158+
"icon": "$(close)"
159+
},
160+
{
161+
"command": "git-worktree-manager.removeMultiFavorite",
162+
"title": "%cmd.removeMultiFavorite%",
163+
"icon": "$(trash)"
164+
},
148165
{
149166
"command": "git-worktree-manager.renameGitFolder",
150167
"title": "%cmd.renameGitFolder%",
@@ -182,6 +199,11 @@
182199
"title": "%cmd.openRecent%",
183200
"icon": "$(search)"
184201
},
202+
{
203+
"command": "git-worktree-manager.openFavorite",
204+
"title": "%cmd.openFavorite%",
205+
"icon": "$(search)"
206+
},
185207
{
186208
"command": "git-worktree-manager.openWorkspaceWorktree",
187209
"title": "%cmd.searchAllWorktree%",
@@ -196,6 +218,11 @@
196218
"title": "%cmd.addToGitFolder%",
197219
"icon": "$(star-empty)"
198220
},
221+
{
222+
"command": "git-worktree-manager.addToFavorite",
223+
"title": "%cmd.addToFavorite%",
224+
"icon": "$(pin)"
225+
},
199226
{
200227
"command": "git-worktree-manager.checkoutBranch",
201228
"title": "%cmd.checkoutBranch%",
@@ -309,6 +336,11 @@
309336
"name": "%view.git-worktree-manager-recent%",
310337
"visibility": "collapsed"
311338
},
339+
{
340+
"id": "git-worktree-manager-favorite",
341+
"name": "%view.git-worktree-manager-favorite%",
342+
"visibility": "collapsed"
343+
},
312344
{
313345
"id": "git-worktree-manager-setting",
314346
"name": "%view.git-worktree-manager-setting%",
@@ -382,6 +414,11 @@
382414
"when": "view =~ /git-worktree-manager-folders/",
383415
"group": "navigation@1"
384416
},
417+
{
418+
"command": "git-worktree-manager.removeMultiFavorite",
419+
"when": "view =~ /git-worktree-manager-favorite/",
420+
"group": "navigation@1"
421+
},
385422
{
386423
"command": "git-worktree-manager.gitFolderViewAsTree",
387424
"when": "view =~ /git-worktree-manager-folders/ && gwm.context.gitFolderViewAsTree",
@@ -411,6 +448,16 @@
411448
"command": "git-worktree-manager.openRecent",
412449
"when": "view === git-worktree-manager-recent",
413450
"group": "navigation@1"
451+
},
452+
{
453+
"command": "git-worktree-manager.refreshFavorite",
454+
"when": "view === git-worktree-manager-favorite",
455+
"group": "navigation@100"
456+
},
457+
{
458+
"command": "git-worktree-manager.openFavorite",
459+
"when": "view === git-worktree-manager-favorite",
460+
"group": "navigation@90"
414461
}
415462
],
416463
"view/item/context": [
@@ -431,7 +478,7 @@
431478
},
432479
{
433480
"command": "git-worktree-manager.revealInSystemExplorer.context",
434-
"when": "viewItem =~ /git-worktree-manager\\.(worktreeItem|gitFolderItem|folderItem)/",
481+
"when": "viewItem =~ /git-worktree-manager\\.(worktreeItem|gitFolderItem|folderItem|workspaceItem)/",
435482
"group": "file-action@0"
436483
},
437484
{
@@ -445,7 +492,7 @@
445492
"group": "inline@2"
446493
},
447494
{
448-
"command": "git-worktree-manager.switchToSelectFolder",
495+
"command": "git-worktree-manager.switchToSelectWorkspace",
449496
"when": "viewItem =~ /git-worktree-manager.worktreeItem/",
450497
"group": "inline@100"
451498
},
@@ -476,7 +523,7 @@
476523
},
477524
{
478525
"command": "git-worktree-manager.revealInSystemExplorer",
479-
"when": "viewItem =~ /git-worktree-manager\\.(worktreeItem|gitFolderItem|folderItem)/ && config.git-worktree-manager.treeView.showOpenExplorerInTreeItem",
526+
"when": "viewItem =~ /git-worktree-manager\\.(worktreeItem|gitFolderItem|folderItem|workspaceItem)/ && config.git-worktree-manager.treeView.showOpenExplorerInTreeItem",
480527
"group": "inline@12"
481528
},
482529
{
@@ -544,6 +591,11 @@
544591
"when": "viewItem =~ /git-worktree-manager.gitFolderItem/",
545592
"group": "inline@100"
546593
},
594+
{
595+
"command": "git-worktree-manager.removeFavorite",
596+
"when": "view === git-worktree-manager-favorite && viewItem =~ /git-worktree-manager.(folderItem|workspaceItem)/",
597+
"group": "inline@100"
598+
},
547599
{
548600
"command": "git-worktree-manager.addToWorkspace",
549601
"when": "viewItem =~ /git-worktree-manager.worktreeItem/ && !(viewItem =~ /git-worktree-manager\\.worktreeItem(.*)\\.current/)",
@@ -571,12 +623,17 @@
571623
},
572624
{
573625
"command": "git-worktree-manager.addToGitFolder",
574-
"when": "viewItem =~ /git-worktree-manager.folderItem/",
626+
"when": "view === git-worktree-manager-recent && viewItem =~ /git-worktree-manager.folderItem/",
575627
"group": "workspace@1"
576628
},
577629
{
578-
"command": "git-worktree-manager.switchToSelectFolder",
579-
"when": "viewItem =~ /git-worktree-manager.folderItem/",
630+
"command": "git-worktree-manager.addToFavorite",
631+
"when": "view === git-worktree-manager-recent && viewItem =~ /git-worktree-manager.(folderItem|workspaceItem)/",
632+
"group": "workspace@1"
633+
},
634+
{
635+
"command": "git-worktree-manager.switchToSelectWorkspace",
636+
"when": "viewItem =~ /git-worktree-manager.(folderItem|workspaceItem)/",
580637
"group": "inline@100"
581638
},
582639
{
@@ -619,7 +676,7 @@
619676
],
620677
"commandPalette": [
621678
{
622-
"command": "git-worktree-manager.switchToSelectFolder",
679+
"command": "git-worktree-manager.switchToSelectWorkspace",
623680
"when": "false"
624681
},
625682
{
@@ -634,6 +691,10 @@
634691
"command": "git-worktree-manager.refreshRecentFolder",
635692
"when": "false"
636693
},
694+
{
695+
"command": "git-worktree-manager.refreshFavorite",
696+
"when": "false"
697+
},
637698
{
638699
"command": "git-worktree-manager.gitFolderViewAsTree",
639700
"when": "false"

package.nls.ja.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
{
22
"cmd.switchWorktree": "ワークツリーを切り替え",
3-
"cmd.switchToSelectFolder": "現在のウィンドウをこのフォルダに切り替える",
3+
"cmd.switchToSelectWorkspace": "現在のウィンドウで開く",
44
"cmd.freshWorktree": "ワークツリーを更新",
55
"cmd.refreshGitFolder": "Gitフォルダを更新",
66
"cmd.refreshFolder": "フォルダを更新",
7+
"cmd.refreshFavorite": "フォルダを更新",
78
"cmd.addWorktree": "ワークツリーを追加",
89
"cmd.addGitFolder": "Gitリポジトリを追加",
910
"cmd.renameGitFolder": "このGitリポジトリの名前を変更",
1011
"cmd.removeGitFolder": "このGitリポジトリを削除",
1112
"cmd.removeMultiGitFolder": "Git リポジトリを一括削除",
1213
"cmd.removeWorktree": "ワークツリーを削除",
14+
"cmd.removeFavorite": "お気に入りから削除",
15+
"cmd.removeMultiFavorite": "お気に入りを一括削除",
1316
"cmd.addWorktreeFromBranch": "現在のブランチからワークツリーを作成",
1417
"cmd.revealInSystemExplorer": "システムエクスプローラーで表示",
1518
"cmd.repairWorktree": "ワークツリーを修復",
@@ -23,7 +26,9 @@
2326
"cmd.removeFromWorkspace": "ワークスペースからフォルダを削除",
2427
"cmd.copyFolderPath": "フォルダパスをコピー",
2528
"cmd.openRecent": "最近使用したフォルダを開く",
29+
"cmd.openFavorite": "お気に入りを開く",
2630
"cmd.addToGitFolder": "Gitリポジトリを保存",
31+
"cmd.addToFavorite": "お気に入りに追加",
2732
"cmd.checkoutBranch": "ブランチをチェックアウト",
2833
"cmd.viewAsTree": "ツリー表示",
2934
"cmd.viewAsList": "リスト表示",
@@ -46,6 +51,7 @@
4651
"view.git-worktree-manager-folders": "Gitリポジトリ管理",
4752
"view.git-worktree-manager-recent": "最近開いたフォルダ",
4853
"view.git-worktree-manager-setting": "Git Worktree設定",
54+
"view.git-worktree-manager-favorite": "お気に入り",
4955
"viewsWelcome.addWorktree": "ワークツリーを追加",
5056
"config.general.title": "一般設定",
5157
"config.treeView.title": "ツリービュー",

0 commit comments

Comments
 (0)