finch-git-branch 0.3.2 → 0.3.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/dist/scm-panel.js CHANGED
@@ -185,12 +185,12 @@ export function activateScmPanel(ctx) {
185
185
  // Also push config immediately: an already-live Webview may not emit finch:env again
186
186
  // after the mini tool backend is reloaded.
187
187
  void sendConfig().catch(() => undefined);
188
- const setScope = async (message, useCurrentWorkspace = false) => {
189
- const webviewCwd = typeof message.cwd === 'string' ? message.cwd : '';
190
- // Session switches can retain a live Webview without replaying finch:env.
191
- // The backend workspace follows the active session and is authoritative for heartbeat refreshes.
192
- const activeCwd = ctx.workspace.directoryPath ?? ctx.workspace.projectPath ?? '';
193
- const nextCwd = useCurrentWorkspace && activeCwd ? activeCwd : webviewCwd;
188
+ const setScope = async (message) => {
189
+ // A Panel belongs to the Session that opened it. Its bridged finch:env cwd
190
+ // remains the only reliable scope after switching other Spaces/Sessions;
191
+ // ctx.workspace describes the globally active workspace and can belong to
192
+ // a different Session by the time this callback runs.
193
+ const nextCwd = typeof message.cwd === 'string' ? message.cwd : '';
194
194
  const nextScopeKey = typeof message.scopeKey === 'string' ? message.scopeKey : (scopeKey || nextCwd);
195
195
  if (nextScopeKey === scopeKey && nextCwd === cwd)
196
196
  return false;
@@ -268,12 +268,12 @@ export function activateScmPanel(ctx) {
268
268
  return;
269
269
  }
270
270
  if (message.type === 'refresh') {
271
- await setScope(message, true);
271
+ await setScope(message);
272
272
  await refresh(message.silent !== true);
273
273
  return;
274
274
  }
275
275
  if (message.type === 'syncWorkspace') {
276
- const changed = await setScope(message, true);
276
+ const changed = await setScope(message);
277
277
  await sendConfig();
278
278
  if (changed || repos.length === 0)
279
279
  await refresh();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "finch-git-branch",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "Git Source Control for Finch Composer toolbar.",
5
5
  "author": {
6
6
  "name": "Finch Team",