@goodandready/dsh-time-machine 0.1.10 → 0.1.12
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 +8 -0
- package/README.ru.md +8 -0
- package/README.zh.md +8 -0
- package/lib/client.js +103 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -119,6 +119,14 @@ dsh-time-machine:
|
|
|
119
119
|
|
|
120
120
|
## 📋 Release Notes
|
|
121
121
|
|
|
122
|
+
### v0.1.12 — Fix Oversized Clock Icon in Native Sidebar Guide
|
|
123
|
+
* **Fixed in v0.1.12**: Replaced function-based icon with dedicated `TimeMachineIcon` component supporting both props object `{ size, className }` and numeric argument, with explicit inline sizing (`width`, `height`, `display: inline-block`, `flex: none`) to prevent overflow in the Right Sidebar Guide card.
|
|
124
|
+
|
|
125
|
+
### v0.1.11 — Dual Sidebar Support: Native DSH Right Sidebar & BetterSidebar
|
|
126
|
+
* **Added in v0.1.11**: Support for native DSH Right Sidebar (`sidebarRightTabs` + `sidebar.right.pane.tab`) introduced in DSH 0.1.5-alpha.1, including guide page registration with custom icon.
|
|
127
|
+
* **Preserved in v0.1.11**: Legacy `betterSidebar` integration retained with deterministic surface-scoped registrations, preventing ID collisions or duplicate mounts when both surfaces exist.
|
|
128
|
+
* **Added in v0.1.11**: Graceful degradation to plugin settings card when neither sidebar surface is available.
|
|
129
|
+
|
|
122
130
|
### v0.1.10 — Stability, Dynamic CWD, Unified Diff & Architecture Polish
|
|
123
131
|
* **Added in v0.1.10**: Dynamic / session-aware `cwd` resolution: TimeMachine tools and REST endpoints automatically locate the active session workspace or accept explicit target directory.
|
|
124
132
|
* **Added in v0.1.10**: Unified diff support (`format: "patch" | "stat"`) with size limits (up to 256KB) and clean truncation warnings.
|
package/README.ru.md
CHANGED
|
@@ -119,6 +119,14 @@ dsh-time-machine:
|
|
|
119
119
|
|
|
120
120
|
## 📋 История версий (Release Notes)
|
|
121
121
|
|
|
122
|
+
### v0.1.12 — Исправление размера иконки часов на странице Guide нативного сайдбара
|
|
123
|
+
* **Fixed in v0.1.12**: Заменена стрелочная функция иконки на полноценный React-компонент `TimeMachineIcon`, корректно обрабатывающий как объект props `{ size, className }`, так и числовой аргумент; добавлены явные inline-стили (`width`, `height`, `flex: none`), устраняющие растягивание иконки часов на карточке Guide.
|
|
124
|
+
|
|
125
|
+
### v0.1.11 — Поддержка нативного DSH Right Sidebar и legacy BetterSidebar
|
|
126
|
+
* **Added in v0.1.11**: Поддержка нативной правой панели DSH (`sidebarRightTabs` + слот `sidebar.right.pane.tab`), появившейся в DSH 0.1.5-alpha.1, включая регистрацию на странице Guide с иконкой.
|
|
127
|
+
* **Preserved in v0.1.11**: Полная обратная совместимость с `betterSidebar`; раздельные идентификаторы поверхностей исключают конфликты или двойное монтирование при совместном включении.
|
|
128
|
+
* **Added in v0.1.11**: Безопасный откат к карточке настроек плагина при отсутствии обеих боковых панелей в хосте.
|
|
129
|
+
|
|
122
130
|
### v0.1.10 — Стабильность, динамический CWD, Unified Diff и оптимизация архитектуры
|
|
123
131
|
* **Added in v0.1.10**: Динамическое определение рабочей директории (`cwd`): инструменты и REST API автоматически определяют каталог активной сессии либо принимают явный путь.
|
|
124
132
|
* **Added in v0.1.10**: Поддержка Unified Diff (`format: "patch" | "stat"`) с лимитом размера (до 256 КБ) и защитой от переполнения контекста.
|
package/README.zh.md
CHANGED
|
@@ -94,6 +94,14 @@ dsh-time-machine:
|
|
|
94
94
|
|
|
95
95
|
## 📋 版本更新记录 (Release Notes)
|
|
96
96
|
|
|
97
|
+
### v0.1.12 — 修复原生侧边栏引导页中时钟图标过大的问题
|
|
98
|
+
* **Fixed in v0.1.12**: 将图标函数重构为标准 React 组件 `TimeMachineIcon`,兼容 `{ size, className }` 属性对象与数字传参,增加内联样式限制(`width`, `height`, `flex: none`),彻底解决右侧边栏 Guide 卡片中图标溢出的缺陷。
|
|
99
|
+
|
|
100
|
+
### v0.1.11 — 双侧边栏支持:原生 DSH 右侧边栏与 BetterSidebar
|
|
101
|
+
* **Added in v0.1.11**: 原生支持 DSH 0.1.5-alpha.1 引入的右侧边栏(`sidebarRightTabs` 注册与 `sidebar.right.pane.tab` 插槽),包含专属引导页卡片与图标。
|
|
102
|
+
* **Preserved in v0.1.11**: 保持对旧版 `betterSidebar` 的完全向后兼容;两种表面同时启用时互不干扰,杜绝重复挂载或 ID 冲突。
|
|
103
|
+
* **Added in v0.1.11**: 在两种侧边栏均缺失的环境下,安全降级至插件设置卡片。
|
|
104
|
+
|
|
97
105
|
### v0.1.10 — 稳定性、动态工作目录、统一 Diff 与架构优化
|
|
98
106
|
* **Added in v0.1.10**: 动态工作区感知(`cwd`):时光机工具与 REST 接口自动关联当前会话目录或支持显式工作区路径。
|
|
99
107
|
* **Added in v0.1.10**: 统一补丁支持(`format: "patch" | "stat"`),带输出截断保护(最大 256KB)。
|
package/lib/client.js
CHANGED
|
@@ -65,6 +65,8 @@ window.__ModuleLoader__.load({
|
|
|
65
65
|
unavailable: 'Settings unavailable',
|
|
66
66
|
tabTitle: 'Time Machine',
|
|
67
67
|
sidebarNotice: 'Checkpoints and timeline are available in the Time Machine sidebar tab.',
|
|
68
|
+
guideTitle: 'Time Machine',
|
|
69
|
+
guideDesc: 'Checkpoints, visual diffs and instant workspace rollback.',
|
|
68
70
|
};
|
|
69
71
|
const ru = {
|
|
70
72
|
title: 'Машина времени и чекпоинты',
|
|
@@ -88,6 +90,8 @@ window.__ModuleLoader__.load({
|
|
|
88
90
|
unavailable: 'Настройки недоступны',
|
|
89
91
|
tabTitle: 'Машина времени',
|
|
90
92
|
sidebarNotice: 'Лента чекпоинтов и управление снимками доступны во вкладке «Машина времени» боковой панели.',
|
|
93
|
+
guideTitle: 'Машина времени',
|
|
94
|
+
guideDesc: 'Чекпоинты, просмотр diff и мгновенный откат рабочего пространства.',
|
|
91
95
|
};
|
|
92
96
|
const zh = {
|
|
93
97
|
title: '时光机与检查点',
|
|
@@ -111,6 +115,8 @@ window.__ModuleLoader__.load({
|
|
|
111
115
|
unavailable: '设置不可用',
|
|
112
116
|
tabTitle: '时光机',
|
|
113
117
|
sidebarNotice: '检查点时间线与管理可在侧边栏“时光机”标签页中查看。',
|
|
118
|
+
guideTitle: '时光机',
|
|
119
|
+
guideDesc: '快照检查点、差异对比与即时工作区回滚。',
|
|
114
120
|
};
|
|
115
121
|
|
|
116
122
|
let ChevronIcon = null;
|
|
@@ -124,6 +130,26 @@ window.__ModuleLoader__.load({
|
|
|
124
130
|
}
|
|
125
131
|
const Chevron = ChevronIcon || FallbackChevron;
|
|
126
132
|
|
|
133
|
+
|
|
134
|
+
function TimeMachineIcon(props) {
|
|
135
|
+
const s = typeof props === "number" ? props : (props && props.size) || 16;
|
|
136
|
+
const cls = (props && props.className) || "";
|
|
137
|
+
return React.createElement("svg", {
|
|
138
|
+
width: s,
|
|
139
|
+
height: s,
|
|
140
|
+
viewBox: "0 0 24 24",
|
|
141
|
+
fill: "none",
|
|
142
|
+
stroke: "currentColor",
|
|
143
|
+
strokeWidth: "2",
|
|
144
|
+
strokeLinecap: "round",
|
|
145
|
+
strokeLinejoin: "round",
|
|
146
|
+
className: cls,
|
|
147
|
+
style: { width: s, height: s, display: "inline-block", flex: "none" }
|
|
148
|
+
},
|
|
149
|
+
React.createElement("circle", { cx: 12, cy: 12, r: 10 }),
|
|
150
|
+
React.createElement("polyline", { points: "12 6 12 12 16 14" })
|
|
151
|
+
);
|
|
152
|
+
}
|
|
127
153
|
function useLocale(ctx) {
|
|
128
154
|
if (!ctx || !ctx.locale) return 'en';
|
|
129
155
|
const lang = React.useSyncExternalStore(
|
|
@@ -393,10 +419,7 @@ window.__ModuleLoader__.load({
|
|
|
393
419
|
},
|
|
394
420
|
order: 30,
|
|
395
421
|
single: true,
|
|
396
|
-
icon:
|
|
397
|
-
React.createElement('circle', { cx:12, cy:12, r:10 }),
|
|
398
|
-
React.createElement('polyline', { points:'12 6 12 12 16 14' })
|
|
399
|
-
),
|
|
422
|
+
icon: TimeMachineIcon,
|
|
400
423
|
component: (p) => React.createElement(TimeMachineTab, { ctx, ...p })
|
|
401
424
|
});
|
|
402
425
|
tabRegistered = true;
|
|
@@ -418,6 +441,82 @@ window.__ModuleLoader__.load({
|
|
|
418
441
|
}
|
|
419
442
|
}
|
|
420
443
|
}
|
|
444
|
+
|
|
445
|
+
// Native DSH Right Sidebar (DSH >= 0.1.5-alpha.1)
|
|
446
|
+
let nativeTabRegistered = false;
|
|
447
|
+
const doRegisterNativeSidebar = (nctx) => {
|
|
448
|
+
if (nativeTabRegistered) return;
|
|
449
|
+
const reg = (nctx && nctx.sidebarRightTabs) || (nctx && nctx.get && (()=>{ try{return nctx.get('sidebarRightTabs')}catch{return null}})()) || ctx.sidebarRightTabs;
|
|
450
|
+
if (!reg || typeof reg.register !== 'function') return;
|
|
451
|
+
try {
|
|
452
|
+
const tNative = (ctx.locale && ctx.locale.bind) ? ctx.locale.bind(NS) : (k) => k;
|
|
453
|
+
const def = {
|
|
454
|
+
id: NS,
|
|
455
|
+
kind: 'time-machine',
|
|
456
|
+
priority: 'extension',
|
|
457
|
+
title: () => {
|
|
458
|
+
const a = (ctx.locale && ctx.locale.getSnapshot && ctx.locale.getSnapshot().active) || 'en';
|
|
459
|
+
return a.startsWith('zh') ? '时光机' : (a.startsWith('ru') ? 'Машина времени' : 'Time Machine');
|
|
460
|
+
},
|
|
461
|
+
guide: [{
|
|
462
|
+
order: 35,
|
|
463
|
+
title: () => {
|
|
464
|
+
const a = (ctx.locale && ctx.locale.getSnapshot && ctx.locale.getSnapshot().active) || 'en';
|
|
465
|
+
return a.startsWith('zh') ? '时光机' : (a.startsWith('ru') ? 'Машина времени' : 'Time Machine');
|
|
466
|
+
},
|
|
467
|
+
description: () => {
|
|
468
|
+
const a = (ctx.locale && ctx.locale.getSnapshot && ctx.locale.getSnapshot().active) || 'en';
|
|
469
|
+
return a.startsWith('zh') ? zh.guideDesc : (a.startsWith('ru') ? ru.guideDesc : en.guideDesc);
|
|
470
|
+
},
|
|
471
|
+
icon: TimeMachineIcon
|
|
472
|
+
}]
|
|
473
|
+
};
|
|
474
|
+
|
|
475
|
+
const unregDef = reg.register(def);
|
|
476
|
+
nativeTabRegistered = true;
|
|
477
|
+
|
|
478
|
+
// Register tab body in slot sidebar.right.pane.tab
|
|
479
|
+
const doRegisterPaneTab = () => {
|
|
480
|
+
try {
|
|
481
|
+
ctx.slots.register({
|
|
482
|
+
name: 'sidebar.right.pane.tab',
|
|
483
|
+
key: NS,
|
|
484
|
+
locale: NS,
|
|
485
|
+
inject: () => ({ ctx })
|
|
486
|
+
}, TimeMachineTab);
|
|
487
|
+
} catch (e) {
|
|
488
|
+
console.error('[dsh-time-machine] sidebar.right.pane.tab register failed', e);
|
|
489
|
+
}
|
|
490
|
+
};
|
|
491
|
+
|
|
492
|
+
if (ctx.slots && typeof ctx.slots.inject === 'function') {
|
|
493
|
+
try {
|
|
494
|
+
ctx.slots.inject('sidebar.right.pane.tab', () => {
|
|
495
|
+
doRegisterPaneTab();
|
|
496
|
+
});
|
|
497
|
+
} catch (e) {
|
|
498
|
+
doRegisterPaneTab();
|
|
499
|
+
}
|
|
500
|
+
} else {
|
|
501
|
+
doRegisterPaneTab();
|
|
502
|
+
}
|
|
503
|
+
} catch (e) {
|
|
504
|
+
console.error('[dsh-time-machine] native sidebarRightTabs register failed', e);
|
|
505
|
+
}
|
|
506
|
+
};
|
|
507
|
+
|
|
508
|
+
if (ctx.inject) {
|
|
509
|
+
try {
|
|
510
|
+
ctx.inject(['sidebarRightTabs'], (nctx) => {
|
|
511
|
+
doRegisterNativeSidebar(nctx);
|
|
512
|
+
return () => {};
|
|
513
|
+
});
|
|
514
|
+
} catch (e) {
|
|
515
|
+
if (!String(e && e.message || '').includes('not declared')) {
|
|
516
|
+
console.error('[dsh-time-machine] sidebarRightTabs inject failed', e);
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
}
|
|
421
520
|
};
|
|
422
521
|
return module.exports;
|
|
423
522
|
},
|