@lvce-editor/chat-debug-view 2.1.0 → 2.3.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.
|
@@ -978,7 +978,7 @@ const createDefaultState = () => {
|
|
|
978
978
|
platform: 0,
|
|
979
979
|
sessionId: '',
|
|
980
980
|
sessionIdIndexName: 'sessionId',
|
|
981
|
-
showInputEvents:
|
|
981
|
+
showInputEvents: false,
|
|
982
982
|
uid: 0,
|
|
983
983
|
uri: '',
|
|
984
984
|
width: 0,
|
|
@@ -1028,12 +1028,13 @@ const diff2 = uid => {
|
|
|
1028
1028
|
return diff(oldState, newState);
|
|
1029
1029
|
};
|
|
1030
1030
|
|
|
1031
|
-
const Filter = 'filter';
|
|
1032
|
-
const ShowInputEvents = 'showInputEvents';
|
|
1033
|
-
|
|
1034
1031
|
const getBoolean = value => {
|
|
1035
1032
|
return value === true || value === 'true' || value === 'on' || value === '1';
|
|
1036
1033
|
};
|
|
1034
|
+
|
|
1035
|
+
const Filter = 'filter';
|
|
1036
|
+
const ShowInputEvents = 'showInputEvents';
|
|
1037
|
+
|
|
1037
1038
|
const handleInput = (state, name, value, checked) => {
|
|
1038
1039
|
if (name === Filter) {
|
|
1039
1040
|
return {
|
|
@@ -1241,8 +1242,39 @@ const getCss = () => {
|
|
|
1241
1242
|
opacity: 0.8;
|
|
1242
1243
|
}
|
|
1243
1244
|
|
|
1245
|
+
.ChatDebugViewEventCount {
|
|
1246
|
+
font-size: 12px;
|
|
1247
|
+
opacity: 0.8;
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1244
1250
|
.ChatDebugViewEvents {
|
|
1245
1251
|
overflow: auto;
|
|
1252
|
+
scrollbar-width: thin;
|
|
1253
|
+
scrollbar-color: var(--vscode-scrollbarSlider-background, rgba(121, 121, 121, 0.4)) transparent;
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
.ChatDebugViewEvents::-webkit-scrollbar {
|
|
1257
|
+
width: 10px;
|
|
1258
|
+
height: 10px;
|
|
1259
|
+
}
|
|
1260
|
+
|
|
1261
|
+
.ChatDebugViewEvents::-webkit-scrollbar-track {
|
|
1262
|
+
background: transparent;
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
.ChatDebugViewEvents::-webkit-scrollbar-thumb {
|
|
1266
|
+
background: var(--vscode-scrollbarSlider-background, rgba(121, 121, 121, 0.4));
|
|
1267
|
+
border-radius: 999px;
|
|
1268
|
+
border: 2px solid transparent;
|
|
1269
|
+
background-clip: content-box;
|
|
1270
|
+
}
|
|
1271
|
+
|
|
1272
|
+
.ChatDebugViewEvents::-webkit-scrollbar-thumb:hover {
|
|
1273
|
+
background: var(--vscode-scrollbarSlider-hoverBackground, rgba(100, 100, 100, 0.7));
|
|
1274
|
+
}
|
|
1275
|
+
|
|
1276
|
+
.ChatDebugViewEvents::-webkit-scrollbar-thumb:active {
|
|
1277
|
+
background: var(--vscode-scrollbarSlider-activeBackground, rgba(191, 191, 191, 0.4));
|
|
1246
1278
|
}
|
|
1247
1279
|
|
|
1248
1280
|
.ChatDebugViewEvent {
|
|
@@ -1255,6 +1287,7 @@ const getCss = () => {
|
|
|
1255
1287
|
word-break: break-word;
|
|
1256
1288
|
font-family: var(--vscode-editor-font-family, monospace);
|
|
1257
1289
|
font-size: 12px;
|
|
1290
|
+
user-select: text;
|
|
1258
1291
|
}
|
|
1259
1292
|
|
|
1260
1293
|
.ChatDebugViewEmpty {
|
|
@@ -1423,8 +1456,9 @@ const getChatDebugViewDom = (sessionId, errorMessage, filterValue, showInputEven
|
|
|
1423
1456
|
}, text(errorMessage)];
|
|
1424
1457
|
}
|
|
1425
1458
|
const eventNodes = events.flatMap(getEventNode);
|
|
1459
|
+
const eventCountText = `${events.length} event${events.length === 1 ? '' : 's'}`;
|
|
1426
1460
|
return [{
|
|
1427
|
-
childCount:
|
|
1461
|
+
childCount: 4,
|
|
1428
1462
|
className: 'ChatDebugView',
|
|
1429
1463
|
type: Div
|
|
1430
1464
|
}, {
|
|
@@ -1451,6 +1485,10 @@ const getChatDebugViewDom = (sessionId, errorMessage, filterValue, showInputEven
|
|
|
1451
1485
|
onChange: HandleInput,
|
|
1452
1486
|
type: Input
|
|
1453
1487
|
}, text('Show input events'), {
|
|
1488
|
+
childCount: 1,
|
|
1489
|
+
className: 'ChatDebugViewEventCount',
|
|
1490
|
+
type: Div
|
|
1491
|
+
}, text(eventCountText), {
|
|
1454
1492
|
childCount: 1,
|
|
1455
1493
|
className: 'ChatDebugViewSession',
|
|
1456
1494
|
type: Div
|
|
@@ -1557,6 +1595,15 @@ const saveState = state => {
|
|
|
1557
1595
|
};
|
|
1558
1596
|
};
|
|
1559
1597
|
|
|
1598
|
+
const setEvents = (state, events) => {
|
|
1599
|
+
return {
|
|
1600
|
+
...state,
|
|
1601
|
+
errorMessage: '',
|
|
1602
|
+
events,
|
|
1603
|
+
initial: false
|
|
1604
|
+
};
|
|
1605
|
+
};
|
|
1606
|
+
|
|
1560
1607
|
const setSessionId = async (state, sessionId) => {
|
|
1561
1608
|
const events = await listChatViewEvents(sessionId, state.databaseName, state.dataBaseVersion, state.eventStoreName, state.sessionIdIndexName);
|
|
1562
1609
|
return {
|
|
@@ -1581,6 +1628,7 @@ const commandMap = {
|
|
|
1581
1628
|
'ChatDebug.rerender': wrapCommand(rerender),
|
|
1582
1629
|
'ChatDebug.resize': wrapCommand(resize),
|
|
1583
1630
|
'ChatDebug.saveState': wrapGetter(saveState),
|
|
1631
|
+
'ChatDebug.setEvents': wrapCommand(setEvents),
|
|
1584
1632
|
'ChatDebug.setSessionId': wrapCommand(setSessionId),
|
|
1585
1633
|
'ChatDebug.terminate': terminate
|
|
1586
1634
|
};
|