@dungsil/dsh-plugin-ui-forge-worktree 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.de.md +23 -0
- package/README.en.md +23 -0
- package/README.es.md +23 -0
- package/README.fr.md +23 -0
- package/README.ja.md +23 -0
- package/README.md +23 -0
- package/README.pt.md +23 -0
- package/README.ru.md +23 -0
- package/README.zh.md +23 -0
- package/dist/client.js +220 -28
- package/dist/index.js +5041 -2
- package/locale/de.json +3 -0
- package/locale/en.json +3 -0
- package/locale/es.json +3 -0
- package/locale/fr.json +3 -0
- package/locale/ja.json +3 -0
- package/locale/ko.json +3 -0
- package/locale/pt.json +3 -0
- package/locale/ru.json +3 -0
- package/locale/zh.json +3 -0
- package/package.json +21 -4
package/README.de.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
[한국어](./README.md) | [English](./README.en.md) | [简体中文](./README.zh.md) | [日本語](./README.ja.md) | [Español](./README.es.md) | [Français](./README.fr.md) | **Deutsch** | [Português](./README.pt.md) | [Русский](./README.ru.md)
|
|
2
|
+
|
|
3
|
+
# Worktree-Auswahl
|
|
4
|
+
|
|
5
|
+
`@dungsil/dsh-plugin-ui-forge-worktree`
|
|
6
|
+
|
|
7
|
+
## Vorschau
|
|
8
|
+
|
|
9
|
+
**Hell**: Oben ist der aktuelle Branch ausgewählt, unten ein neuer Worktree.
|
|
10
|
+
|
|
11
|
+
<img src="./assets/worktree-preview-de-light.webp" alt="Deutsche Worktree-Auswahl im hellen Design: oben aktueller Branch main ausgewählt, unten neuer Worktree ausgewählt" width="720" />
|
|
12
|
+
|
|
13
|
+
**Dunkel**: Dieselben beiden Zustände im dunklen Design.
|
|
14
|
+
|
|
15
|
+
<img src="./assets/worktree-preview-de-dark.webp" alt="Deutsche Worktree-Auswahl im dunklen Design: oben aktueller Branch main ausgewählt, unten neuer Worktree ausgewählt" width="720" />
|
|
16
|
+
|
|
17
|
+
## Funktionen
|
|
18
|
+
|
|
19
|
+
- Ersetzt die Worktree-Option, die das offizielle `@deepseek-ai/dsh-experimental-forge-bundle` auf dem Bildschirm für neue Sitzungen anzeigt, durch eine Auswahlschaltfläche im Eingabefeld.
|
|
20
|
+
- Wählen Sie im Menü **Neuer Worktree** oder **Aktueller Branch**. Der neue Worktree wird beim Senden der ersten Nachricht erstellt.
|
|
21
|
+
- Die Schaltfläche zeigt den Namen des aktuellen Branches oder **Neuer Worktree** und nach der Erstellung den Branch-Namen des Worktrees.
|
|
22
|
+
- Sperrt die Auswahl nach dem Start der Sitzung und deaktiviert die Option für einen neuen Worktree bei Checkouts, die keinen erstellen können. Kann die Auswahl nicht gespeichert werden, werden ein Fehler und eine Schaltfläche zum Aktualisieren angezeigt.
|
|
23
|
+
- Folgt der DSH-Sprache (Koreanisch, Englisch, Chinesisch, Japanisch, Spanisch, Französisch, Deutsch, Russisch, Portugiesisch) sowie dem hellen und dunklen Design.
|
package/README.en.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
[한국어](./README.md) | **English** | [简体中文](./README.zh.md) | [日本語](./README.ja.md) | [Español](./README.es.md) | [Français](./README.fr.md) | [Deutsch](./README.de.md) | [Português](./README.pt.md) | [Русский](./README.ru.md)
|
|
2
|
+
|
|
3
|
+
# Worktree Picker
|
|
4
|
+
|
|
5
|
+
`@dungsil/dsh-plugin-ui-forge-worktree`
|
|
6
|
+
|
|
7
|
+
## Preview
|
|
8
|
+
|
|
9
|
+
**Light**: The top shows the current branch selected, and the bottom shows a new worktree selected.
|
|
10
|
+
|
|
11
|
+
<img src="./assets/worktree-preview-en-light.webp" alt="Light theme English Worktree Picker: current branch main selected on top, new worktree selected below" width="720" />
|
|
12
|
+
|
|
13
|
+
**Dark**: The same two states in the dark theme.
|
|
14
|
+
|
|
15
|
+
<img src="./assets/worktree-preview-en-dark.webp" alt="Dark theme English Worktree Picker: current branch main selected on top, new worktree selected below" width="720" />
|
|
16
|
+
|
|
17
|
+
## Features
|
|
18
|
+
|
|
19
|
+
- Replaces the worktree option that the official `@deepseek-ai/dsh-experimental-forge-bundle` shows on the New Session screen with a picker button in the composer.
|
|
20
|
+
- Choose **New worktree** or **Current branch** from the menu. A new worktree is created when you send your first message.
|
|
21
|
+
- The button shows the current branch name or **New worktree**, and the worktree's branch name once it has been created.
|
|
22
|
+
- Locks the selection after the session starts, and disables the new worktree option for checkouts that cannot create one. If the selection cannot be saved, it shows an error and a refresh button.
|
|
23
|
+
- Follows the DSH language (Korean, English, Chinese, Japanese, Spanish, French, German, Russian, Portuguese) and the light and dark themes.
|
package/README.es.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
[한국어](./README.md) | [English](./README.en.md) | [简体中文](./README.zh.md) | [日本語](./README.ja.md) | **Español** | [Français](./README.fr.md) | [Deutsch](./README.de.md) | [Português](./README.pt.md) | [Русский](./README.ru.md)
|
|
2
|
+
|
|
3
|
+
# Selector de árboles de trabajo
|
|
4
|
+
|
|
5
|
+
`@dungsil/dsh-plugin-ui-forge-worktree`
|
|
6
|
+
|
|
7
|
+
## Vista previa
|
|
8
|
+
|
|
9
|
+
**Claro**: arriba está seleccionada la rama actual y abajo, un nuevo árbol de trabajo.
|
|
10
|
+
|
|
11
|
+
<img src="./assets/worktree-preview-es-light.webp" alt="Selector de árboles de trabajo en español con tema claro: arriba, la rama actual main seleccionada; abajo, un nuevo árbol de trabajo seleccionado" width="720" />
|
|
12
|
+
|
|
13
|
+
**Oscuro**: los mismos dos estados con el tema oscuro.
|
|
14
|
+
|
|
15
|
+
<img src="./assets/worktree-preview-es-dark.webp" alt="Selector de árboles de trabajo en español con tema oscuro: arriba, la rama actual main seleccionada; abajo, un nuevo árbol de trabajo seleccionado" width="720" />
|
|
16
|
+
|
|
17
|
+
## Funciones
|
|
18
|
+
|
|
19
|
+
- Sustituye la opción de árbol de trabajo que el paquete oficial `@deepseek-ai/dsh-experimental-forge-bundle` muestra en la pantalla de nueva sesión por un botón selector en el cuadro de entrada.
|
|
20
|
+
- Elige **Nuevo árbol de trabajo** o **Rama actual** en el menú. El nuevo árbol de trabajo se crea al enviar el primer mensaje.
|
|
21
|
+
- El botón muestra el nombre de la rama actual o **Nuevo árbol de trabajo** y, una vez creado el árbol de trabajo, el nombre de su rama.
|
|
22
|
+
- Bloquea la selección cuando la sesión ha empezado y desactiva la opción de nuevo árbol de trabajo en los checkouts que no pueden crearlo. Si no se puede guardar la selección, muestra un error y un botón para actualizar.
|
|
23
|
+
- Sigue el idioma de DSH (coreano, inglés, chino, japonés, español, francés, alemán, ruso y portugués) y los temas claro y oscuro.
|
package/README.fr.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
[한국어](./README.md) | [English](./README.en.md) | [简体中文](./README.zh.md) | [日本語](./README.ja.md) | [Español](./README.es.md) | **Français** | [Deutsch](./README.de.md) | [Português](./README.pt.md) | [Русский](./README.ru.md)
|
|
2
|
+
|
|
3
|
+
# Sélecteur d’arbres de travail
|
|
4
|
+
|
|
5
|
+
`@dungsil/dsh-plugin-ui-forge-worktree`
|
|
6
|
+
|
|
7
|
+
## Aperçu
|
|
8
|
+
|
|
9
|
+
**Clair** : en haut, la branche actuelle est sélectionnée ; en bas, un nouvel arbre de travail.
|
|
10
|
+
|
|
11
|
+
<img src="./assets/worktree-preview-fr-light.webp" alt="Sélecteur d’arbres de travail en français, thème clair : en haut, la branche actuelle main sélectionnée ; en bas, un nouvel arbre de travail sélectionné" width="720" />
|
|
12
|
+
|
|
13
|
+
**Sombre** : les deux mêmes états avec le thème sombre.
|
|
14
|
+
|
|
15
|
+
<img src="./assets/worktree-preview-fr-dark.webp" alt="Sélecteur d’arbres de travail en français, thème sombre : en haut, la branche actuelle main sélectionnée ; en bas, un nouvel arbre de travail sélectionné" width="720" />
|
|
16
|
+
|
|
17
|
+
## Fonctionnalités
|
|
18
|
+
|
|
19
|
+
- Remplace l’option d’arbre de travail que le paquet officiel `@deepseek-ai/dsh-experimental-forge-bundle` affiche sur l’écran de nouvelle session par un bouton de sélection dans la zone de saisie.
|
|
20
|
+
- Choisissez **Nouvel arbre de travail** ou **Branche actuelle** dans le menu. Le nouvel arbre de travail est créé à l’envoi du premier message.
|
|
21
|
+
- Le bouton affiche le nom de la branche actuelle ou **Nouvel arbre de travail**, puis le nom de la branche de l’arbre de travail une fois celui-ci créé.
|
|
22
|
+
- Verrouille la sélection une fois la session démarrée et désactive l’option de nouvel arbre de travail pour les checkouts qui ne peuvent pas en créer. Si la sélection ne peut pas être enregistrée, affiche une erreur et un bouton d’actualisation.
|
|
23
|
+
- Suit la langue de DSH (coréen, anglais, chinois, japonais, espagnol, français, allemand, russe et portugais) ainsi que les thèmes clair et sombre.
|
package/README.ja.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
[한국어](./README.md) | [English](./README.en.md) | [简体中文](./README.zh.md) | **日本語** | [Español](./README.es.md) | [Français](./README.fr.md) | [Deutsch](./README.de.md) | [Português](./README.pt.md) | [Русский](./README.ru.md)
|
|
2
|
+
|
|
3
|
+
# ワークツリー選択
|
|
4
|
+
|
|
5
|
+
`@dungsil/dsh-plugin-ui-forge-worktree`
|
|
6
|
+
|
|
7
|
+
## プレビュー
|
|
8
|
+
|
|
9
|
+
**ライト**:上は現在のブランチ、下は新しいワークツリーを選択した状態です。
|
|
10
|
+
|
|
11
|
+
<img src="./assets/worktree-preview-ja-light.webp" alt="ライトテーマの日本語ワークツリー選択:上は現在のブランチ main を選択、下は新しいワークツリーを選択" width="720" />
|
|
12
|
+
|
|
13
|
+
**ダーク**:同じ 2 つの状態をダークテーマで表示します。
|
|
14
|
+
|
|
15
|
+
<img src="./assets/worktree-preview-ja-dark.webp" alt="ダークテーマの日本語ワークツリー選択:上は現在のブランチ main を選択、下は新しいワークツリーを選択" width="720" />
|
|
16
|
+
|
|
17
|
+
## 機能
|
|
18
|
+
|
|
19
|
+
- 公式 `@deepseek-ai/dsh-experimental-forge-bundle` が新しいセッション画面に表示するワークツリーオプションを、入力欄の選択ボタンに置き換えます。
|
|
20
|
+
- メニューで**新しいワークツリー**と**現在のブランチ**のどちらかを選びます。新しいワークツリーは最初のメッセージを送信したときに作成されます。
|
|
21
|
+
- ボタンには現在のブランチ名または**新しいワークツリー**を表示し、ワークツリーの作成後はそのブランチ名を表示します。
|
|
22
|
+
- セッション開始後は選択を固定し、新しいワークツリーを作成できないチェックアウトではその項目を無効にします。選択を保存できない場合は、エラーと再読み込みボタンを表示します。
|
|
23
|
+
- DSH の表示言語(韓国語、英語、中国語、日本語、スペイン語、フランス語、ドイツ語、ロシア語、ポルトガル語)と、ライト・ダークテーマに従います。
|
package/README.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
**한국어** | [English](./README.en.md) | [简体中文](./README.zh.md) | [日本語](./README.ja.md) | [Español](./README.es.md) | [Français](./README.fr.md) | [Deutsch](./README.de.md) | [Português](./README.pt.md) | [Русский](./README.ru.md)
|
|
2
|
+
|
|
3
|
+
# Worktree Picker · 워크트리 선택기
|
|
4
|
+
|
|
5
|
+
`@dungsil/dsh-plugin-ui-forge-worktree`
|
|
6
|
+
|
|
7
|
+
## 미리보기
|
|
8
|
+
|
|
9
|
+
**라이트**: 위는 현재 브랜치를, 아래는 새 워크트리를 선택한 상태입니다.
|
|
10
|
+
|
|
11
|
+
<img src="./assets/worktree-preview-ko-light.webp" alt="라이트 테마의 한국어 워크트리 선택기: 위는 현재 브랜치 main 선택, 아래는 새 워크트리 선택" width="720" />
|
|
12
|
+
|
|
13
|
+
**다크**: 같은 두 상태를 다크 테마로 표시합니다.
|
|
14
|
+
|
|
15
|
+
<img src="./assets/worktree-preview-ko-dark.webp" alt="다크 테마의 한국어 워크트리 선택기: 위는 현재 브랜치 main 선택, 아래는 새 워크트리 선택" width="720" />
|
|
16
|
+
|
|
17
|
+
## 기능
|
|
18
|
+
|
|
19
|
+
- 공식 `@deepseek-ai/dsh-experimental-forge-bundle`이 새 세션 화면에 표시하는 워크트리 옵션을 입력창의 선택 버튼으로 바꿉니다.
|
|
20
|
+
- 메뉴에서 **새 워크트리**와 **현재 브랜치** 중 하나를 고릅니다. 새 워크트리는 첫 메시지를 보낼 때 생성됩니다.
|
|
21
|
+
- 버튼에는 현재 브랜치 이름이나 **새 워크트리**를 표시하고, 워크트리가 생성된 뒤에는 그 브랜치 이름을 표시합니다.
|
|
22
|
+
- 세션이 시작된 뒤에는 선택을 잠그고, 새 워크트리를 만들 수 없는 체크아웃에서는 해당 항목을 비활성화합니다. 선택을 저장하지 못하면 오류와 새로고침 버튼을 표시합니다.
|
|
23
|
+
- DSH의 언어(한국어, 영어, 중국어, 일본어, 스페인어, 프랑스어, 독일어, 러시아어, 포르투갈어)와 라이트·다크 테마를 따릅니다.
|
package/README.pt.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
[한국어](./README.md) | [English](./README.en.md) | [简体中文](./README.zh.md) | [日本語](./README.ja.md) | [Español](./README.es.md) | [Français](./README.fr.md) | [Deutsch](./README.de.md) | **Português** | [Русский](./README.ru.md)
|
|
2
|
+
|
|
3
|
+
# Seletor de árvores de trabalho
|
|
4
|
+
|
|
5
|
+
`@dungsil/dsh-plugin-ui-forge-worktree`
|
|
6
|
+
|
|
7
|
+
## Pré-visualização
|
|
8
|
+
|
|
9
|
+
**Claro**: em cima, a branch atual está selecionada; em baixo, uma nova árvore de trabalho.
|
|
10
|
+
|
|
11
|
+
<img src="./assets/worktree-preview-pt-light.webp" alt="Seletor de árvores de trabalho em português no tema claro: em cima, branch atual main selecionada; em baixo, nova árvore de trabalho selecionada" width="720" />
|
|
12
|
+
|
|
13
|
+
**Escuro**: os mesmos dois estados no tema escuro.
|
|
14
|
+
|
|
15
|
+
<img src="./assets/worktree-preview-pt-dark.webp" alt="Seletor de árvores de trabalho em português no tema escuro: em cima, branch atual main selecionada; em baixo, nova árvore de trabalho selecionada" width="720" />
|
|
16
|
+
|
|
17
|
+
## Funcionalidades
|
|
18
|
+
|
|
19
|
+
- Substitui a opção de árvore de trabalho que o pacote oficial `@deepseek-ai/dsh-experimental-forge-bundle` mostra no ecrã de nova sessão por um botão seletor no campo de mensagem.
|
|
20
|
+
- Escolha **Nova árvore de trabalho** ou **Branch atual** no menu. A nova árvore de trabalho é criada quando envia a primeira mensagem.
|
|
21
|
+
- O botão mostra o nome da branch atual ou **Nova árvore de trabalho** e, depois de a árvore de trabalho ser criada, o nome da sua branch.
|
|
22
|
+
- Bloqueia a seleção depois de a sessão começar e desativa a opção de nova árvore de trabalho em checkouts que não a podem criar. Se não for possível guardar a seleção, mostra um erro e um botão para atualizar.
|
|
23
|
+
- Segue o idioma do DSH (coreano, inglês, chinês, japonês, espanhol, francês, alemão, russo e português) e os temas claro e escuro.
|
package/README.ru.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
[한국어](./README.md) | [English](./README.en.md) | [简体中文](./README.zh.md) | [日本語](./README.ja.md) | [Español](./README.es.md) | [Français](./README.fr.md) | [Deutsch](./README.de.md) | [Português](./README.pt.md) | **Русский**
|
|
2
|
+
|
|
3
|
+
# Выбор рабочего дерева
|
|
4
|
+
|
|
5
|
+
`@dungsil/dsh-plugin-ui-forge-worktree`
|
|
6
|
+
|
|
7
|
+
## Предпросмотр
|
|
8
|
+
|
|
9
|
+
**Светлая тема**: сверху выбрана текущая ветка, снизу — новое рабочее дерево.
|
|
10
|
+
|
|
11
|
+
<img src="./assets/worktree-preview-ru-light.webp" alt="Выбор рабочего дерева на русском языке, светлая тема: сверху выбрана текущая ветка main, снизу выбрано новое рабочее дерево" width="720" />
|
|
12
|
+
|
|
13
|
+
**Тёмная тема**: те же два состояния в тёмной теме.
|
|
14
|
+
|
|
15
|
+
<img src="./assets/worktree-preview-ru-dark.webp" alt="Выбор рабочего дерева на русском языке, тёмная тема: сверху выбрана текущая ветка main, снизу выбрано новое рабочее дерево" width="720" />
|
|
16
|
+
|
|
17
|
+
## Возможности
|
|
18
|
+
|
|
19
|
+
- Заменяет параметр рабочего дерева, который официальный `@deepseek-ai/dsh-experimental-forge-bundle` показывает на экране новой сессии, кнопкой выбора в поле ввода.
|
|
20
|
+
- В меню можно выбрать **Новое рабочее дерево** или **Текущая ветка**. Новое рабочее дерево создаётся при отправке первого сообщения.
|
|
21
|
+
- На кнопке отображается имя текущей ветки или **Новое рабочее дерево**, а после создания рабочего дерева — имя его ветки.
|
|
22
|
+
- После начала сессии выбор блокируется, а для checkout, в котором нельзя создать рабочее дерево, этот пункт отключается. Если выбор не удаётся сохранить, отображаются ошибка и кнопка обновления.
|
|
23
|
+
- Следует языку DSH (корейский, английский, китайский, японский, испанский, французский, немецкий, русский, португальский), а также светлой и тёмной темам.
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
[한국어](./README.md) | [English](./README.en.md) | **简体中文** | [日本語](./README.ja.md) | [Español](./README.es.md) | [Français](./README.fr.md) | [Deutsch](./README.de.md) | [Português](./README.pt.md) | [Русский](./README.ru.md)
|
|
2
|
+
|
|
3
|
+
# 工作树选择器
|
|
4
|
+
|
|
5
|
+
`@dungsil/dsh-plugin-ui-forge-worktree`
|
|
6
|
+
|
|
7
|
+
## 预览
|
|
8
|
+
|
|
9
|
+
**浅色**:上方为选择当前分支,下方为选择新建工作树。
|
|
10
|
+
|
|
11
|
+
<img src="./assets/worktree-preview-zh-light.webp" alt="浅色主题的中文工作树选择器:上方选择当前分支 main,下方选择新建工作树" width="720" />
|
|
12
|
+
|
|
13
|
+
**深色**:以深色主题显示相同的两种状态。
|
|
14
|
+
|
|
15
|
+
<img src="./assets/worktree-preview-zh-dark.webp" alt="深色主题的中文工作树选择器:上方选择当前分支 main,下方选择新建工作树" width="720" />
|
|
16
|
+
|
|
17
|
+
## 功能
|
|
18
|
+
|
|
19
|
+
- 将官方 `@deepseek-ai/dsh-experimental-forge-bundle` 在新建会话界面显示的工作树选项替换为输入框中的选择按钮。
|
|
20
|
+
- 在菜单中选择**新建工作树**或**当前分支**。新工作树会在发送第一条消息时创建。
|
|
21
|
+
- 按钮显示当前分支名称或**新建工作树**,工作树创建后显示其分支名称。
|
|
22
|
+
- 会话开始后锁定选择;在无法创建新工作树的检出中禁用该选项。选择无法保存时显示错误和刷新按钮。
|
|
23
|
+
- 跟随 DSH 的界面语言(韩语、英语、中文、日语、西班牙语、法语、德语、俄语、葡萄牙语)以及浅色和深色主题。
|
package/dist/client.js
CHANGED
|
@@ -9,6 +9,15 @@ function useLocaleSnapshot(locale) {
|
|
|
9
9
|
const getSnapshot = (0, react.useCallback)(() => locale.getSnapshot(), [locale]);
|
|
10
10
|
return (0, react.useSyncExternalStore)(subscribe, getSnapshot);
|
|
11
11
|
}
|
|
12
|
+
/** Key of a per-language record for the language's primary subtag, falling back to `fallback`. */
|
|
13
|
+
function localizedLanguage(languages, language, fallback = "en") {
|
|
14
|
+
const base = language.toLowerCase().split(/[-_]/)[0];
|
|
15
|
+
return Object.hasOwn(languages, base) ? base : fallback;
|
|
16
|
+
}
|
|
17
|
+
/** Entry of a per-language record for the language's primary subtag, falling back to `fallback`. */
|
|
18
|
+
function localizedCopy(languages, language, fallback = "en") {
|
|
19
|
+
return languages[localizedLanguage(languages, language, fallback)];
|
|
20
|
+
}
|
|
12
21
|
/** Each effect owns its sheet, even when another plugin installs the same defaults. */
|
|
13
22
|
function installStyles(css) {
|
|
14
23
|
const style = document.createElement("style");
|
|
@@ -66,6 +75,9 @@ const copy = {
|
|
|
66
75
|
"locked": "The worktree selection cannot be changed after this session starts.",
|
|
67
76
|
"error": "Could not confirm the worktree selection. Refresh before trying again.",
|
|
68
77
|
"refresh": "Refresh selection",
|
|
78
|
+
"previous": "Previous worktrees",
|
|
79
|
+
"more": "More worktrees",
|
|
80
|
+
"listError": "Could not load existing worktrees",
|
|
69
81
|
"blocked": "A new worktree is not available for this checkout."
|
|
70
82
|
},
|
|
71
83
|
ko: {
|
|
@@ -79,6 +91,9 @@ const copy = {
|
|
|
79
91
|
"locked": "세션이 시작된 후에는 워크트리 선택을 변경할 수 없습니다.",
|
|
80
92
|
"error": "워크트리 선택을 확인하지 못했습니다. 새로고침한 후 다시 시도하세요.",
|
|
81
93
|
"refresh": "선택 새로고침",
|
|
94
|
+
"previous": "이전 워크트리",
|
|
95
|
+
"more": "다른 워크트리 더 보기",
|
|
96
|
+
"listError": "기존 워크트리를 불러오지 못했습니다",
|
|
82
97
|
"blocked": "이 체크아웃에서는 새 워크트리를 사용할 수 없습니다."
|
|
83
98
|
},
|
|
84
99
|
zh: {
|
|
@@ -92,6 +107,9 @@ const copy = {
|
|
|
92
107
|
"locked": "会话开始后无法更改工作树选择。",
|
|
93
108
|
"error": "无法确认工作树选择。请刷新后重试。",
|
|
94
109
|
"refresh": "刷新选择",
|
|
110
|
+
"previous": "上一页工作树",
|
|
111
|
+
"more": "更多工作树",
|
|
112
|
+
"listError": "无法加载现有工作树",
|
|
95
113
|
"blocked": "此检出目录无法使用新工作树。"
|
|
96
114
|
},
|
|
97
115
|
ja: {
|
|
@@ -105,6 +123,9 @@ const copy = {
|
|
|
105
123
|
"locked": "セッション開始後はワークツリーの選択を変更できません。",
|
|
106
124
|
"error": "ワークツリーの選択を確認できませんでした。更新してから再試行してください。",
|
|
107
125
|
"refresh": "選択を更新",
|
|
126
|
+
"previous": "前のワークツリー",
|
|
127
|
+
"more": "他のワークツリー",
|
|
128
|
+
"listError": "既存のワークツリーを読み込めませんでした",
|
|
108
129
|
"blocked": "このチェックアウトでは新しいワークツリーを利用できません。"
|
|
109
130
|
},
|
|
110
131
|
es: {
|
|
@@ -118,6 +139,9 @@ const copy = {
|
|
|
118
139
|
"locked": "No se puede cambiar la selección del árbol de trabajo una vez iniciada esta sesión.",
|
|
119
140
|
"error": "No se pudo confirmar la selección del árbol de trabajo. Actualiza antes de volver a intentarlo.",
|
|
120
141
|
"refresh": "Actualizar selección",
|
|
142
|
+
"previous": "Árboles anteriores",
|
|
143
|
+
"more": "Más árboles de trabajo",
|
|
144
|
+
"listError": "No se pudieron cargar los árboles existentes",
|
|
121
145
|
"blocked": "No hay un nuevo árbol de trabajo disponible para este checkout."
|
|
122
146
|
},
|
|
123
147
|
fr: {
|
|
@@ -131,6 +155,9 @@ const copy = {
|
|
|
131
155
|
"locked": "La sélection de l’arbre de travail ne peut plus être modifiée une fois cette session démarrée.",
|
|
132
156
|
"error": "Impossible de confirmer la sélection de l’arbre de travail. Actualisez avant de réessayer.",
|
|
133
157
|
"refresh": "Actualiser la sélection",
|
|
158
|
+
"previous": "Arbres précédents",
|
|
159
|
+
"more": "Plus de worktrees",
|
|
160
|
+
"listError": "Impossible de charger les arbres existants",
|
|
134
161
|
"blocked": "Aucun nouvel arbre de travail n’est disponible pour cette copie de travail."
|
|
135
162
|
},
|
|
136
163
|
de: {
|
|
@@ -144,6 +171,9 @@ const copy = {
|
|
|
144
171
|
"locked": "Die Worktree-Auswahl kann nach dem Start dieser Sitzung nicht mehr geändert werden.",
|
|
145
172
|
"error": "Die Worktree-Auswahl konnte nicht bestätigt werden. Aktualisieren Sie vor einem erneuten Versuch.",
|
|
146
173
|
"refresh": "Auswahl aktualisieren",
|
|
174
|
+
"previous": "Vorherige Worktrees",
|
|
175
|
+
"more": "Weitere Worktrees",
|
|
176
|
+
"listError": "Bestehende Worktrees konnten nicht geladen werden",
|
|
147
177
|
"blocked": "Für diesen Checkout ist kein neuer Worktree verfügbar."
|
|
148
178
|
},
|
|
149
179
|
ru: {
|
|
@@ -157,6 +187,9 @@ const copy = {
|
|
|
157
187
|
"locked": "Выбор рабочего дерева нельзя изменить после начала этой сессии.",
|
|
158
188
|
"error": "Не удалось подтвердить выбор рабочего дерева. Обновите данные перед повторной попыткой.",
|
|
159
189
|
"refresh": "Обновить выбор",
|
|
190
|
+
"previous": "Предыдущие деревья",
|
|
191
|
+
"more": "Другие рабочие деревья",
|
|
192
|
+
"listError": "Не удалось загрузить существующие деревья",
|
|
160
193
|
"blocked": "Для этой рабочей копии новое рабочее дерево недоступно."
|
|
161
194
|
},
|
|
162
195
|
pt: {
|
|
@@ -170,6 +203,9 @@ const copy = {
|
|
|
170
203
|
"locked": "A seleção da árvore de trabalho não pode ser alterada após o início desta sessão.",
|
|
171
204
|
"error": "Não foi possível confirmar a seleção da árvore de trabalho. Atualize antes de tentar novamente.",
|
|
172
205
|
"refresh": "Atualizar seleção",
|
|
206
|
+
"previous": "Árvores anteriores",
|
|
207
|
+
"more": "Mais árvores de trabalho",
|
|
208
|
+
"listError": "Não foi possível carregar as árvores existentes",
|
|
173
209
|
"blocked": "Uma nova árvore de trabalho não está disponível para este checkout."
|
|
174
210
|
}
|
|
175
211
|
};
|
|
@@ -190,11 +226,33 @@ const styles = `${composerStyles}
|
|
|
190
226
|
.dsh-forge-worktree-trigger:focus-visible, .dsh-forge-worktree-refresh:focus-visible { outline: 2px solid var(--dsw-focus-ring-color, var(--dsw-alias-brand-primary)); outline-offset: 2px; }
|
|
191
227
|
@media (hover: hover) { .dsh-forge-worktree-refresh:hover { background: var(--dsw-alias-bg-layer-2); } }
|
|
192
228
|
`;
|
|
229
|
+
// src/default-checkout.ts
|
|
230
|
+
const readMethod = "dungsil-worktree-preference/read";
|
|
231
|
+
/** Client-lifetime decisions only; never persist session IDs. */
|
|
232
|
+
function createDefaultCheckout() {
|
|
233
|
+
const settled = /* @__PURE__ */ new Set();
|
|
234
|
+
return {
|
|
235
|
+
mark(id) {
|
|
236
|
+
settled.add(id);
|
|
237
|
+
},
|
|
238
|
+
apply(id, preferred, panel, available, blank, request) {
|
|
239
|
+
if (settled.has(id) || !blank) {
|
|
240
|
+
if (!blank) settled.add(id);
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
if (preferred === null || !panel || !available || panel.checkout.state === "pending") return;
|
|
244
|
+
settled.add(id);
|
|
245
|
+
const w = panel.worktree;
|
|
246
|
+
if (preferred === "worktree" && panel.checkout.state === "ready" && w.editable && !w.blocker && !w.request && !w.created && !w.creation && !w.restoration) request();
|
|
247
|
+
}
|
|
248
|
+
};
|
|
249
|
+
}
|
|
193
250
|
// src/client.tsx
|
|
194
251
|
const name = "dungsil-ui-forge-worktree";
|
|
195
252
|
const inject = [
|
|
196
253
|
"slots",
|
|
197
254
|
"locale",
|
|
255
|
+
"connection",
|
|
198
256
|
"remote",
|
|
199
257
|
"remote.forgePanel"
|
|
200
258
|
];
|
|
@@ -333,6 +391,57 @@ var SelectionController = class {
|
|
|
333
391
|
}
|
|
334
392
|
}
|
|
335
393
|
}
|
|
394
|
+
async enter(path, connection) {
|
|
395
|
+
const { panel, busy, error } = this.snapshot;
|
|
396
|
+
if (this.writing || busy || error || !panel?.worktree.editable || panel.worktree.created || panel.worktree.creation || panel.worktree.restoration) return;
|
|
397
|
+
this.writing = true;
|
|
398
|
+
this.stopFeed();
|
|
399
|
+
this.publish({
|
|
400
|
+
...this.snapshot,
|
|
401
|
+
busy: true,
|
|
402
|
+
error: false
|
|
403
|
+
});
|
|
404
|
+
const lifetime = this.lifetime;
|
|
405
|
+
const signal = AbortSignal.any([lifetime.signal, AbortSignal.timeout(15e3)]);
|
|
406
|
+
try {
|
|
407
|
+
if (panel.worktree.request) {
|
|
408
|
+
const cancelled = await this.remote.cancelWorktree(this.id, signal);
|
|
409
|
+
if (!cancelled.ok) throw cancelled.error;
|
|
410
|
+
const stream = this.remote.follow(this.id, signal);
|
|
411
|
+
const stop = () => stream.dispose();
|
|
412
|
+
signal.addEventListener("abort", stop, { once: true });
|
|
413
|
+
let confirmed = false;
|
|
414
|
+
try {
|
|
415
|
+
for await (const next of stream) if (next.worktree.request === null && next.worktree.editable && !next.worktree.creation && !next.worktree.created && !next.worktree.restoration) {
|
|
416
|
+
confirmed = true;
|
|
417
|
+
break;
|
|
418
|
+
}
|
|
419
|
+
} finally {
|
|
420
|
+
signal.removeEventListener("abort", stop);
|
|
421
|
+
stream.dispose();
|
|
422
|
+
}
|
|
423
|
+
if (!confirmed) throw Error("Cancellation was not confirmed");
|
|
424
|
+
}
|
|
425
|
+
signal.throwIfAborted();
|
|
426
|
+
const moved = await connection.rpc.call("/api", "dungsil-worktree-picker/enter", {
|
|
427
|
+
sessionId: this.id,
|
|
428
|
+
path
|
|
429
|
+
}, signal);
|
|
430
|
+
signal.throwIfAborted();
|
|
431
|
+
if (!moved.ok) throw Error("Worktree move failed");
|
|
432
|
+
if (!lifetime.signal.aborted) this.follow();
|
|
433
|
+
} catch {
|
|
434
|
+
if (!lifetime.signal.aborted) {
|
|
435
|
+
this.writing = false;
|
|
436
|
+
this.stopFeed();
|
|
437
|
+
this.publish({
|
|
438
|
+
...this.snapshot,
|
|
439
|
+
busy: false,
|
|
440
|
+
error: true
|
|
441
|
+
});
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
}
|
|
336
445
|
dispose() {
|
|
337
446
|
this.lifetime.abort();
|
|
338
447
|
this.stopFeed();
|
|
@@ -342,18 +451,35 @@ var SelectionController = class {
|
|
|
342
451
|
function apply(ctx) {
|
|
343
452
|
const remote = ctx.remote.forgePanel;
|
|
344
453
|
const controllers = /* @__PURE__ */ new Set();
|
|
454
|
+
const defaults = createDefaultCheckout();
|
|
455
|
+
const connection = ctx.get("connection");
|
|
345
456
|
ctx.effect(() => () => {
|
|
346
457
|
for (const controller of controllers) controller.dispose();
|
|
347
458
|
controllers.clear();
|
|
348
459
|
});
|
|
349
|
-
function Picker({ sessionId, useSession, useInput }) {
|
|
460
|
+
function Picker({ sessionId, useSession, useInput, useProjection }) {
|
|
350
461
|
const { active } = useLocaleSnapshot(ctx.locale);
|
|
351
|
-
const text = copy
|
|
462
|
+
const text = localizedCopy(copy, active);
|
|
352
463
|
const [controller] = (0, react.useState)(() => new SelectionController(remote, sessionId));
|
|
353
464
|
const state = (0, react.useSyncExternalStore)(controller.subscribe, controller.getSnapshot);
|
|
354
465
|
const unavailable = useSession((s) => s.running || s.removed || s.openState !== "open" || s.pendingSubmissions.length > 0);
|
|
355
466
|
const inputBusy = useInput((input) => input.phase !== "plain");
|
|
467
|
+
const blank = useSession((s) => s.blank && !s.promptAttempted);
|
|
468
|
+
const touched = useProjection("dungsilCheckoutTouched");
|
|
469
|
+
const [preferred, setPreferred] = (0, react.useState)(null);
|
|
470
|
+
(0, react.useEffect)(() => {
|
|
471
|
+
const abort = new AbortController();
|
|
472
|
+
connection.rpc.call("/api", readMethod, {}, abort.signal).then((result) => {
|
|
473
|
+
if (abort.signal.aborted || !result.ok) return;
|
|
474
|
+
const value = result.value?.defaultCheckout;
|
|
475
|
+
if (value === "current" || value === "worktree") setPreferred(value);
|
|
476
|
+
}).catch(() => {});
|
|
477
|
+
return () => abort.abort();
|
|
478
|
+
}, []);
|
|
356
479
|
const [open, setOpen] = (0, react.useState)(false);
|
|
480
|
+
const [list, setList] = (0, react.useState)();
|
|
481
|
+
const [listError, setListError] = (0, react.useState)(false);
|
|
482
|
+
const [page, setPage] = (0, react.useState)(0);
|
|
357
483
|
const status = (0, react.useId)();
|
|
358
484
|
const available = (0, react.useRef)(false);
|
|
359
485
|
const worktree = state.panel?.worktree;
|
|
@@ -375,10 +501,44 @@ function apply(ctx) {
|
|
|
375
501
|
(0, react.useEffect)(() => {
|
|
376
502
|
if (disabled) setOpen(false);
|
|
377
503
|
}, [disabled]);
|
|
504
|
+
(0, react.useEffect)(() => {
|
|
505
|
+
if (touched === void 0) return;
|
|
506
|
+
defaults.apply(sessionId, preferred, state.panel, !disabled && !open, blank && !touched, () => void controller.choose("new"));
|
|
507
|
+
}, [
|
|
508
|
+
sessionId,
|
|
509
|
+
preferred,
|
|
510
|
+
state.panel,
|
|
511
|
+
disabled,
|
|
512
|
+
open,
|
|
513
|
+
blank,
|
|
514
|
+
touched,
|
|
515
|
+
controller
|
|
516
|
+
]);
|
|
517
|
+
(0, react.useEffect)(() => {
|
|
518
|
+
if (!open) return;
|
|
519
|
+
const abort = new AbortController();
|
|
520
|
+
setList(void 0);
|
|
521
|
+
setListError(false);
|
|
522
|
+
setPage(0);
|
|
523
|
+
connection.rpc.call("/api", "dungsil-worktree-picker/list", { sessionId }, abort.signal).then((result) => {
|
|
524
|
+
if (abort.signal.aborted) return;
|
|
525
|
+
if (result.ok) setList(result.value);
|
|
526
|
+
else setListError(true);
|
|
527
|
+
}).catch(() => {
|
|
528
|
+
if (!abort.signal.aborted) setListError(true);
|
|
529
|
+
});
|
|
530
|
+
return () => abort.abort();
|
|
531
|
+
}, [open, sessionId]);
|
|
378
532
|
const choose = (choice) => {
|
|
533
|
+
defaults.mark(sessionId);
|
|
379
534
|
setOpen(false);
|
|
380
|
-
if (available.current)
|
|
535
|
+
if (!available.current) return;
|
|
536
|
+
if (choice === "current" && list && list.current !== list.origin.root) controller.enter(list.origin.directory, connection);
|
|
537
|
+
else controller.choose(choice);
|
|
381
538
|
};
|
|
539
|
+
const selected = list?.worktrees.find((entry) => entry.path === list.current);
|
|
540
|
+
const other = list?.worktrees.filter((entry) => entry.path !== list.current && entry.branch !== null) ?? [];
|
|
541
|
+
const visible = [...selected ? [selected] : [], ...other.slice(page * 5, page * 5 + 5)];
|
|
382
542
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
383
543
|
className: "dsh-forge-worktree",
|
|
384
544
|
children: [
|
|
@@ -401,40 +561,72 @@ function apply(ctx) {
|
|
|
401
561
|
"aria-describedby": status,
|
|
402
562
|
title: worktree && !worktree.editable ? text.locked : `${text.title}: ${label}`,
|
|
403
563
|
onClick: () => {
|
|
404
|
-
if (available.current)
|
|
564
|
+
if (available.current) {
|
|
565
|
+
defaults.mark(sessionId);
|
|
566
|
+
setOpen((value) => !value);
|
|
567
|
+
}
|
|
405
568
|
},
|
|
406
569
|
onKeyDown: (event) => {
|
|
407
570
|
if (available.current && (event.key === "ArrowDown" || event.key === "ArrowUp")) {
|
|
408
571
|
event.preventDefault();
|
|
572
|
+
defaults.mark(sessionId);
|
|
409
573
|
setOpen(true);
|
|
410
574
|
}
|
|
411
575
|
}
|
|
412
576
|
}),
|
|
413
|
-
children: [
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
children:
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
577
|
+
children: [
|
|
578
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.MenuItemButton, {
|
|
579
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconPlusOutlineRegular, {}),
|
|
580
|
+
current: requested,
|
|
581
|
+
disabled: !!worktree?.blocker,
|
|
582
|
+
onSelect: () => choose("new"),
|
|
583
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
584
|
+
className: "dsh-forge-worktree-option",
|
|
585
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: text.create }), requested && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCheckOutlineRegular, {})]
|
|
586
|
+
})
|
|
587
|
+
}),
|
|
588
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.MenuItemButton, {
|
|
589
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconBranchOutlineRegular, {}),
|
|
590
|
+
current: !requested && (!list || list.current === list.origin.root),
|
|
591
|
+
onSelect: () => choose("current"),
|
|
592
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
593
|
+
className: "dsh-forge-worktree-option",
|
|
594
|
+
children: [
|
|
595
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: list ? list.origin.branch ?? text.detached : branch }),
|
|
596
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
597
|
+
className: "dsh-forge-worktree-badge",
|
|
598
|
+
children: text.current
|
|
599
|
+
}),
|
|
600
|
+
!requested && (!list || list.current === list.origin.root) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCheckOutlineRegular, {})
|
|
601
|
+
]
|
|
602
|
+
})
|
|
603
|
+
}),
|
|
604
|
+
visible.map((entry) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.MenuItemButton, {
|
|
605
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconBranchOutlineRegular, {}),
|
|
606
|
+
current: !requested && entry.path === list?.current,
|
|
607
|
+
onSelect: () => {
|
|
608
|
+
setOpen(false);
|
|
609
|
+
if (available.current && (requested || entry.path !== list?.current)) controller.enter(entry.path, connection);
|
|
610
|
+
},
|
|
611
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
612
|
+
className: "dsh-forge-worktree-option",
|
|
613
|
+
title: entry.path,
|
|
614
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: entry.branch ?? text.detached }), !requested && entry.path === list?.current && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCheckOutlineRegular, {})]
|
|
615
|
+
})
|
|
616
|
+
}, entry.path)),
|
|
617
|
+
page > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.MenuItemButton, {
|
|
618
|
+
onSelect: () => setPage(page - 1),
|
|
619
|
+
children: text.previous
|
|
620
|
+
}),
|
|
621
|
+
(page + 1) * 5 < other.length && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.MenuItemButton, {
|
|
622
|
+
onSelect: () => setPage(page + 1),
|
|
623
|
+
children: text.more
|
|
624
|
+
}),
|
|
625
|
+
listError && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
626
|
+
role: "status",
|
|
627
|
+
children: text.listError
|
|
436
628
|
})
|
|
437
|
-
|
|
629
|
+
]
|
|
438
630
|
}),
|
|
439
631
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
440
632
|
id: status,
|