@dsh-xhl/dsh-git-gui 0.1.5 → 0.1.6
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/lib/client.js +20 -2
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -1450,6 +1450,7 @@ function HeaderButton(props) {
|
|
|
1450
1450
|
*/
|
|
1451
1451
|
function HeroGitButton() {
|
|
1452
1452
|
const [pos, setPos] = React.useState(null)
|
|
1453
|
+
const selfRef = React.useRef(null)
|
|
1453
1454
|
|
|
1454
1455
|
React.useEffect(() => {
|
|
1455
1456
|
const update = () => {
|
|
@@ -1468,7 +1469,19 @@ function HeroGitButton() {
|
|
|
1468
1469
|
// title row (→ 14px top), so the floating icon sits exactly where the
|
|
1469
1470
|
// in-chat icon does.
|
|
1470
1471
|
const top = rect.top + 14
|
|
1471
|
-
|
|
1472
|
+
// If other plugins also pin a hero FAB to this corner (e.g. the
|
|
1473
|
+
// file-editor's filex-hero-fab), stack ours to the LEFT of them so the
|
|
1474
|
+
// two entries sit side by side instead of overlapping. Only elements
|
|
1475
|
+
// already in the DOM count; our own fab (data-gg-hero-fab) is skipped.
|
|
1476
|
+
let extra = 0
|
|
1477
|
+
const fabNodes = document.querySelectorAll('[class*="hero-fab"]')
|
|
1478
|
+
for (const node of fabNodes) {
|
|
1479
|
+
if (node === selfRef.current) continue
|
|
1480
|
+
if (node.getAttribute('data-gg-hero-fab') !== null) continue
|
|
1481
|
+
const w = node.offsetWidth
|
|
1482
|
+
if (w > 0) extra += w + 8
|
|
1483
|
+
}
|
|
1484
|
+
const right = window.innerWidth - rect.right + 28 + extra
|
|
1472
1485
|
setPos((current) => current !== null && current.top === top && current.right === right ? current : { top, right })
|
|
1473
1486
|
}
|
|
1474
1487
|
const timer = window.setInterval(update, 400)
|
|
@@ -1481,7 +1494,12 @@ function HeroGitButton() {
|
|
|
1481
1494
|
}, [])
|
|
1482
1495
|
|
|
1483
1496
|
if (pos === null) return null
|
|
1484
|
-
return h('div', {
|
|
1497
|
+
return h('div', {
|
|
1498
|
+
ref: selfRef,
|
|
1499
|
+
'data-gg-hero-fab': '',
|
|
1500
|
+
className: 'gg-hero-fab',
|
|
1501
|
+
style: { top: `${pos.top}px`, right: `${pos.right}px` },
|
|
1502
|
+
}, h(GitButton))
|
|
1485
1503
|
}
|
|
1486
1504
|
|
|
1487
1505
|
module.exports = { HeaderButton, HeroGitButton, GitButton }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dsh-xhl/dsh-git-gui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "Git GUI panel for the DeepSeek Harness web surface: visualize working-tree changes (including every modification the agent makes), stage/commit/branch/merge/log/pull/push/stash/revert — all from the browser.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|