dsh-ide-git 0.5.1 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "id": "dsh-external/dsh-ide-git",
3
- "version": "0.5.1",
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.1",
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,59 +5565,90 @@ 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 disposeNative = null
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 (disposeNative !== null) return
5573
- const tabs = ctx.get('sidebarRightTabs')
5574
- const slots = ctx.get('slots')
5575
- if (tabs === undefined || typeof tabs.register !== 'function') return
5576
- if (slots === undefined || typeof slots.inject !== 'function') return
5577
- const offType = tabs.register({
5578
- id: NATIVE_ID,
5579
- kind: NATIVE_KIND,
5580
- title: () => t('title'),
5581
- guide: [{
5582
- id: 'git',
5583
- order: 21,
5584
- title: () => t('title'),
5585
- description: () => t('description'),
5586
- icon: (iconProps) => E(Icon, {
5587
- name: 'commit',
5588
- size: iconProps === undefined || iconProps.size === undefined ? 16 : iconProps.size,
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
- const offBody = slots.inject('sidebar.right.pane.tab', () => slots.register(
5593
- { name: 'sidebar.right.pane.tab', key: NATIVE_ID },
5594
- (tabProps) => E(NativePanel, Object.assign({}, tabProps, { t: t, ctx: ctx })),
5595
- ))
5596
- disposeNative = () => {
5597
- try { offBody() } catch (error) { void error }
5598
- try { offType() } catch (error) { void error }
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
- if (disposeNative !== null) { disposeNative(); disposeNative = null }
5607
- tabCtx.effect(() => betterSidebar.registerTab({
5608
- id: TAB_ID,
5609
- title: () => t('title'),
5610
- description: () => t('description'),
5611
- icon: (size) => E(Icon, { name: 'commit', size: size === undefined ? 16 : size }),
5612
- order: 21,
5613
- single: true,
5614
- component: (tabProps) => E(LocaleLive, {
5615
- ctx: ctx,
5616
- scope: tabProps.scope,
5617
- t: t,
5618
- visible: tabProps.visible,
5619
- }),
5620
- }), 'dsh-ide-git: Git tab')
5624
+ takeNativeDown()
5625
+ tabCtx.effect(() => {
5626
+ const offTab = betterSidebar.registerTab({
5627
+ id: TAB_ID,
5628
+ title: () => t('title'),
5629
+ description: () => t('description'),
5630
+ icon: (size) => E(Icon, { name: 'commit', size: size === undefined ? 16 : size }),
5631
+ order: 21,
5632
+ single: true,
5633
+ component: (tabProps) => E(LocaleLive, {
5634
+ ctx: ctx,
5635
+ scope: tabProps.scope,
5636
+ t: t,
5637
+ visible: tabProps.visible,
5638
+ }),
5639
+ })
5640
+ /* The base can go away at RUNTIME (disabled in the plugin panel, or
5641
+ uninstalled): cordis unloads this effect when the service
5642
+ disappears, and the panel must fall back to the native
5643
+ right-sidebar seats instead of vanishing with the base. The
5644
+ same inject re-fires when the service returns, and the
5645
+ callback above takes the native seats down again. */
5646
+ return () => {
5647
+ try { offTab() } catch (error) { void error }
5648
+ hostedByBetterSidebar = false
5649
+ hostNatively()
5650
+ }
5651
+ }, 'dsh-ide-git: Git tab')
5621
5652
  })
5622
5653
 
5623
5654
  /* ctx.inject runs its callback straight away when the service is already