@lvce-editor/main-area-worker 9.0.0 → 9.1.0

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.
@@ -2240,9 +2240,10 @@ const selectTab = async (state, groupIndex, index) => {
2240
2240
  const tab = group.tabs[index];
2241
2241
  const groupId = group.id;
2242
2242
  const tabId = tab.id;
2243
+ const isAlreadyActive = layout.activeGroupId === groupId && group.activeTabId === tabId;
2243
2244
 
2244
- // Return same state if this group and tab are already active
2245
- if (layout.activeGroupId === groupId && group.activeTabId === tabId) {
2245
+ // Allow restored tabs without a live editor to recover even if they are already selected.
2246
+ if (isAlreadyActive && !shouldLoadContentForTab(tab)) {
2246
2247
  return state;
2247
2248
  }
2248
2249
 
@@ -2484,6 +2485,14 @@ const getBasename$1 = uri => {
2484
2485
  }
2485
2486
  return uri.slice(lastSlashIndex + 1);
2486
2487
  };
2488
+ const inlineDiffPrefix = 'inline-diff://';
2489
+ const diffSeparator = '<->';
2490
+ const getInlineDiffLabel = uri => {
2491
+ const content = uri.slice(inlineDiffPrefix.length);
2492
+ const separatorIndex = content.indexOf(diffSeparator);
2493
+ const workingTreeUri = separatorIndex === -1 ? content : content.slice(separatorIndex + diffSeparator.length);
2494
+ return `${getBasename$1(workingTreeUri)} (Working Tree)`;
2495
+ };
2487
2496
  const getLabel = uri => {
2488
2497
  if (uri.startsWith('settings://')) {
2489
2498
  return 'Settings';
@@ -2497,6 +2506,9 @@ const getLabel = uri => {
2497
2506
  if (uri.startsWith('language-models://')) {
2498
2507
  return 'Language Models';
2499
2508
  }
2509
+ if (uri.startsWith(inlineDiffPrefix)) {
2510
+ return getInlineDiffLabel(uri);
2511
+ }
2500
2512
  return getBasename$1(uri);
2501
2513
  };
2502
2514
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/main-area-worker",
3
- "version": "9.0.0",
3
+ "version": "9.1.0",
4
4
  "description": "Main Area Worker",
5
5
  "repository": {
6
6
  "type": "git",