dsh-git-badge 0.5.3 → 0.5.5
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 +28 -4
- package/package.json +2 -2
package/lib/client.js
CHANGED
|
@@ -110,6 +110,28 @@ window.__ModuleLoader__.load({
|
|
|
110
110
|
return info;
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
+
/**
|
|
114
|
+
* Three-state dot color, shared by the sidebar row badge and the
|
|
115
|
+
* composer chip. Checked top-down, first match wins:
|
|
116
|
+
* - RED: unmerged files (mid-conflict, git is blocked) — or a dirty
|
|
117
|
+
* tree that is ALSO behind upstream (unsaved edits on an outdated
|
|
118
|
+
* base: commit-then-pull friction ahead).
|
|
119
|
+
* - YELLOW: dirty files, or any ahead/behind (routine work or sync
|
|
120
|
+
* pending — including the previously "quiet" green-but-↓1 case).
|
|
121
|
+
* - GREEN: clean and in sync.
|
|
122
|
+
* Red never means merely "behind": a clean tree one commit behind is
|
|
123
|
+
* normal between pulls, not an alarm.
|
|
124
|
+
*/
|
|
125
|
+
function badgeDot(info) {
|
|
126
|
+
const dirty = info.dirty === true;
|
|
127
|
+
const behind = (info.behind || 0) > 0;
|
|
128
|
+
const ahead = (info.ahead || 0) > 0;
|
|
129
|
+
const conflict = (info.unmergedFiles || 0) > 0;
|
|
130
|
+
if (conflict || (dirty && behind)) return "\uD83D\uDD34";
|
|
131
|
+
if (dirty || ahead || behind) return "\uD83D\uDFE1";
|
|
132
|
+
return "\uD83D\uDFE2";
|
|
133
|
+
}
|
|
134
|
+
|
|
113
135
|
/**
|
|
114
136
|
* Sync/dirty suffix — INPUT CHIP ONLY. The sidebar row badge shows
|
|
115
137
|
* status + branch alone; the chip is the detailed surface. Rule set:
|
|
@@ -141,9 +163,11 @@ window.__ModuleLoader__.load({
|
|
|
141
163
|
};
|
|
142
164
|
|
|
143
165
|
/**
|
|
144
|
-
* Row badge —
|
|
145
|
-
* input chip):
|
|
166
|
+
* Row badge — three-state dot + branch (sync/dirty detail lives on
|
|
167
|
+
* the input chip):
|
|
146
168
|
* the_paragliding_app | 🟢 main
|
|
169
|
+
* Dot color via badgeDot(): green clean+synced, yellow dirty or
|
|
170
|
+
* out-of-sync, red conflict or dirty-and-behind.
|
|
147
171
|
* Always renders the workspace name (so the row keeps its identity);
|
|
148
172
|
* appends the muted `| emoji branch` part only for git workspaces.
|
|
149
173
|
*/
|
|
@@ -153,7 +177,7 @@ window.__ModuleLoader__.load({
|
|
|
153
177
|
if (cwd !== void 0 && info !== void 0 && info.git === true) {
|
|
154
178
|
children.push(
|
|
155
179
|
react_jsx_runtime.jsx("span", { style: { ...META_STYLE, margin: "0 7px" }, children: "|" }),
|
|
156
|
-
react_jsx_runtime.jsx("span", { style: { ...META_STYLE, marginRight: "4px" }, children: info
|
|
180
|
+
react_jsx_runtime.jsx("span", { style: { ...META_STYLE, marginRight: "4px" }, children: badgeDot(info) }),
|
|
157
181
|
react_jsx_runtime.jsx("span", { style: META_STYLE, children: info.branch })
|
|
158
182
|
);
|
|
159
183
|
}
|
|
@@ -198,7 +222,7 @@ window.__ModuleLoader__.load({
|
|
|
198
222
|
const cwd = useSessionWorkspaceCwd(sessionId);
|
|
199
223
|
const info = useGitStatus(cwd, true);
|
|
200
224
|
if (cwd === void 0 || info === void 0 || info.git !== true) return null;
|
|
201
|
-
const text = (info
|
|
225
|
+
const text = badgeDot(info) + " " + info.branch + formatGitSuffix(info);
|
|
202
226
|
return react_jsx_runtime.jsx("span", {
|
|
203
227
|
style: {
|
|
204
228
|
display: "inline-flex",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-git-badge",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.5",
|
|
4
4
|
"description": "Git status badges for DeepSeek Harness: sidebar workspace rows (via the sidebar.workspaces.row seam) and an input-row chip showing the current conversation's workspace git state. Event-driven freshness over SSE.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"repository": {
|
|
35
35
|
"type": "git",
|
|
36
36
|
"url": "git+https://github.com/Kevin-McIsaac/dsh-workspace-git-badge.git",
|
|
37
|
-
"directory": "
|
|
37
|
+
"directory": "dsh-git-badge"
|
|
38
38
|
},
|
|
39
39
|
"engines": {
|
|
40
40
|
"node": ">=20"
|