finch-git-branch 0.3.2 → 0.3.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/README.md +1 -1
- package/README.zh-CN.md +1 -1
- package/dist/scm-panel.js +12 -9
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -32,7 +32,7 @@ The first version intentionally leaves out force-push, rebase, reset, cherry-pic
|
|
|
32
32
|
|
|
33
33
|
## Permissions
|
|
34
34
|
|
|
35
|
-
This tool needs shell permission
|
|
35
|
+
This tool needs shell permission to run local `git` commands and read-only filesystem permission to inspect repository metadata and changed files. No network access needed.
|
|
36
36
|
|
|
37
37
|
## Development
|
|
38
38
|
|
package/README.zh-CN.md
CHANGED
package/dist/scm-panel.js
CHANGED
|
@@ -154,7 +154,10 @@ export function activateScmPanel(ctx) {
|
|
|
154
154
|
let generation = 0;
|
|
155
155
|
let repos = [];
|
|
156
156
|
let unavailable = false;
|
|
157
|
-
|
|
157
|
+
// A panel can receive its initial bridge message before `visible` flips to
|
|
158
|
+
// true. Treat the live handle as available so that init is never dropped;
|
|
159
|
+
// visibility still triggers an explicit refresh below.
|
|
160
|
+
const active = () => !unavailable;
|
|
158
161
|
const post = async (message) => {
|
|
159
162
|
if (!active())
|
|
160
163
|
return false;
|
|
@@ -185,12 +188,12 @@ export function activateScmPanel(ctx) {
|
|
|
185
188
|
// Also push config immediately: an already-live Webview may not emit finch:env again
|
|
186
189
|
// after the mini tool backend is reloaded.
|
|
187
190
|
void sendConfig().catch(() => undefined);
|
|
188
|
-
const setScope = async (message
|
|
189
|
-
|
|
190
|
-
//
|
|
191
|
-
//
|
|
192
|
-
|
|
193
|
-
const nextCwd =
|
|
191
|
+
const setScope = async (message) => {
|
|
192
|
+
// A Panel belongs to the Session that opened it. Its bridged finch:env cwd
|
|
193
|
+
// remains the only reliable scope after switching other Spaces/Sessions;
|
|
194
|
+
// ctx.workspace describes the globally active workspace and can belong to
|
|
195
|
+
// a different Session by the time this callback runs.
|
|
196
|
+
const nextCwd = typeof message.cwd === 'string' ? message.cwd : '';
|
|
194
197
|
const nextScopeKey = typeof message.scopeKey === 'string' ? message.scopeKey : (scopeKey || nextCwd);
|
|
195
198
|
if (nextScopeKey === scopeKey && nextCwd === cwd)
|
|
196
199
|
return false;
|
|
@@ -268,12 +271,12 @@ export function activateScmPanel(ctx) {
|
|
|
268
271
|
return;
|
|
269
272
|
}
|
|
270
273
|
if (message.type === 'refresh') {
|
|
271
|
-
await setScope(message
|
|
274
|
+
await setScope(message);
|
|
272
275
|
await refresh(message.silent !== true);
|
|
273
276
|
return;
|
|
274
277
|
}
|
|
275
278
|
if (message.type === 'syncWorkspace') {
|
|
276
|
-
const changed = await setScope(message
|
|
279
|
+
const changed = await setScope(message);
|
|
277
280
|
await sendConfig();
|
|
278
281
|
if (changed || repos.length === 0)
|
|
279
282
|
await refresh();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "finch-git-branch",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
4
4
|
"description": "Git Source Control for Finch Composer toolbar.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Finch Team",
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"skills": false
|
|
99
99
|
},
|
|
100
100
|
"permissions": {
|
|
101
|
-
"filesystem": "
|
|
101
|
+
"filesystem": "read",
|
|
102
102
|
"network": false,
|
|
103
103
|
"shell": true
|
|
104
104
|
}
|