dsh-ide-git 0.5.2 → 0.5.3
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/dsh.plugin.json +1 -1
- package/package.json +1 -1
- package/src/client.js +47 -29
package/dsh.plugin.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "dsh-external/dsh-ide-git",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3",
|
|
4
4
|
"main": "./src/index.js",
|
|
5
5
|
"description": "IDE 级 Git 操作面板:分支树 + 提交图谱 + 变更/暂存/提交 + 提交详情。装了 dsh-better-sidebar 时挂成它的原生 tab(右侧栏 + 底部工作台);没装时直接挂 DSH 原生右侧栏,单独安装即可用。JetBrains 风格 Git 工具窗口 for DeepSeek Harness.",
|
|
6
6
|
"engines": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-ide-git",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3",
|
|
4
4
|
"description": "DSH plugin: an IDE-grade Git tool window as a native dsh-better-sidebar tab — branch tree, commit graph, changes, commit details, JetBrains-style actions, in the right sidebar and the bottom panel. | DSH 插件:IDE 级 Git 工具窗口,以 dsh-better-sidebar 原生 Tab 挂载——分支树 / 提交图谱 / 变更与提交详情 / JetBrains 风格操作,右侧栏与底部面板双布局自适应。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
package/src/client.js
CHANGED
|
@@ -5565,45 +5565,63 @@ window.__ModuleLoader__.load({
|
|
|
5565
5565
|
right-sidebar seats are the fallback for a host running this plugin on
|
|
5566
5566
|
its own — registering both would draw the same panel twice in one
|
|
5567
5567
|
column, so a late-arriving better-sidebar takes the native one down. */
|
|
5568
|
-
let
|
|
5568
|
+
let nativeFiber = null
|
|
5569
5569
|
let hostedByBetterSidebar = false
|
|
5570
5570
|
|
|
5571
|
+
/* WAIT for both native seats instead of probing with ctx.get(): on a
|
|
5572
|
+
host without better-sidebar this apply can run BEFORE ui-sidebar-right
|
|
5573
|
+
provides the registry, and the old synchronous probe returned
|
|
5574
|
+
silently — the native seats were then never registered (reproduced
|
|
5575
|
+
on a clean instance and on the desktop app: the right sidebar showed
|
|
5576
|
+
no Git card and the console stayed empty). ctx.inject() retries the
|
|
5577
|
+
registration the moment the services appear. */
|
|
5571
5578
|
const hostNatively = () => {
|
|
5572
|
-
if (
|
|
5573
|
-
|
|
5574
|
-
|
|
5575
|
-
|
|
5576
|
-
|
|
5577
|
-
|
|
5578
|
-
|
|
5579
|
-
|
|
5580
|
-
|
|
5581
|
-
|
|
5582
|
-
|
|
5583
|
-
|
|
5584
|
-
|
|
5585
|
-
|
|
5586
|
-
|
|
5587
|
-
|
|
5588
|
-
|
|
5589
|
-
|
|
5590
|
-
|
|
5579
|
+
if (nativeFiber !== null) return
|
|
5580
|
+
nativeFiber = ctx.inject(['sidebarRightTabs', 'slots'], (nativeCtx) => {
|
|
5581
|
+
const tabs = nativeCtx.get('sidebarRightTabs')
|
|
5582
|
+
const slots = nativeCtx.get('slots')
|
|
5583
|
+
if (tabs === undefined || typeof tabs.register !== 'function') return
|
|
5584
|
+
if (slots === undefined || typeof slots.inject !== 'function') return
|
|
5585
|
+
nativeCtx.effect(() => {
|
|
5586
|
+
const offType = tabs.register({
|
|
5587
|
+
id: NATIVE_ID,
|
|
5588
|
+
kind: NATIVE_KIND,
|
|
5589
|
+
title: () => t('title'),
|
|
5590
|
+
guide: [{
|
|
5591
|
+
id: 'git',
|
|
5592
|
+
order: 21,
|
|
5593
|
+
title: () => t('title'),
|
|
5594
|
+
description: () => t('description'),
|
|
5595
|
+
icon: (iconProps) => E(Icon, {
|
|
5596
|
+
name: 'commit',
|
|
5597
|
+
size: iconProps === undefined || iconProps.size === undefined ? 16 : iconProps.size,
|
|
5598
|
+
}),
|
|
5599
|
+
}],
|
|
5600
|
+
})
|
|
5601
|
+
const offBody = slots.inject('sidebar.right.pane.tab', () => slots.register(
|
|
5602
|
+
{ name: 'sidebar.right.pane.tab', key: NATIVE_ID },
|
|
5603
|
+
(tabProps) => E(NativePanel, Object.assign({}, tabProps, { t: t, ctx: ctx })),
|
|
5604
|
+
))
|
|
5605
|
+
return () => {
|
|
5606
|
+
try { offBody() } catch (error) { void error }
|
|
5607
|
+
try { offType() } catch (error) { void error }
|
|
5608
|
+
}
|
|
5609
|
+
}, 'dsh-ide-git: native right-sidebar seats')
|
|
5591
5610
|
})
|
|
5592
|
-
|
|
5593
|
-
|
|
5594
|
-
|
|
5595
|
-
)
|
|
5596
|
-
|
|
5597
|
-
|
|
5598
|
-
|
|
5599
|
-
}
|
|
5611
|
+
}
|
|
5612
|
+
|
|
5613
|
+
const takeNativeDown = () => {
|
|
5614
|
+
if (nativeFiber === null) return
|
|
5615
|
+
const fiber = nativeFiber
|
|
5616
|
+
nativeFiber = null
|
|
5617
|
+
void Promise.resolve(fiber.dispose()).catch((error) => { void error })
|
|
5600
5618
|
}
|
|
5601
5619
|
|
|
5602
5620
|
ctx.inject(['betterSidebar'], (tabCtx) => {
|
|
5603
5621
|
const betterSidebar = tabCtx.get('betterSidebar')
|
|
5604
5622
|
if (betterSidebar === undefined || typeof betterSidebar.registerTab !== 'function') return
|
|
5605
5623
|
hostedByBetterSidebar = true
|
|
5606
|
-
|
|
5624
|
+
takeNativeDown()
|
|
5607
5625
|
tabCtx.effect(() => {
|
|
5608
5626
|
const offTab = betterSidebar.registerTab({
|
|
5609
5627
|
id: TAB_ID,
|